@applica-software-guru/persona-sdk 0.1.33 → 0.1.34
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 +6 -6
- package/dist/bundle.es.js.map +1 -1
- package/dist/index.d.ts +12 -1
- package/package.json +1 -1
- package/src/billing/billing-client.ts +10 -1
- package/src/billing/types.ts +11 -0
package/dist/bundle.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var C=Object.defineProperty;var E=(o,t,e)=>t in o?C(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var u=(o,t,e)=>E(o,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class p extends Error{constructor(e,s){super(`API Error: ${e} - ${s}`);u(this,"statusCode");u(this,"body");this.statusCode=e,this.body=s}}class g{constructor(t){this.apiKey=t}applyHeaders(t){t.set("x-persona-apikey",this.apiKey)}getCredentials(){return this.apiKey}}class c{constructor(t,e){u(this,"baseUrl");u(this,"authProvider");this.baseUrl=t,this.authProvider=typeof e=="string"?new g(e):e}getBaseUrl(){return this.baseUrl}getAuthProvider(){return this.authProvider}normalizePageParams(t,e){return{page:t===void 0||t<1?1:t,size:e===void 0||e<1?20:e}}buildHeaders(){const t=new Headers;return t.set("Content-Type","application/json"),this.authProvider.applyHeaders(t),t}buildUrl(t,e){const s=new URL(this.baseUrl+t);return e&&Object.entries(e).forEach(([r,n])=>{n!=null&&s.searchParams.set(r,String(n))}),s.toString()}async handleResponse(t){if(!t.ok){const s=await t.text();throw new p(t.status,s)}const e=await t.text();return e?JSON.parse(e):void 0}async httpGet(t,e){const s=await fetch(this.buildUrl(t,e),{method:"GET",headers:this.buildHeaders()});return this.handleResponse(s)}async httpPost(t,e,s){const r=await fetch(this.buildUrl(t,s),{method:"POST",headers:this.buildHeaders(),body:e?JSON.stringify(e):void 0});return this.handleResponse(r)}async httpPut(t,e){const s=await fetch(this.baseUrl+t,{method:"PUT",headers:this.buildHeaders(),body:JSON.stringify(e)});return this.handleResponse(s)}async httpPatch(t,e){const s=await fetch(this.baseUrl+t,{method:"PATCH",headers:this.buildHeaders(),body:JSON.stringify(e)});return this.handleResponse(s)}async httpDelete(t){const e=await fetch(this.baseUrl+t,{method:"DELETE",headers:this.buildHeaders()});if(!e.ok){const s=await e.text();throw new p(e.status,s)}}}class d extends c{constructor(e,s,r){super(e,s);u(this,"billingBaseUrl");this.billingBaseUrl=(r||e).replace(/\/$/,"")}async list(e,s,r){const{page:n,size:a}=this.normalizePageParams(s,r),i={page:n,size:a};return e&&(i.keyword=e),this.httpGet("/projects",i)}async get(e){return this.httpGet("/projects/"+e)}async getMine(){return this.httpGet("/projects/mine")}async create(e){return this.httpPost("/projects",e)}async update(e){return this.httpPut("/projects/"+e.projectId,e)}async remove(e){await this.httpDelete("/projects/"+e)}async duplicate(e,s){return this.httpPost("/projects/"+e+"/actions/duplicate",s)}async getSubscription(e){return this.billingRequest("/projects/"+e+"/subscription","GET")}async changeSubscriptionPlan(e,s){return this.billingRequest("/projects/"+e+"/subscription/actions/change-plan","POST",s)}async addSubscriptionCredits(e,s){return this.billingRequest("/projects/"+e+"/subscription/actions/add-credits","POST",s)}async setInfiniteCredits(e,s){return this.billingRequest("/projects/"+e+"/subscription/actions/set-infinite-credits","POST",s)}async billingRequest(e,s,r){const n=new Headers;n.set("Content-Type","application/json"),this.getAuthProvider().applyHeaders(n);const a=await fetch(this.billingBaseUrl+e,{method:s,headers:n,body:r?JSON.stringify(r):void 0});if(!a.ok){const l=await a.text();throw new p(a.status,l)}const i=await a.text();return i?JSON.parse(i):void 0}}class y extends c{constructor(t,e){super(t,e)}async list(t,e,s,r){const{page:n,size:a}=this.normalizePageParams(e,s),i={page:n,size:a,...r};return t&&(i.keyword=t),this.httpGet("/agents",i)}async get(t){return this.httpGet("/agents/"+t)}async create(t){return this.httpPost("/agents",t)}async update(t){return this.httpPut("/agents/"+t.id,t)}async remove(t){await this.httpDelete("/agents/"+t)}async getSynthesizerSupportedVoices(t){return this.httpGet("/values/synthesizers/"+t+"/voices")}async listRevisions(t){return this.httpGet("/agents/"+t+"/revisions")}async getRevision(t,e){return this.httpGet("/agents/"+t+"/revisions/"+e)}async rollback(t,e){return this.httpPost("/agents/"+t+"/revisions/"+e+"/rollback",{})}async generateSystemInstructions(t,e){const s={prompt:t};return e&&(s.sessionId=e),(await this.httpPost("/agents/system-instructions",s)).instructions}async getArchitect(){return this.httpGet("/agents/architect")}}class m extends c{constructor(e,s,r){super(e,s);u(this,"knowledgeBaseId");this.knowledgeBaseId=r}async list(e,s,r){const{page:n,size:a}=this.normalizePageParams(s,r),i={page:n,size:a};return e&&(i.keyword=e),this.httpGet("/knowledge-bases/"+this.knowledgeBaseId+"/documents",i)}async upload(e){return this.httpPost("/knowledge-bases/"+this.knowledgeBaseId+"/documents",e)}async get(e){return this.httpGet("/knowledge-bases/"+this.knowledgeBaseId+"/documents/"+e)}async reprocess(e){return this.httpPost("/knowledge-bases/"+this.knowledgeBaseId+"/documents",{document_id:e})}async remove(e){await this.httpDelete("/knowledge-bases/"+this.knowledgeBaseId+"/documents/"+e)}}class w extends c{constructor(t,e){super(t,e)}async list(t,e,s,r){const{page:n,size:a}=this.normalizePageParams(e,s),i={page:n,size:a,...r};return t&&(i.keyword=t),this.httpGet("/knowledge-bases",i)}async get(t){return this.httpGet("/knowledge-bases/"+t)}async create(t){return this.httpPost("/knowledge-bases",t)}async update(t){return this.httpPut("/knowledge-bases/"+t.id,t)}async remove(t){await this.httpDelete("/knowledge-bases/"+t)}documents(t){return new m(this.getBaseUrl(),this.getAuthProvider(),t)}async searchChunks(t,e){return this.httpPost("/knowledge-bases/"+t+"/search",e)}}class P extends c{constructor(t,e){super(t,e)}async list(t,e,s){const{page:r,size:n}=this.normalizePageParams(e,s),a={page:r,size:n};return this.httpGet("/workflows/"+t+"/executions",a)}async get(t,e){return this.httpGet("/workflows/"+t+"/executions/"+e)}async run(t,e){return this.httpPost("/workflows/"+t+"/executions",e)}async queue(t,e){return this.httpPost("/workflows/"+t+"/executions/queue",e)}}class b extends c{constructor(t,e){super(t,e)}async list(t,e,s,r){const{page:n,size:a}=this.normalizePageParams(e,s),i={page:n,size:a,...r};return t&&(i.keyword=t),this.httpGet("/workflows",i)}async create(t){return this.httpPost("/workflows",t)}async update(t,e){return e.id=t,this.httpPut("/workflows/"+t,e)}async remove(t){await this.httpDelete("/workflows/"+t)}async get(t){return this.httpGet("/workflows/"+t)}executions(){return new P(this.getBaseUrl(),this.getAuthProvider())}async listRevisions(t){return this.httpGet("/workflows/"+t+"/revisions")}async getRevision(t,e){return this.httpGet("/workflows/"+t+"/revisions/"+e)}async rollback(t,e){return this.httpPost("/workflows/"+t+"/revisions/"+e+"/rollback",{})}}class v extends c{constructor(t,e){super(t,e)}async authorize(t,e){return this.httpPost("/credentials/"+t+"/authorize",e)}async handleOAuth2Callback(t,e,s,r){const n={code:e,state:s};return r&&(n.scope=r),this.httpGet("/credentials/"+t+"/oauth2/callback",n)}async list(){return this.httpGet("/credentials")}async getByProvider(t){return this.httpGet("/credentials/"+t)}async getById(t){return this.httpGet("/credentials/all/"+t)}async remove(t){await this.httpDelete("/credentials/all/"+t)}}class f extends c{constructor(t,e){super(t,e)}async list(t,e,s,r){const{page:n,size:a}=this.normalizePageParams(e,s),i={page:n,size:a,...r};return t&&(i.keyword=t),this.httpGet("/features/templates",i)}async get(t){return this.httpGet("/features/templates/"+t)}async create(t){return this.httpPost("/features/templates",t)}async update(t,e){return this.httpPut("/features/templates/"+t,e)}async patch(t,e){return this.httpPatch("/features/templates/"+t,e)}async remove(t){await this.httpDelete("/features/templates/"+t)}async getMcpAvailableTools(t,e){const s=e?{credentialsId:e}:void 0;return this.httpPost("/features/templates/mcp/available-tools",t,s)}}class G{constructor(t,e){u(this,"baseUrl");u(this,"auth");this.baseUrl=t,this.auth=e}templates(){return new f(this.baseUrl,this.auth)}}class k extends c{constructor(t,e){super(t,e)}async list(t,e,s){const{page:r,size:n}=this.normalizePageParams(e,s),a={page:r,size:n};return this.httpGet("/triggers/"+t+"/executions",a)}async execute(t,e){return this.httpPost("/triggers/"+t+"/executions",e)}async get(t){return this.httpGet("/triggers/executions/"+t)}async remove(t){await this.httpDelete("/triggers/executions/"+t)}}class z extends c{constructor(t,e){super(t,e)}async list(t,e,s,r){const{page:n,size:a}=this.normalizePageParams(e,s),i={page:n,size:a,...r};return t&&(i.keyword=t),this.httpGet("/triggers",i)}async create(t){return this.httpPost("/triggers",t)}async update(t,e){return this.httpPut("/triggers/"+t,e)}async remove(t){await this.httpDelete("/triggers/"+t)}async get(t){return this.httpGet("/triggers/"+t)}executions(){return new k(this.getBaseUrl(),this.getAuthProvider())}}class A extends c{constructor(t,e){super(t,e)}async list(t,e,s,r){const{page:n,size:a}=this.normalizePageParams(e,s),i={page:n,size:a,...r};return t&&(i.keyword=t),this.httpGet("/service-prices",i)}async get(t){return this.httpGet("/service-prices/"+t)}async create(t){return this.httpPost("/service-prices",t)}async update(t,e){return this.httpPut("/service-prices/"+t,e)}async remove(t){await this.httpDelete("/service-prices/"+t)}}class U extends c{constructor(t,e){super(t,e)}async list(t,e,s,r){const{page:n,size:a}=this.normalizePageParams(e,s),i={page:n,size:a,...r};return t&&(i.keyword=t),this.httpGet("/known-models",i)}async get(t){return this.httpGet("/known-models/"+t)}async create(t){return this.httpPost("/known-models",t)}async update(t,e){return this.httpPut("/known-models/"+t,e)}async remove(t){await this.httpDelete("/known-models/"+t)}}class x extends c{constructor(t,e){super(t,e)}async list(t,e,s,r,n,a){const{page:i,size:l}=this.normalizePageParams(n,a),h={page:i,size:l};return t&&(h.keyword=t),e&&(h.status=e),s&&(h.agentId=s),r&&(h.userId=r),this.httpGet("/sessions",h)}async get(t){return this.httpGet("/sessions/"+t)}async getUsage(t){return this.httpGet("/sessions/"+t+"/usage")}async generateMessage(t,e){return this.httpPost("/sessions/"+t+"/messages",e)}async findMessages(t,e,s){const{page:r,size:n}=this.normalizePageParams(e,s),a={page:r,size:n};return this.httpGet("/sessions/"+t+"/messages",a)}async remove(t){await this.httpDelete("/sessions/"+t)}async rename(t,e){return this.httpPut("/sessions/"+t+"/name",{name:e})}async getAgentState(t){return this.httpGet("/sessions/"+encodeURIComponent(t)+"/agent-state")}async cancelExecution(t){return this.httpPost("/sessions/"+encodeURIComponent(t)+"/cancel",{})}async steerExecution(t,e){return this.httpPost("/sessions/"+encodeURIComponent(t)+"/steer",{text:e})}}class S extends c{constructor(t,e){super(t,e)}async list(t,e,s,r){const{page:n,size:a}=this.normalizePageParams(e,s),i={page:n,size:a};return t&&(i.keyword=t),r&&(i.status=r),this.httpGet("/missions",i)}async get(t){return this.httpGet("/missions/"+t)}async create(t){return this.httpPost("/missions",t)}async update(t,e){return this.httpPut("/missions/"+t,e)}async remove(t){await this.httpDelete("/missions/"+t)}async generate(t){return this.httpPost("/missions/"+t+"/generate")}async execute(t){return this.httpPost("/missions/"+t+"/execute")}async retry(t){return this.httpPost("/missions/"+t+"/retry")}async replan(t){return this.httpPost("/missions/"+t+"/replan")}async sendInstruction(t,e){return this.httpPost("/missions/"+t+"/instructions",{instruction:e})}async stop(t){return this.httpPost("/missions/"+t+"/stop")}async resume(t){return this.httpPost("/missions/"+t+"/continue")}}class T{constructor(t,e){u(this,"baseUrl");u(this,"authProvider");this.baseUrl=(t||"https://persona.applica.guru/billing").replace(/\/$/,""),this.authProvider=e??null}buildHeaders(){const t=new Headers;return t.set("Content-Type","application/json"),this.authProvider&&(typeof this.authProvider=="string"?t.set("x-persona-apikey",this.authProvider):this.authProvider.applyHeaders(t)),t}async request(t,e,s){const r=await fetch(this.baseUrl+t,{method:e,headers:this.buildHeaders(),body:s?JSON.stringify(s):void 0});if(!r.ok){const a=await r.text();throw new p(r.status,a)}const n=await r.text();return n?JSON.parse(n):void 0}async createCustomer(t){return this.request("/customers","POST",t)}async updateCustomer(t,e){return this.request("/customers/"+t,"PUT",e)}async getCustomer(t){return this.request("/customers/"+t,"GET")}async saveCustomer(t){return this.request("/customers","POST",t)}async deleteCustomer(t){await this.request("/customers/"+t,"DELETE")}async createSubscription(t){return this.request("/customers/"+t.owner+"/subscription","POST",t)}async getSubscription(t){return this.request("/customers/"+t+"/subscription","GET")}async getProjectSubscription(t){return this.request("/projects/"+t+"/subscription","GET")}async changeProjectSubscriptionPlan(t,e){return this.request("/projects/"+t+"/subscription/actions/change-plan","POST",e)}async addProjectSubscriptionCredits(t,e){return this.request("/projects/"+t+"/subscription/actions/add-credits","POST",e)}async beginUpgrade(t,e){return this.request("/customers/"+t+"/subscription/actions/upgrade","POST",e)}async downgrade(t,e){return this.request("/customers/"+t+"/subscription/actions/downgrade","POST",e)}async mentorize(t,e){return this.request("/customers/"+t+"/subscription/actions/mentorize","POST",e)}async addCredits(t,e){return this.request("/customers/"+t+"/subscription/credits","POST",{credits:e})}async useCredits(t,e,s,r){const n={credits:e,services:s};return r&&(n.referenceId=r),this.request("/customers/"+t+"/subscription/credits","DELETE",n)}async getCredits(t){try{return(await this.request("/customers/"+t+"/subscription/credits","GET")).credits??0}catch{return 0}}async isValid(t){try{return(await this.request("/customers/"+t+"/subscription/valid","GET")).valid??!1}catch{return!1}}async listInvoices(t,e,s){const r=[];e&&r.push("date_from="+e),s&&r.push("date_to="+s);const n=r.length>0?"?"+r.join("&"):"";return this.request("/customers/"+t+"/invoices"+n,"GET")}async cancelSubscription(t){return this.request("/customers/"+t+"/subscription/actions/cancel","POST",{})}async getUsageStats(t,e,s,r){const n=[];e&&n.push("date_from="+encodeURIComponent(e)),s&&n.push("date_to="+encodeURIComponent(s)),r!=null&&r.length&&r.forEach(i=>n.push("model="+encodeURIComponent(i)));const a=n.length>0?"?"+n.join("&"):"";return this.request("/projects/"+t+"/subscription/usage-stats"+a,"GET")}}class B extends c{constructor(t,e){super(t,e)}async get(t){return this.httpGet("/values/"+t)}async getLanguageCodes(){return this.httpGet("/values/language-codes")}async getModelNames(){return this.httpGet("/values/model-names")}async getModelProviders(){return this.httpGet("/values/model-providers")}async getKnowledgeTypes(){return this.httpGet("/values/knowledge-types")}async getCollaborationModes(){return this.httpGet("/values/collaboration-modes")}async getTranscriberNames(){return this.httpGet("/values/transcriber-names")}async getSynthesizerNames(){return this.httpGet("/values/synthesizer-names")}async getSynthesizerVoices(t){return this.httpGet("/values/synthesizers/"+t+"/voices")}async getStmTypes(){return this.httpGet("/values/stm-types")}async getDocumentExtractors(){return this.httpGet("/values/document-extractors")}async getEmbeddingModels(){return this.httpGet("/values/embedding-models")}async getQualityOptions(){return this.httpGet("/values/quality")}async getChunkSizeOptions(){return this.httpGet("/values/chunk-size")}async getFeatureTypes(){return this.httpGet("/values/feature-types")}async getRoles(){return this.httpGet("/values/roles")}async getServiceUnits(){return this.httpGet("/values/service-units")}async getTriggerSourceTypes(){return this.httpGet("/values/trigger-source-types")}async getTriggerDestinationTypes(){return this.httpGet("/values/trigger-destination-types")}}class j{constructor(t,e,s){u(this,"baseUrl");u(this,"workflowsBaseUrl");u(this,"billingBaseUrl");this.baseUrl=t,this.workflowsBaseUrl=e,this.billingBaseUrl=s||"https://persona.applica.guru/billing"}projects(t){return new d(this.baseUrl,t,this.billingBaseUrl)}agents(t){return new y(this.baseUrl,t)}knowledgeBases(t){return new w(this.baseUrl,t)}workflows(t){return new b(this.workflowsBaseUrl,t)}credentials(t){return new v(this.baseUrl,t)}features(t){return new G(this.baseUrl,t)}triggers(t){return new z(this.baseUrl,t)}servicePrices(t){return new A(this.baseUrl,t)}knownModels(t){return new U(this.baseUrl,t)}sessions(t){return new x(this.baseUrl,t)}missions(t){return new S(this.baseUrl,t)}billing(t){return new T(this.billingBaseUrl,t)}values(t){return new B(this.baseUrl,t)}}class q{constructor(t){this.token=t}applyHeaders(t){t.set("Authorization",`Bearer ${this.token}`)}getCredentials(){return this.token}}exports.AgentsApi=y;exports.ApiException=p;exports.ApiKeyAuthenticationProvider=g;exports.BearerTokenAuthenticationProvider=q;exports.BillingClient=T;exports.CredentialsApi=v;exports.FeatureTemplatesApi=f;exports.FeaturesApi=G;exports.KnowledgeBaseDocumentsApi=m;exports.KnowledgeBasesApi=w;exports.KnownModelsApi=U;exports.MissionsApi=S;exports.PersonaSdk=j;exports.ProjectsApi=d;exports.ServicePricesApi=A;exports.SessionsApi=x;exports.TriggerExecutionsApi=k;exports.TriggersApi=z;exports.ValuesApi=B;exports.WorkflowExecutionsApi=P;exports.WorkflowsApi=b;
|
|
1
|
+
"use strict";var C=Object.defineProperty;var E=(o,t,e)=>t in o?C(o,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[t]=e;var u=(o,t,e)=>E(o,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class p extends Error{constructor(e,s){super(`API Error: ${e} - ${s}`);u(this,"statusCode");u(this,"body");this.statusCode=e,this.body=s}}class d{constructor(t){this.apiKey=t}applyHeaders(t){t.set("x-persona-apikey",this.apiKey)}getCredentials(){return this.apiKey}}class c{constructor(t,e){u(this,"baseUrl");u(this,"authProvider");this.baseUrl=t,this.authProvider=typeof e=="string"?new d(e):e}getBaseUrl(){return this.baseUrl}getAuthProvider(){return this.authProvider}normalizePageParams(t,e){return{page:t===void 0||t<1?1:t,size:e===void 0||e<1?20:e}}buildHeaders(){const t=new Headers;return t.set("Content-Type","application/json"),this.authProvider.applyHeaders(t),t}buildUrl(t,e){const s=new URL(this.baseUrl+t);return e&&Object.entries(e).forEach(([r,n])=>{n!=null&&s.searchParams.set(r,String(n))}),s.toString()}async handleResponse(t){if(!t.ok){const s=await t.text();throw new p(t.status,s)}const e=await t.text();return e?JSON.parse(e):void 0}async httpGet(t,e){const s=await fetch(this.buildUrl(t,e),{method:"GET",headers:this.buildHeaders()});return this.handleResponse(s)}async httpPost(t,e,s){const r=await fetch(this.buildUrl(t,s),{method:"POST",headers:this.buildHeaders(),body:e?JSON.stringify(e):void 0});return this.handleResponse(r)}async httpPut(t,e){const s=await fetch(this.baseUrl+t,{method:"PUT",headers:this.buildHeaders(),body:JSON.stringify(e)});return this.handleResponse(s)}async httpPatch(t,e){const s=await fetch(this.baseUrl+t,{method:"PATCH",headers:this.buildHeaders(),body:JSON.stringify(e)});return this.handleResponse(s)}async httpDelete(t){const e=await fetch(this.baseUrl+t,{method:"DELETE",headers:this.buildHeaders()});if(!e.ok){const s=await e.text();throw new p(e.status,s)}}}class g extends c{constructor(e,s,r){super(e,s);u(this,"billingBaseUrl");this.billingBaseUrl=(r||e).replace(/\/$/,"")}async list(e,s,r){const{page:n,size:a}=this.normalizePageParams(s,r),i={page:n,size:a};return e&&(i.keyword=e),this.httpGet("/projects",i)}async get(e){return this.httpGet("/projects/"+e)}async getMine(){return this.httpGet("/projects/mine")}async create(e){return this.httpPost("/projects",e)}async update(e){return this.httpPut("/projects/"+e.projectId,e)}async remove(e){await this.httpDelete("/projects/"+e)}async duplicate(e,s){return this.httpPost("/projects/"+e+"/actions/duplicate",s)}async getSubscription(e){return this.billingRequest("/projects/"+e+"/subscription","GET")}async changeSubscriptionPlan(e,s){return this.billingRequest("/projects/"+e+"/subscription/actions/change-plan","POST",s)}async addSubscriptionCredits(e,s){return this.billingRequest("/projects/"+e+"/subscription/actions/add-credits","POST",s)}async setInfiniteCredits(e,s){return this.billingRequest("/projects/"+e+"/subscription/actions/set-infinite-credits","POST",s)}async billingRequest(e,s,r){const n=new Headers;n.set("Content-Type","application/json"),this.getAuthProvider().applyHeaders(n);const a=await fetch(this.billingBaseUrl+e,{method:s,headers:n,body:r?JSON.stringify(r):void 0});if(!a.ok){const l=await a.text();throw new p(a.status,l)}const i=await a.text();return i?JSON.parse(i):void 0}}class y extends c{constructor(t,e){super(t,e)}async list(t,e,s,r){const{page:n,size:a}=this.normalizePageParams(e,s),i={page:n,size:a,...r};return t&&(i.keyword=t),this.httpGet("/agents",i)}async get(t){return this.httpGet("/agents/"+t)}async create(t){return this.httpPost("/agents",t)}async update(t){return this.httpPut("/agents/"+t.id,t)}async remove(t){await this.httpDelete("/agents/"+t)}async getSynthesizerSupportedVoices(t){return this.httpGet("/values/synthesizers/"+t+"/voices")}async listRevisions(t){return this.httpGet("/agents/"+t+"/revisions")}async getRevision(t,e){return this.httpGet("/agents/"+t+"/revisions/"+e)}async rollback(t,e){return this.httpPost("/agents/"+t+"/revisions/"+e+"/rollback",{})}async generateSystemInstructions(t,e){const s={prompt:t};return e&&(s.sessionId=e),(await this.httpPost("/agents/system-instructions",s)).instructions}async getArchitect(){return this.httpGet("/agents/architect")}}class m extends c{constructor(e,s,r){super(e,s);u(this,"knowledgeBaseId");this.knowledgeBaseId=r}async list(e,s,r){const{page:n,size:a}=this.normalizePageParams(s,r),i={page:n,size:a};return e&&(i.keyword=e),this.httpGet("/knowledge-bases/"+this.knowledgeBaseId+"/documents",i)}async upload(e){return this.httpPost("/knowledge-bases/"+this.knowledgeBaseId+"/documents",e)}async get(e){return this.httpGet("/knowledge-bases/"+this.knowledgeBaseId+"/documents/"+e)}async reprocess(e){return this.httpPost("/knowledge-bases/"+this.knowledgeBaseId+"/documents",{document_id:e})}async remove(e){await this.httpDelete("/knowledge-bases/"+this.knowledgeBaseId+"/documents/"+e)}}class w extends c{constructor(t,e){super(t,e)}async list(t,e,s,r){const{page:n,size:a}=this.normalizePageParams(e,s),i={page:n,size:a,...r};return t&&(i.keyword=t),this.httpGet("/knowledge-bases",i)}async get(t){return this.httpGet("/knowledge-bases/"+t)}async create(t){return this.httpPost("/knowledge-bases",t)}async update(t){return this.httpPut("/knowledge-bases/"+t.id,t)}async remove(t){await this.httpDelete("/knowledge-bases/"+t)}documents(t){return new m(this.getBaseUrl(),this.getAuthProvider(),t)}async searchChunks(t,e){return this.httpPost("/knowledge-bases/"+t+"/search",e)}}class P extends c{constructor(t,e){super(t,e)}async list(t,e,s){const{page:r,size:n}=this.normalizePageParams(e,s),a={page:r,size:n};return this.httpGet("/workflows/"+t+"/executions",a)}async get(t,e){return this.httpGet("/workflows/"+t+"/executions/"+e)}async run(t,e){return this.httpPost("/workflows/"+t+"/executions",e)}async queue(t,e){return this.httpPost("/workflows/"+t+"/executions/queue",e)}}class b extends c{constructor(t,e){super(t,e)}async list(t,e,s,r){const{page:n,size:a}=this.normalizePageParams(e,s),i={page:n,size:a,...r};return t&&(i.keyword=t),this.httpGet("/workflows",i)}async create(t){return this.httpPost("/workflows",t)}async update(t,e){return e.id=t,this.httpPut("/workflows/"+t,e)}async remove(t){await this.httpDelete("/workflows/"+t)}async get(t){return this.httpGet("/workflows/"+t)}executions(){return new P(this.getBaseUrl(),this.getAuthProvider())}async listRevisions(t){return this.httpGet("/workflows/"+t+"/revisions")}async getRevision(t,e){return this.httpGet("/workflows/"+t+"/revisions/"+e)}async rollback(t,e){return this.httpPost("/workflows/"+t+"/revisions/"+e+"/rollback",{})}}class v extends c{constructor(t,e){super(t,e)}async authorize(t,e){return this.httpPost("/credentials/"+t+"/authorize",e)}async handleOAuth2Callback(t,e,s,r){const n={code:e,state:s};return r&&(n.scope=r),this.httpGet("/credentials/"+t+"/oauth2/callback",n)}async list(){return this.httpGet("/credentials")}async getByProvider(t){return this.httpGet("/credentials/"+t)}async getById(t){return this.httpGet("/credentials/all/"+t)}async remove(t){await this.httpDelete("/credentials/all/"+t)}}class f extends c{constructor(t,e){super(t,e)}async list(t,e,s,r){const{page:n,size:a}=this.normalizePageParams(e,s),i={page:n,size:a,...r};return t&&(i.keyword=t),this.httpGet("/features/templates",i)}async get(t){return this.httpGet("/features/templates/"+t)}async create(t){return this.httpPost("/features/templates",t)}async update(t,e){return this.httpPut("/features/templates/"+t,e)}async patch(t,e){return this.httpPatch("/features/templates/"+t,e)}async remove(t){await this.httpDelete("/features/templates/"+t)}async getMcpAvailableTools(t,e){const s=e?{credentialsId:e}:void 0;return this.httpPost("/features/templates/mcp/available-tools",t,s)}}class G{constructor(t,e){u(this,"baseUrl");u(this,"auth");this.baseUrl=t,this.auth=e}templates(){return new f(this.baseUrl,this.auth)}}class k extends c{constructor(t,e){super(t,e)}async list(t,e,s){const{page:r,size:n}=this.normalizePageParams(e,s),a={page:r,size:n};return this.httpGet("/triggers/"+t+"/executions",a)}async execute(t,e){return this.httpPost("/triggers/"+t+"/executions",e)}async get(t){return this.httpGet("/triggers/executions/"+t)}async remove(t){await this.httpDelete("/triggers/executions/"+t)}}class z extends c{constructor(t,e){super(t,e)}async list(t,e,s,r){const{page:n,size:a}=this.normalizePageParams(e,s),i={page:n,size:a,...r};return t&&(i.keyword=t),this.httpGet("/triggers",i)}async create(t){return this.httpPost("/triggers",t)}async update(t,e){return this.httpPut("/triggers/"+t,e)}async remove(t){await this.httpDelete("/triggers/"+t)}async get(t){return this.httpGet("/triggers/"+t)}executions(){return new k(this.getBaseUrl(),this.getAuthProvider())}}class A extends c{constructor(t,e){super(t,e)}async list(t,e,s,r){const{page:n,size:a}=this.normalizePageParams(e,s),i={page:n,size:a,...r};return t&&(i.keyword=t),this.httpGet("/service-prices",i)}async get(t){return this.httpGet("/service-prices/"+t)}async create(t){return this.httpPost("/service-prices",t)}async update(t,e){return this.httpPut("/service-prices/"+t,e)}async remove(t){await this.httpDelete("/service-prices/"+t)}}class U extends c{constructor(t,e){super(t,e)}async list(t,e,s,r){const{page:n,size:a}=this.normalizePageParams(e,s),i={page:n,size:a,...r};return t&&(i.keyword=t),this.httpGet("/known-models",i)}async get(t){return this.httpGet("/known-models/"+t)}async create(t){return this.httpPost("/known-models",t)}async update(t,e){return this.httpPut("/known-models/"+t,e)}async remove(t){await this.httpDelete("/known-models/"+t)}}class x extends c{constructor(t,e){super(t,e)}async list(t,e,s,r,n,a){const{page:i,size:l}=this.normalizePageParams(n,a),h={page:i,size:l};return t&&(h.keyword=t),e&&(h.status=e),s&&(h.agentId=s),r&&(h.userId=r),this.httpGet("/sessions",h)}async get(t){return this.httpGet("/sessions/"+t)}async getUsage(t){return this.httpGet("/sessions/"+t+"/usage")}async generateMessage(t,e){return this.httpPost("/sessions/"+t+"/messages",e)}async findMessages(t,e,s){const{page:r,size:n}=this.normalizePageParams(e,s),a={page:r,size:n};return this.httpGet("/sessions/"+t+"/messages",a)}async remove(t){await this.httpDelete("/sessions/"+t)}async rename(t,e){return this.httpPut("/sessions/"+t+"/name",{name:e})}async getAgentState(t){return this.httpGet("/sessions/"+encodeURIComponent(t)+"/agent-state")}async cancelExecution(t){return this.httpPost("/sessions/"+encodeURIComponent(t)+"/cancel",{})}async steerExecution(t,e){return this.httpPost("/sessions/"+encodeURIComponent(t)+"/steer",{text:e})}}class S extends c{constructor(t,e){super(t,e)}async list(t,e,s,r){const{page:n,size:a}=this.normalizePageParams(e,s),i={page:n,size:a};return t&&(i.keyword=t),r&&(i.status=r),this.httpGet("/missions",i)}async get(t){return this.httpGet("/missions/"+t)}async create(t){return this.httpPost("/missions",t)}async update(t,e){return this.httpPut("/missions/"+t,e)}async remove(t){await this.httpDelete("/missions/"+t)}async generate(t){return this.httpPost("/missions/"+t+"/generate")}async execute(t){return this.httpPost("/missions/"+t+"/execute")}async retry(t){return this.httpPost("/missions/"+t+"/retry")}async replan(t){return this.httpPost("/missions/"+t+"/replan")}async sendInstruction(t,e){return this.httpPost("/missions/"+t+"/instructions",{instruction:e})}async stop(t){return this.httpPost("/missions/"+t+"/stop")}async resume(t){return this.httpPost("/missions/"+t+"/continue")}}class T{constructor(t,e){u(this,"baseUrl");u(this,"authProvider");this.baseUrl=(t||"https://persona.applica.guru/billing").replace(/\/$/,""),this.authProvider=e??null}buildHeaders(){const t=new Headers;return t.set("Content-Type","application/json"),this.authProvider&&(typeof this.authProvider=="string"?t.set("x-persona-apikey",this.authProvider):this.authProvider.applyHeaders(t)),t}async request(t,e,s){const r=await fetch(this.baseUrl+t,{method:e,headers:this.buildHeaders(),body:s?JSON.stringify(s):void 0});if(!r.ok){const a=await r.text();throw new p(r.status,a)}const n=await r.text();return n?JSON.parse(n):void 0}async createCustomer(t){return this.request("/customers","POST",t)}async updateCustomer(t,e){return this.request("/customers/"+t,"PUT",e)}async getCustomer(t){return this.request("/customers/"+t,"GET")}async saveCustomer(t){return this.request("/customers","POST",t)}async deleteCustomer(t){await this.request("/customers/"+t,"DELETE")}async createSubscription(t){return this.request("/customers/"+t.owner+"/subscription","POST",t)}async getSubscription(t){return this.request("/customers/"+t+"/subscription","GET")}async getProjectSubscription(t){return this.request("/projects/"+t+"/subscription","GET")}async changeProjectSubscriptionPlan(t,e){return this.request("/projects/"+t+"/subscription/actions/change-plan","POST",e)}async addProjectSubscriptionCredits(t,e){return this.request("/projects/"+t+"/subscription/actions/add-credits","POST",e)}async beginUpgrade(t,e){return this.request("/customers/"+t+"/subscription/actions/upgrade","POST",e)}async downgrade(t,e){return this.request("/customers/"+t+"/subscription/actions/downgrade","POST",e)}async mentorize(t,e){return this.request("/customers/"+t+"/subscription/actions/mentorize","POST",e)}async addCredits(t,e){return this.request("/customers/"+t+"/subscription/credits","POST",{credits:e})}async useCredits(t,e,s,r,n,a){const i={credits:e,services:s};return r&&(i.referenceId=r),n!==void 0&&(i.totalCost=n),a!==void 0&&(i.totalPrice=a),this.request("/customers/"+t+"/subscription/credits","DELETE",i)}async getCredits(t){try{return(await this.request("/customers/"+t+"/subscription/credits","GET")).credits??0}catch{return 0}}async isValid(t){try{return(await this.request("/customers/"+t+"/subscription/valid","GET")).valid??!1}catch{return!1}}async listInvoices(t,e,s){const r=[];e&&r.push("date_from="+e),s&&r.push("date_to="+s);const n=r.length>0?"?"+r.join("&"):"";return this.request("/customers/"+t+"/invoices"+n,"GET")}async cancelSubscription(t){return this.request("/customers/"+t+"/subscription/actions/cancel","POST",{})}async getUsageStats(t,e,s,r){const n=[];e&&n.push("date_from="+encodeURIComponent(e)),s&&n.push("date_to="+encodeURIComponent(s)),r!=null&&r.length&&r.forEach(i=>n.push("model="+encodeURIComponent(i)));const a=n.length>0?"?"+n.join("&"):"";return this.request("/projects/"+t+"/subscription/usage-stats"+a,"GET")}}class B extends c{constructor(t,e){super(t,e)}async get(t){return this.httpGet("/values/"+t)}async getLanguageCodes(){return this.httpGet("/values/language-codes")}async getModelNames(){return this.httpGet("/values/model-names")}async getModelProviders(){return this.httpGet("/values/model-providers")}async getKnowledgeTypes(){return this.httpGet("/values/knowledge-types")}async getCollaborationModes(){return this.httpGet("/values/collaboration-modes")}async getTranscriberNames(){return this.httpGet("/values/transcriber-names")}async getSynthesizerNames(){return this.httpGet("/values/synthesizer-names")}async getSynthesizerVoices(t){return this.httpGet("/values/synthesizers/"+t+"/voices")}async getStmTypes(){return this.httpGet("/values/stm-types")}async getDocumentExtractors(){return this.httpGet("/values/document-extractors")}async getEmbeddingModels(){return this.httpGet("/values/embedding-models")}async getQualityOptions(){return this.httpGet("/values/quality")}async getChunkSizeOptions(){return this.httpGet("/values/chunk-size")}async getFeatureTypes(){return this.httpGet("/values/feature-types")}async getRoles(){return this.httpGet("/values/roles")}async getServiceUnits(){return this.httpGet("/values/service-units")}async getTriggerSourceTypes(){return this.httpGet("/values/trigger-source-types")}async getTriggerDestinationTypes(){return this.httpGet("/values/trigger-destination-types")}}class j{constructor(t,e,s){u(this,"baseUrl");u(this,"workflowsBaseUrl");u(this,"billingBaseUrl");this.baseUrl=t,this.workflowsBaseUrl=e,this.billingBaseUrl=s||"https://persona.applica.guru/billing"}projects(t){return new g(this.baseUrl,t,this.billingBaseUrl)}agents(t){return new y(this.baseUrl,t)}knowledgeBases(t){return new w(this.baseUrl,t)}workflows(t){return new b(this.workflowsBaseUrl,t)}credentials(t){return new v(this.baseUrl,t)}features(t){return new G(this.baseUrl,t)}triggers(t){return new z(this.baseUrl,t)}servicePrices(t){return new A(this.baseUrl,t)}knownModels(t){return new U(this.baseUrl,t)}sessions(t){return new x(this.baseUrl,t)}missions(t){return new S(this.baseUrl,t)}billing(t){return new T(this.billingBaseUrl,t)}values(t){return new B(this.baseUrl,t)}}class q{constructor(t){this.token=t}applyHeaders(t){t.set("Authorization",`Bearer ${this.token}`)}getCredentials(){return this.token}}exports.AgentsApi=y;exports.ApiException=p;exports.ApiKeyAuthenticationProvider=d;exports.BearerTokenAuthenticationProvider=q;exports.BillingClient=T;exports.CredentialsApi=v;exports.FeatureTemplatesApi=f;exports.FeaturesApi=G;exports.KnowledgeBaseDocumentsApi=m;exports.KnowledgeBasesApi=w;exports.KnownModelsApi=U;exports.MissionsApi=S;exports.PersonaSdk=j;exports.ProjectsApi=g;exports.ServicePricesApi=A;exports.SessionsApi=x;exports.TriggerExecutionsApi=k;exports.TriggersApi=z;exports.ValuesApi=B;exports.WorkflowExecutionsApi=P;exports.WorkflowsApi=b;
|
|
2
2
|
//# sourceMappingURL=bundle.cjs.js.map
|
package/dist/bundle.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.cjs.js","sources":["../src/exceptions.ts","../src/auth/api-key-auth.ts","../src/http-api.ts","../src/projects/projects-api.ts","../src/agents/agents-api.ts","../src/knowledges/knowledge-base-documents-api.ts","../src/knowledges/knowledge-bases-api.ts","../src/workflows/workflow-executions-api.ts","../src/workflows/workflows-api.ts","../src/credentials/credentials-api.ts","../src/features/feature-templates-api.ts","../src/features/features-api.ts","../src/triggers/trigger-executions-api.ts","../src/triggers/triggers-api.ts","../src/service-prices/service-prices-api.ts","../src/known-models/known-models-api.ts","../src/sessions/sessions-api.ts","../src/missions/missions-api.ts","../src/billing/billing-client.ts","../src/values/values-api.ts","../src/persona-sdk.ts","../src/auth/bearer-token-auth.ts"],"sourcesContent":["export class ApiException extends Error {\n public readonly statusCode: number;\n public readonly body: string;\n\n constructor(statusCode: number, body: string) {\n super(`API Error: ${statusCode} - ${body}`);\n this.statusCode = statusCode;\n this.body = body;\n }\n}\n","import { AuthenticationProvider } from './authentication-provider';\n\nexport class ApiKeyAuthenticationProvider implements AuthenticationProvider {\n constructor(private readonly apiKey: string) {}\n\n applyHeaders(headers: Headers): void {\n headers.set('x-persona-apikey', this.apiKey);\n }\n\n getCredentials(): string {\n return this.apiKey;\n }\n}\n","import { ApiException } from './exceptions';\nimport { AuthenticationProvider } from './auth/authentication-provider';\nimport { ApiKeyAuthenticationProvider } from './auth/api-key-auth';\n\nexport abstract class HttpApi {\n private readonly baseUrl: string;\n private readonly authProvider: AuthenticationProvider;\n\n constructor(baseUrl: string, apiKey: string | AuthenticationProvider) {\n this.baseUrl = baseUrl;\n this.authProvider = typeof apiKey === 'string' ? new ApiKeyAuthenticationProvider(apiKey) : apiKey;\n }\n\n protected getBaseUrl(): string {\n return this.baseUrl;\n }\n\n protected getAuthProvider(): AuthenticationProvider {\n return this.authProvider;\n }\n\n protected normalizePageParams(page?: number, size?: number): { page: number; size: number } {\n return {\n page: page === undefined || page < 1 ? 1 : page,\n size: size === undefined || size < 1 ? 20 : size,\n };\n }\n\n private buildHeaders(): Headers {\n const headers = new Headers();\n headers.set('Content-Type', 'application/json');\n this.authProvider.applyHeaders(headers);\n return headers;\n }\n\n private buildUrl(path: string, params?: Record<string, unknown>): string {\n const url = new URL(this.baseUrl + path);\n if (params) {\n Object.entries(params).forEach(([key, value]) => {\n if (value !== null && value !== undefined) {\n url.searchParams.set(key, String(value));\n }\n });\n }\n return url.toString();\n }\n\n private async handleResponse<T>(response: Response): Promise<T> {\n if (!response.ok) {\n const body = await response.text();\n throw new ApiException(response.status, body);\n }\n const text = await response.text();\n return text ? JSON.parse(text) : (undefined as T);\n }\n\n protected async httpGet<T>(path: string, params?: Record<string, unknown>): Promise<T> {\n const response = await fetch(this.buildUrl(path, params), {\n method: 'GET',\n headers: this.buildHeaders(),\n });\n return this.handleResponse<T>(response);\n }\n\n protected async httpPost<T>(path: string, body?: unknown, params?: Record<string, unknown>): Promise<T> {\n const response = await fetch(this.buildUrl(path, params), {\n method: 'POST',\n headers: this.buildHeaders(),\n body: body ? JSON.stringify(body) : undefined,\n });\n return this.handleResponse<T>(response);\n }\n\n protected async httpPut<T>(path: string, body: unknown): Promise<T> {\n const response = await fetch(this.baseUrl + path, {\n method: 'PUT',\n headers: this.buildHeaders(),\n body: JSON.stringify(body),\n });\n return this.handleResponse<T>(response);\n }\n\n protected async httpPatch<T>(path: string, body: unknown): Promise<T> {\n const response = await fetch(this.baseUrl + path, {\n method: 'PATCH',\n headers: this.buildHeaders(),\n body: JSON.stringify(body),\n });\n return this.handleResponse<T>(response);\n }\n\n protected async httpDelete(path: string): Promise<void> {\n const response = await fetch(this.baseUrl + path, {\n method: 'DELETE',\n headers: this.buildHeaders(),\n });\n if (!response.ok) {\n const body = await response.text();\n throw new ApiException(response.status, body);\n }\n }\n}\n","import { HttpApi } from '../http-api';\nimport { ApiException } from '../exceptions';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n Project,\n ProjectCreateRequest,\n ProjectUpdateRequest,\n ProjectDuplicateRequest,\n ProjectSubscription,\n ChangeProjectSubscriptionPlanRequest,\n AddProjectSubscriptionCreditsRequest,\n SetProjectSubscriptionInfiniteCreditsRequest,\n} from './types';\n\nexport class ProjectsApi extends HttpApi {\n private readonly billingBaseUrl: string;\n\n constructor(baseUrl: string, auth: string | AuthenticationProvider, billingBaseUrl?: string) {\n super(baseUrl, auth);\n this.billingBaseUrl = (billingBaseUrl || baseUrl).replace(/\\/$/, '');\n }\n\n async list(keyword: string | null, page: number, size: number): Promise<Paginated<Project>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<Project>>('/projects', params);\n }\n\n async get(projectId: string): Promise<Project> {\n return this.httpGet<Project>('/projects/' + projectId);\n }\n\n async getMine(): Promise<Project> {\n return this.httpGet<Project>('/projects/mine');\n }\n\n async create(request: ProjectCreateRequest): Promise<Project> {\n return this.httpPost<Project>('/projects', request);\n }\n\n async update(request: ProjectUpdateRequest): Promise<Project> {\n return this.httpPut<Project>('/projects/' + request.projectId, request);\n }\n\n async remove(projectId: string): Promise<void> {\n await this.httpDelete('/projects/' + projectId);\n }\n\n async duplicate(projectId: string, request: ProjectDuplicateRequest): Promise<Project> {\n return this.httpPost<Project>('/projects/' + projectId + '/actions/duplicate', request);\n }\n\n async getSubscription(projectId: string): Promise<ProjectSubscription> {\n return this.billingRequest<ProjectSubscription>('/projects/' + projectId + '/subscription', 'GET');\n }\n\n async changeSubscriptionPlan(projectId: string, request: ChangeProjectSubscriptionPlanRequest): Promise<ProjectSubscription> {\n return this.billingRequest<ProjectSubscription>('/projects/' + projectId + '/subscription/actions/change-plan', 'POST', request);\n }\n\n async addSubscriptionCredits(projectId: string, request: AddProjectSubscriptionCreditsRequest): Promise<ProjectSubscription> {\n return this.billingRequest<ProjectSubscription>('/projects/' + projectId + '/subscription/actions/add-credits', 'POST', request);\n }\n\n async setInfiniteCredits(projectId: string, request: SetProjectSubscriptionInfiniteCreditsRequest): Promise<ProjectSubscription> {\n return this.billingRequest<ProjectSubscription>('/projects/' + projectId + '/subscription/actions/set-infinite-credits', 'POST', request);\n }\n\n private async billingRequest<T>(path: string, method: string, body?: unknown): Promise<T> {\n const headers = new Headers();\n headers.set('Content-Type', 'application/json');\n this.getAuthProvider().applyHeaders(headers);\n\n const response = await fetch(this.billingBaseUrl + path, {\n method,\n headers,\n body: body ? JSON.stringify(body) : undefined,\n });\n\n if (!response.ok) {\n const text = await response.text();\n throw new ApiException(response.status, text);\n }\n\n const text = await response.text();\n return text ? JSON.parse(text) : (undefined as T);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n Agent,\n AgentCreateRequest,\n AgentUpdateRequest,\n SynthesizerVoice,\n Revision,\n} from './types';\n\nexport class AgentsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<Agent>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<Agent>>('/agents', params);\n }\n\n async get(agentId: string): Promise<Agent> {\n return this.httpGet<Agent>('/agents/' + agentId);\n }\n\n async create(request: AgentCreateRequest): Promise<Agent> {\n return this.httpPost<Agent>('/agents', request);\n }\n\n async update(request: AgentUpdateRequest): Promise<Agent> {\n return this.httpPut<Agent>('/agents/' + request.id, request);\n }\n\n async remove(agentId: string): Promise<void> {\n await this.httpDelete('/agents/' + agentId);\n }\n\n async getSynthesizerSupportedVoices(synthesizerName: string): Promise<SynthesizerVoice[]> {\n return this.httpGet<SynthesizerVoice[]>('/values/synthesizers/' + synthesizerName + '/voices');\n }\n\n async listRevisions(agentId: string): Promise<Revision[]> {\n return this.httpGet<Revision[]>('/agents/' + agentId + '/revisions');\n }\n\n async getRevision(agentId: string, revisionId: string): Promise<Revision> {\n return this.httpGet<Revision>('/agents/' + agentId + '/revisions/' + revisionId);\n }\n\n async rollback(agentId: string, revisionId: string): Promise<Agent> {\n return this.httpPost<Agent>('/agents/' + agentId + '/revisions/' + revisionId + '/rollback', {});\n }\n\n async generateSystemInstructions(prompt: string, sessionId?: string): Promise<string> {\n const body: Record<string, unknown> = { prompt };\n if (sessionId) body.sessionId = sessionId;\n const result = await this.httpPost<{ instructions: string }>('/agents/system-instructions', body);\n return result.instructions;\n }\n\n async getArchitect(): Promise<Agent> {\n return this.httpGet<Agent>('/agents/architect');\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n KnowledgeBaseDocument,\n KnowledgeBaseDocumentUploadRequest,\n} from './types';\n\nexport class KnowledgeBaseDocumentsApi extends HttpApi {\n private readonly knowledgeBaseId: string;\n\n constructor(baseUrl: string, auth: string | AuthenticationProvider, knowledgeBaseId: string) {\n super(baseUrl, auth);\n this.knowledgeBaseId = knowledgeBaseId;\n }\n\n async list(keyword?: string | null, page?: number, size?: number): Promise<Paginated<KnowledgeBaseDocument>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<KnowledgeBaseDocument>>('/knowledge-bases/' + this.knowledgeBaseId + '/documents', params);\n }\n\n async upload(request: KnowledgeBaseDocumentUploadRequest): Promise<KnowledgeBaseDocument> {\n return this.httpPost<KnowledgeBaseDocument>('/knowledge-bases/' + this.knowledgeBaseId + '/documents', request);\n }\n\n async get(documentId: string): Promise<KnowledgeBaseDocument> {\n return this.httpGet<KnowledgeBaseDocument>('/knowledge-bases/' + this.knowledgeBaseId + '/documents/' + documentId);\n }\n\n async reprocess(documentId: string): Promise<KnowledgeBaseDocument> {\n return this.httpPost<KnowledgeBaseDocument>('/knowledge-bases/' + this.knowledgeBaseId + '/documents', { document_id: documentId });\n }\n\n async remove(documentId: string): Promise<void> {\n await this.httpDelete('/knowledge-bases/' + this.knowledgeBaseId + '/documents/' + documentId);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n KnowledgeBase,\n KnowledgeBaseCreateRequest,\n KnowledgeBaseUpdateRequest,\n ChunkResult,\n SearchChunksRequest,\n} from './types';\nimport { KnowledgeBaseDocumentsApi } from './knowledge-base-documents-api';\n\nexport class KnowledgeBasesApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<KnowledgeBase>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<KnowledgeBase>>('/knowledge-bases', params);\n }\n\n async get(id: string): Promise<KnowledgeBase> {\n return this.httpGet<KnowledgeBase>('/knowledge-bases/' + id);\n }\n\n async create(request: KnowledgeBaseCreateRequest): Promise<KnowledgeBase> {\n return this.httpPost<KnowledgeBase>('/knowledge-bases', request);\n }\n\n async update(request: KnowledgeBaseUpdateRequest): Promise<KnowledgeBase> {\n return this.httpPut<KnowledgeBase>('/knowledge-bases/' + request.id, request);\n }\n\n async remove(id: string): Promise<void> {\n await this.httpDelete('/knowledge-bases/' + id);\n }\n\n documents(knowledgeBaseId: string): KnowledgeBaseDocumentsApi {\n return new KnowledgeBaseDocumentsApi(this.getBaseUrl(), this.getAuthProvider(), knowledgeBaseId);\n }\n\n async searchChunks(id: string, request: SearchChunksRequest): Promise<ChunkResult[]> {\n return this.httpPost<ChunkResult[]>('/knowledge-bases/' + id + '/search', request);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { Execution, ExecuteRequest } from './types';\n\nexport class WorkflowExecutionsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(workflowId: string, page?: number, size?: number): Promise<Paginated<Execution>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n return this.httpGet<Paginated<Execution>>('/workflows/' + workflowId + '/executions', params);\n }\n\n async get(workflowId: string, executionId: string): Promise<Execution> {\n return this.httpGet<Execution>('/workflows/' + workflowId + '/executions/' + executionId);\n }\n\n async run(workflowId: string, request: ExecuteRequest): Promise<Execution> {\n return this.httpPost<Execution>('/workflows/' + workflowId + '/executions', request);\n }\n\n async queue(workflowId: string, request: ExecuteRequest): Promise<Execution> {\n return this.httpPost<Execution>('/workflows/' + workflowId + '/executions/queue', request);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { Revision } from '../revisions/types';\nimport { Workflow } from './types';\nimport { WorkflowExecutionsApi } from './workflow-executions-api';\n\nexport class WorkflowsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<Workflow>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<Workflow>>('/workflows', params);\n }\n\n async create(workflow: Workflow): Promise<Workflow> {\n return this.httpPost<Workflow>('/workflows', workflow);\n }\n\n async update(workflowId: string, workflow: Workflow): Promise<Workflow> {\n workflow.id = workflowId;\n return this.httpPut<Workflow>('/workflows/' + workflowId, workflow);\n }\n\n async remove(workflowId: string): Promise<void> {\n await this.httpDelete('/workflows/' + workflowId);\n }\n\n async get(workflowId: string): Promise<Workflow> {\n return this.httpGet<Workflow>('/workflows/' + workflowId);\n }\n\n executions(): WorkflowExecutionsApi {\n return new WorkflowExecutionsApi(this.getBaseUrl(), this.getAuthProvider());\n }\n\n async listRevisions(workflowId: string): Promise<Revision[]> {\n return this.httpGet<Revision[]>('/workflows/' + workflowId + '/revisions');\n }\n\n async getRevision(workflowId: string, revisionId: string): Promise<Revision> {\n return this.httpGet<Revision>('/workflows/' + workflowId + '/revisions/' + revisionId);\n }\n\n async rollback(workflowId: string, revisionId: string): Promise<Workflow> {\n return this.httpPost<Workflow>('/workflows/' + workflowId + '/revisions/' + revisionId + '/rollback', {});\n }\n}\n","import { HttpApi } from '../http-api';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n Credentials,\n AuthorizeRequest,\n AuthorizeResponse,\n OAuth2CallbackResponse,\n} from './types';\n\nexport class CredentialsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async authorize(provider: string, request: AuthorizeRequest): Promise<AuthorizeResponse> {\n return this.httpPost<AuthorizeResponse>('/credentials/' + provider + '/authorize', request);\n }\n\n async handleOAuth2Callback(provider: string, code: string, state: string, scope?: string): Promise<OAuth2CallbackResponse> {\n const params: Record<string, unknown> = { code, state };\n if (scope) params.scope = scope;\n return this.httpGet<OAuth2CallbackResponse>('/credentials/' + provider + '/oauth2/callback', params);\n }\n\n async list(): Promise<Credentials[]> {\n return this.httpGet<Credentials[]>('/credentials');\n }\n\n async getByProvider(provider: string): Promise<Credentials[]> {\n return this.httpGet<Credentials[]>('/credentials/' + provider);\n }\n\n async getById(credentialsId: string): Promise<Credentials> {\n return this.httpGet<Credentials>('/credentials/all/' + credentialsId);\n }\n\n async remove(credentialsId: string): Promise<void> {\n await this.httpDelete('/credentials/all/' + credentialsId);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { FeatureTemplate, McpToolsResponse } from './types';\nimport { McpServerConfiguration } from '../agents/types';\n\nexport class FeatureTemplatesApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<FeatureTemplate>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<FeatureTemplate>>('/features/templates', params);\n }\n\n async get(templateId: string): Promise<FeatureTemplate> {\n return this.httpGet<FeatureTemplate>('/features/templates/' + templateId);\n }\n\n async create(template: FeatureTemplate): Promise<FeatureTemplate> {\n return this.httpPost<FeatureTemplate>('/features/templates', template);\n }\n\n async update(templateId: string, template: FeatureTemplate): Promise<FeatureTemplate> {\n return this.httpPut<FeatureTemplate>('/features/templates/' + templateId, template);\n }\n\n async patch(templateId: string, template: FeatureTemplate): Promise<FeatureTemplate> {\n return this.httpPatch<FeatureTemplate>('/features/templates/' + templateId, template);\n }\n\n async remove(templateId: string): Promise<void> {\n await this.httpDelete('/features/templates/' + templateId);\n }\n\n async getMcpAvailableTools(configuration: McpServerConfiguration, credentialsId?: string): Promise<McpToolsResponse> {\n const params = credentialsId ? { credentialsId } : undefined;\n return this.httpPost<McpToolsResponse>('/features/templates/mcp/available-tools', configuration, params);\n }\n}\n","import { AuthenticationProvider } from '../auth/authentication-provider';\nimport { FeatureTemplatesApi } from './feature-templates-api';\n\nexport class FeaturesApi {\n private readonly baseUrl: string;\n private readonly auth: string | AuthenticationProvider;\n\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n this.baseUrl = baseUrl;\n this.auth = auth;\n }\n\n templates(): FeatureTemplatesApi {\n return new FeatureTemplatesApi(this.baseUrl, this.auth);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { TriggerExecutionResult } from './types';\n\nexport class TriggerExecutionsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(triggerId: string, page?: number, size?: number): Promise<Paginated<TriggerExecutionResult>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n return this.httpGet<Paginated<TriggerExecutionResult>>('/triggers/' + triggerId + '/executions', params);\n }\n\n async execute(triggerId: string, execution: TriggerExecutionResult): Promise<TriggerExecutionResult> {\n return this.httpPost<TriggerExecutionResult>('/triggers/' + triggerId + '/executions', execution);\n }\n\n async get(executionId: string): Promise<TriggerExecutionResult> {\n return this.httpGet<TriggerExecutionResult>('/triggers/executions/' + executionId);\n }\n\n async remove(executionId: string): Promise<void> {\n await this.httpDelete('/triggers/executions/' + executionId);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { Trigger } from './types';\nimport { TriggerExecutionsApi } from './trigger-executions-api';\n\nexport class TriggersApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<Trigger>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<Trigger>>('/triggers', params);\n }\n\n async create(trigger: Trigger): Promise<Trigger> {\n return this.httpPost<Trigger>('/triggers', trigger);\n }\n\n async update(triggerId: string, trigger: Trigger): Promise<Trigger> {\n return this.httpPut<Trigger>('/triggers/' + triggerId, trigger);\n }\n\n async remove(triggerId: string): Promise<void> {\n await this.httpDelete('/triggers/' + triggerId);\n }\n\n async get(triggerId: string): Promise<Trigger> {\n return this.httpGet<Trigger>('/triggers/' + triggerId);\n }\n\n executions(): TriggerExecutionsApi {\n return new TriggerExecutionsApi(this.getBaseUrl(), this.getAuthProvider());\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { ServicePrice } from './types';\n\nexport class ServicePricesApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<ServicePrice>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<ServicePrice>>('/service-prices', params);\n }\n\n async get(id: string): Promise<ServicePrice> {\n return this.httpGet<ServicePrice>('/service-prices/' + id);\n }\n\n async create(servicePrice: ServicePrice): Promise<ServicePrice> {\n return this.httpPost<ServicePrice>('/service-prices', servicePrice);\n }\n\n async update(id: string, servicePrice: ServicePrice): Promise<ServicePrice> {\n return this.httpPut<ServicePrice>('/service-prices/' + id, servicePrice);\n }\n\n async remove(id: string): Promise<void> {\n await this.httpDelete('/service-prices/' + id);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { KnownModel } from './types';\n\nexport class KnownModelsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<KnownModel>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<KnownModel>>('/known-models', params);\n }\n\n async get(id: string): Promise<KnownModel> {\n return this.httpGet<KnownModel>('/known-models/' + id);\n }\n\n async create(knownModel: KnownModel): Promise<KnownModel> {\n return this.httpPost<KnownModel>('/known-models', knownModel);\n }\n\n async update(id: string, knownModel: KnownModel): Promise<KnownModel> {\n return this.httpPut<KnownModel>('/known-models/' + id, knownModel);\n }\n\n async remove(id: string): Promise<void> {\n await this.httpDelete('/known-models/' + id);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n Session,\n GenerationRequest,\n GenerationResponse,\n Message,\n CommittedUsage,\n AgentStateInfo,\n SteerAccepted,\n} from './types';\n\nexport class SessionsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(\n keyword?: string | null,\n status?: string | null,\n agentId?: string | null,\n userId?: string | null,\n page?: number,\n size?: number,\n ): Promise<Paginated<Session>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n if (keyword) params.keyword = keyword;\n if (status) params.status = status;\n if (agentId) params.agentId = agentId;\n if (userId) params.userId = userId;\n return this.httpGet<Paginated<Session>>('/sessions', params);\n }\n\n async get(sessionId: string): Promise<Session> {\n return this.httpGet<Session>('/sessions/' + sessionId);\n }\n\n async getUsage(sessionId: string): Promise<CommittedUsage[]> {\n return this.httpGet<CommittedUsage[]>('/sessions/' + sessionId + '/usage');\n }\n\n async generateMessage(code: string, request: GenerationRequest): Promise<GenerationResponse> {\n return this.httpPost<GenerationResponse>('/sessions/' + code + '/messages', request);\n }\n\n async findMessages(code: string, page?: number, size?: number): Promise<Paginated<Message>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n return this.httpGet<Paginated<Message>>('/sessions/' + code + '/messages', params);\n }\n\n async remove(code: string): Promise<void> {\n await this.httpDelete('/sessions/' + code);\n }\n\n async rename(sessionId: string, name: string): Promise<Session> {\n return this.httpPut<Session>('/sessions/' + sessionId + '/name', { name });\n }\n\n // ─── Agent Execution Lifecycle ────────────────────────────────\n\n /**\n * Get the current state of the agent execution for a session.\n */\n async getAgentState(code: string): Promise<AgentStateInfo> {\n return this.httpGet<AgentStateInfo>('/sessions/' + encodeURIComponent(code) + '/agent-state');\n }\n\n /**\n * Cancel a running agent execution for a session.\n */\n async cancelExecution(code: string): Promise<{ status: string; sessionId: string }> {\n return this.httpPost<{ status: string; sessionId: string }>(\n '/sessions/' + encodeURIComponent(code) + '/cancel',\n {},\n );\n }\n\n /**\n * Steer a running agent execution by injecting an instruction.\n */\n async steerExecution(code: string, text: string): Promise<SteerAccepted> {\n return this.httpPost<SteerAccepted>(\n '/sessions/' + encodeURIComponent(code) + '/steer',\n { text },\n );\n }\n}\n","import { HttpApi } from '../http-api';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { Paginated } from '../paginated';\nimport { Mission } from './types';\n\nexport class MissionsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, status?: string | null): Promise<Paginated<Mission>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n if (keyword) params.keyword = keyword;\n if (status) params.status = status;\n return this.httpGet<Paginated<Mission>>('/missions', params);\n }\n\n async get(missionId: string): Promise<Mission> {\n return this.httpGet<Mission>('/missions/' + missionId);\n }\n\n async create(mission: Mission): Promise<Mission> {\n return this.httpPost<Mission>('/missions', mission);\n }\n\n async update(missionId: string, mission: Mission): Promise<Mission> {\n return this.httpPut<Mission>('/missions/' + missionId, mission);\n }\n\n async remove(missionId: string): Promise<void> {\n await this.httpDelete('/missions/' + missionId);\n }\n\n async generate(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/generate');\n }\n\n async execute(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/execute');\n }\n\n async retry(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/retry');\n }\n\n async replan(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/replan');\n }\n\n async sendInstruction(missionId: string, instruction: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/instructions', { instruction });\n }\n\n async stop(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/stop');\n }\n\n async resume(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/continue');\n }\n}\n","import { AuthenticationProvider } from '../auth/authentication-provider';\nimport { ApiException } from '../exceptions';\nimport {\n Customer,\n Subscription,\n Invoice,\n CreateCustomerRequest,\n UpdateCustomerRequest,\n CreateSubscriptionRequest,\n UpgradeSubscriptionRequest,\n DowngradeSubscriptionRequest,\n MentorizeSubscriptionRequest,\n UsageStats,\n} from './types';\n\nexport class BillingClient {\n private readonly baseUrl: string;\n private readonly authProvider: AuthenticationProvider | string | null;\n\n constructor(baseUrl?: string, auth?: string | AuthenticationProvider | null) {\n this.baseUrl = (baseUrl || 'https://persona.applica.guru/billing').replace(/\\/$/, '');\n this.authProvider = auth ?? null;\n }\n\n private buildHeaders(): Headers {\n const headers = new Headers();\n headers.set('Content-Type', 'application/json');\n if (this.authProvider) {\n if (typeof this.authProvider === 'string') {\n headers.set('x-persona-apikey', this.authProvider);\n } else {\n this.authProvider.applyHeaders(headers);\n }\n }\n return headers;\n }\n\n private async request<T>(path: string, method: string, body?: unknown): Promise<T> {\n const response = await fetch(this.baseUrl + path, {\n method,\n headers: this.buildHeaders(),\n body: body ? JSON.stringify(body) : undefined,\n });\n if (!response.ok) {\n const text = await response.text();\n throw new ApiException(response.status, text);\n }\n const text = await response.text();\n return text ? JSON.parse(text) : (undefined as T);\n }\n\n async createCustomer(request: CreateCustomerRequest): Promise<Customer> {\n return this.request<Customer>('/customers', 'POST', request);\n }\n\n async updateCustomer(owner: string, request: UpdateCustomerRequest): Promise<Customer> {\n return this.request<Customer>('/customers/' + owner, 'PUT', request);\n }\n\n async getCustomer(owner: string): Promise<Customer> {\n return this.request<Customer>('/customers/' + owner, 'GET');\n }\n\n async saveCustomer(customer: Customer): Promise<Customer> {\n return this.request<Customer>('/customers', 'POST', customer);\n }\n\n async deleteCustomer(owner: string): Promise<void> {\n await this.request<void>('/customers/' + owner, 'DELETE');\n }\n\n async createSubscription(request: CreateSubscriptionRequest): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + request.owner + '/subscription', 'POST', request);\n }\n\n async getSubscription(owner: string): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription', 'GET');\n }\n\n async getProjectSubscription(projectId: string): Promise<Subscription> {\n return this.request<Subscription>('/projects/' + projectId + '/subscription', 'GET');\n }\n\n async changeProjectSubscriptionPlan(projectId: string, request: { toPlanType: string }): Promise<Subscription> {\n return this.request<Subscription>('/projects/' + projectId + '/subscription/actions/change-plan', 'POST', request);\n }\n\n async addProjectSubscriptionCredits(projectId: string, request: { credits: number }): Promise<Subscription> {\n return this.request<Subscription>('/projects/' + projectId + '/subscription/actions/add-credits', 'POST', request);\n }\n\n async beginUpgrade(owner: string, request: UpgradeSubscriptionRequest): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/actions/upgrade', 'POST', request);\n }\n\n async downgrade(owner: string, request: DowngradeSubscriptionRequest): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/actions/downgrade', 'POST', request);\n }\n\n async mentorize(owner: string, request: MentorizeSubscriptionRequest): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/actions/mentorize', 'POST', request);\n }\n\n async addCredits(owner: string, credits: number): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/credits', 'POST', { credits });\n }\n\n async useCredits(owner: string, credits: number, services: string[], referenceId?: string): Promise<Subscription> {\n const body: Record<string, unknown> = { credits, services };\n if (referenceId) body.referenceId = referenceId;\n return this.request<Subscription>('/customers/' + owner + '/subscription/credits', 'DELETE', body);\n }\n\n async getCredits(owner: string): Promise<number> {\n try {\n const result = await this.request<{ credits?: number }>('/customers/' + owner + '/subscription/credits', 'GET');\n return result.credits ?? 0;\n } catch {\n return 0;\n }\n }\n\n async isValid(owner: string): Promise<boolean> {\n try {\n const result = await this.request<{ valid?: boolean }>('/customers/' + owner + '/subscription/valid', 'GET');\n return result.valid ?? false;\n } catch {\n return false;\n }\n }\n\n async listInvoices(owner: string, dateFrom?: string, dateTo?: string): Promise<Invoice[]> {\n const params: string[] = [];\n if (dateFrom) params.push('date_from=' + dateFrom);\n if (dateTo) params.push('date_to=' + dateTo);\n const query = params.length > 0 ? '?' + params.join('&') : '';\n return this.request<Invoice[]>('/customers/' + owner + '/invoices' + query, 'GET');\n }\n\n async cancelSubscription(owner: string): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/actions/cancel', 'POST', {});\n }\n\n async getUsageStats(projectId: string, dateFrom?: string, dateTo?: string, models?: string[]): Promise<UsageStats> {\n const params: string[] = [];\n if (dateFrom) params.push('date_from=' + encodeURIComponent(dateFrom));\n if (dateTo) params.push('date_to=' + encodeURIComponent(dateTo));\n if (models?.length) models.forEach(m => params.push('model=' + encodeURIComponent(m)));\n const query = params.length > 0 ? '?' + params.join('&') : '';\n return this.request<UsageStats>('/projects/' + projectId + '/subscription/usage-stats' + query, 'GET');\n }\n}\n","import { HttpApi } from '../http-api';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\n\nexport class ValuesApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async get(category: string): Promise<Record<string, unknown>[]> {\n return this.httpGet<Record<string, unknown>[]>('/values/' + category);\n }\n\n async getLanguageCodes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/language-codes');\n }\n\n async getModelNames(): Promise<string[]> {\n return this.httpGet<string[]>('/values/model-names');\n }\n\n async getModelProviders(): Promise<string[]> {\n return this.httpGet<string[]>('/values/model-providers');\n }\n\n async getKnowledgeTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/knowledge-types');\n }\n\n async getCollaborationModes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/collaboration-modes');\n }\n\n async getTranscriberNames(): Promise<string[]> {\n return this.httpGet<string[]>('/values/transcriber-names');\n }\n\n async getSynthesizerNames(): Promise<string[]> {\n return this.httpGet<string[]>('/values/synthesizer-names');\n }\n\n async getSynthesizerVoices(synthesizerName: string): Promise<string[]> {\n return this.httpGet<string[]>('/values/synthesizers/' + synthesizerName + '/voices');\n }\n\n async getStmTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/stm-types');\n }\n\n async getDocumentExtractors(): Promise<string[]> {\n return this.httpGet<string[]>('/values/document-extractors');\n }\n\n async getEmbeddingModels(): Promise<string[]> {\n return this.httpGet<string[]>('/values/embedding-models');\n }\n\n async getQualityOptions(): Promise<string[]> {\n return this.httpGet<string[]>('/values/quality');\n }\n\n async getChunkSizeOptions(): Promise<string[]> {\n return this.httpGet<string[]>('/values/chunk-size');\n }\n\n async getFeatureTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/feature-types');\n }\n\n async getRoles(): Promise<string[]> {\n return this.httpGet<string[]>('/values/roles');\n }\n\n async getServiceUnits(): Promise<string[]> {\n return this.httpGet<string[]>('/values/service-units');\n }\n\n async getTriggerSourceTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/trigger-source-types');\n }\n\n async getTriggerDestinationTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/trigger-destination-types');\n }\n}\n","import { AuthenticationProvider } from './auth/authentication-provider';\nimport { ProjectsApi } from './projects/projects-api';\nimport { AgentsApi } from './agents/agents-api';\nimport { KnowledgeBasesApi } from './knowledges/knowledge-bases-api';\nimport { WorkflowsApi } from './workflows/workflows-api';\nimport { CredentialsApi } from './credentials/credentials-api';\nimport { FeaturesApi } from './features/features-api';\nimport { TriggersApi } from './triggers/triggers-api';\nimport { ServicePricesApi } from './service-prices/service-prices-api';\nimport { KnownModelsApi } from './known-models/known-models-api';\nimport { SessionsApi } from './sessions/sessions-api';\nimport { MissionsApi } from './missions/missions-api';\nimport { BillingClient } from './billing/billing-client';\nimport { ValuesApi } from './values/values-api';\n\nexport class PersonaSdk {\n private readonly baseUrl: string;\n private readonly workflowsBaseUrl: string;\n private readonly billingBaseUrl: string;\n\n constructor(baseUrl: string, workflowsBaseUrl: string, billingBaseUrl?: string) {\n this.baseUrl = baseUrl;\n this.workflowsBaseUrl = workflowsBaseUrl;\n this.billingBaseUrl = billingBaseUrl || 'https://persona.applica.guru/billing';\n }\n\n projects(apiKey: string): ProjectsApi;\n projects(authProvider: AuthenticationProvider): ProjectsApi;\n projects(auth: string | AuthenticationProvider): ProjectsApi {\n return new ProjectsApi(this.baseUrl, auth, this.billingBaseUrl);\n }\n\n agents(apiKey: string): AgentsApi;\n agents(authProvider: AuthenticationProvider): AgentsApi;\n agents(auth: string | AuthenticationProvider): AgentsApi {\n return new AgentsApi(this.baseUrl, auth);\n }\n\n knowledgeBases(apiKey: string): KnowledgeBasesApi;\n knowledgeBases(authProvider: AuthenticationProvider): KnowledgeBasesApi;\n knowledgeBases(auth: string | AuthenticationProvider): KnowledgeBasesApi {\n return new KnowledgeBasesApi(this.baseUrl, auth);\n }\n\n workflows(apiKey: string): WorkflowsApi;\n workflows(authProvider: AuthenticationProvider): WorkflowsApi;\n workflows(auth: string | AuthenticationProvider): WorkflowsApi {\n return new WorkflowsApi(this.workflowsBaseUrl, auth);\n }\n\n credentials(apiKey: string): CredentialsApi;\n credentials(authProvider: AuthenticationProvider): CredentialsApi;\n credentials(auth: string | AuthenticationProvider): CredentialsApi {\n return new CredentialsApi(this.baseUrl, auth);\n }\n\n features(apiKey: string): FeaturesApi;\n features(authProvider: AuthenticationProvider): FeaturesApi;\n features(auth: string | AuthenticationProvider): FeaturesApi {\n return new FeaturesApi(this.baseUrl, auth);\n }\n\n triggers(apiKey: string): TriggersApi;\n triggers(authProvider: AuthenticationProvider): TriggersApi;\n triggers(auth: string | AuthenticationProvider): TriggersApi {\n return new TriggersApi(this.baseUrl, auth);\n }\n\n servicePrices(apiKey: string): ServicePricesApi;\n servicePrices(authProvider: AuthenticationProvider): ServicePricesApi;\n servicePrices(auth: string | AuthenticationProvider): ServicePricesApi {\n return new ServicePricesApi(this.baseUrl, auth);\n }\n\n knownModels(apiKey: string): KnownModelsApi;\n knownModels(authProvider: AuthenticationProvider): KnownModelsApi;\n knownModels(auth: string | AuthenticationProvider): KnownModelsApi {\n return new KnownModelsApi(this.baseUrl, auth);\n }\n\n sessions(apiKey: string): SessionsApi;\n sessions(authProvider: AuthenticationProvider): SessionsApi;\n sessions(auth: string | AuthenticationProvider): SessionsApi {\n return new SessionsApi(this.baseUrl, auth);\n }\n\n missions(apiKey: string): MissionsApi;\n missions(authProvider: AuthenticationProvider): MissionsApi;\n missions(auth: string | AuthenticationProvider): MissionsApi {\n return new MissionsApi(this.baseUrl, auth);\n }\n\n billing(apiKey: string): BillingClient;\n billing(authProvider: AuthenticationProvider): BillingClient;\n billing(auth: string | AuthenticationProvider): BillingClient {\n return new BillingClient(this.billingBaseUrl, auth);\n }\n\n values(apiKey: string): ValuesApi;\n values(authProvider: AuthenticationProvider): ValuesApi;\n values(auth: string | AuthenticationProvider): ValuesApi {\n return new ValuesApi(this.baseUrl, auth);\n }\n}\n","import { AuthenticationProvider } from './authentication-provider';\n\nexport class BearerTokenAuthenticationProvider implements AuthenticationProvider {\n constructor(private readonly token: string) {}\n\n applyHeaders(headers: Headers): void {\n headers.set('Authorization', `Bearer ${this.token}`);\n }\n\n getCredentials(): string {\n return this.token;\n }\n}\n"],"names":["ApiException","statusCode","body","__publicField","ApiKeyAuthenticationProvider","apiKey","headers","HttpApi","baseUrl","page","size","path","params","url","key","value","response","text","ProjectsApi","auth","billingBaseUrl","keyword","p","s","projectId","request","method","AgentsApi","extraParams","agentId","synthesizerName","revisionId","prompt","sessionId","KnowledgeBaseDocumentsApi","knowledgeBaseId","documentId","KnowledgeBasesApi","id","WorkflowExecutionsApi","workflowId","executionId","WorkflowsApi","workflow","CredentialsApi","provider","code","state","scope","credentialsId","FeatureTemplatesApi","templateId","template","configuration","FeaturesApi","TriggerExecutionsApi","triggerId","execution","TriggersApi","trigger","ServicePricesApi","servicePrice","KnownModelsApi","knownModel","SessionsApi","status","userId","name","MissionsApi","missionId","mission","instruction","BillingClient","owner","customer","credits","services","referenceId","dateFrom","dateTo","query","models","m","ValuesApi","category","PersonaSdk","workflowsBaseUrl","BearerTokenAuthenticationProvider","token"],"mappings":"oPAAO,MAAMA,UAAqB,KAAM,CAItC,YAAYC,EAAoBC,EAAc,CAC5C,MAAM,cAAcD,CAAU,MAAMC,CAAI,EAAE,EAJ5BC,EAAA,mBACAA,EAAA,aAId,KAAK,WAAaF,EAClB,KAAK,KAAOC,CACd,CACF,CCPO,MAAME,CAA+D,CAC1E,YAA6BC,EAAgB,CAAhB,KAAA,OAAAA,CAAiB,CAE9C,aAAaC,EAAwB,CACnCA,EAAQ,IAAI,mBAAoB,KAAK,MAAM,CAC7C,CAEA,gBAAyB,CACvB,OAAO,KAAK,MACd,CACF,CCRO,MAAeC,CAAQ,CAI5B,YAAYC,EAAiBH,EAAyC,CAHrDF,EAAA,gBACAA,EAAA,qBAGf,KAAK,QAAUK,EACf,KAAK,aAAe,OAAOH,GAAW,SAAW,IAAID,EAA6BC,CAAM,EAAIA,CAC9F,CAEU,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AY,KAAK,QAAS7C,CAAI,CAC3C,CAIA,SAASA,EAAoD,CAC3D,OAAO,IAAIiD,EAAY,KAAK,QAASjD,CAAI,CAC3C,CAIA,QAAQA,EAAsD,CAC5D,OAAO,IAAIqD,EAAc,KAAK,eAAgBrD,CAAI,CACpD,CAIA,OAAOA,EAAkD,CACvD,OAAO,IAAIgE,EAAU,KAAK,QAAShE,CAAI,CACzC,CACF,CCrGO,MAAMoE,CAAoE,CAC/E,YAA6BC,EAAe,CAAf,KAAA,MAAAA,CAAgB,CAE7C,aAAalF,EAAwB,CACnCA,EAAQ,IAAI,gBAAiB,UAAU,KAAK,KAAK,EAAE,CACrD,CAEA,gBAAyB,CACvB,OAAO,KAAK,KACd,CACF"}
|
|
1
|
+
{"version":3,"file":"bundle.cjs.js","sources":["../src/exceptions.ts","../src/auth/api-key-auth.ts","../src/http-api.ts","../src/projects/projects-api.ts","../src/agents/agents-api.ts","../src/knowledges/knowledge-base-documents-api.ts","../src/knowledges/knowledge-bases-api.ts","../src/workflows/workflow-executions-api.ts","../src/workflows/workflows-api.ts","../src/credentials/credentials-api.ts","../src/features/feature-templates-api.ts","../src/features/features-api.ts","../src/triggers/trigger-executions-api.ts","../src/triggers/triggers-api.ts","../src/service-prices/service-prices-api.ts","../src/known-models/known-models-api.ts","../src/sessions/sessions-api.ts","../src/missions/missions-api.ts","../src/billing/billing-client.ts","../src/values/values-api.ts","../src/persona-sdk.ts","../src/auth/bearer-token-auth.ts"],"sourcesContent":["export class ApiException extends Error {\n public readonly statusCode: number;\n public readonly body: string;\n\n constructor(statusCode: number, body: string) {\n super(`API Error: ${statusCode} - ${body}`);\n this.statusCode = statusCode;\n this.body = body;\n }\n}\n","import { AuthenticationProvider } from './authentication-provider';\n\nexport class ApiKeyAuthenticationProvider implements AuthenticationProvider {\n constructor(private readonly apiKey: string) {}\n\n applyHeaders(headers: Headers): void {\n headers.set('x-persona-apikey', this.apiKey);\n }\n\n getCredentials(): string {\n return this.apiKey;\n }\n}\n","import { ApiException } from './exceptions';\nimport { AuthenticationProvider } from './auth/authentication-provider';\nimport { ApiKeyAuthenticationProvider } from './auth/api-key-auth';\n\nexport abstract class HttpApi {\n private readonly baseUrl: string;\n private readonly authProvider: AuthenticationProvider;\n\n constructor(baseUrl: string, apiKey: string | AuthenticationProvider) {\n this.baseUrl = baseUrl;\n this.authProvider = typeof apiKey === 'string' ? new ApiKeyAuthenticationProvider(apiKey) : apiKey;\n }\n\n protected getBaseUrl(): string {\n return this.baseUrl;\n }\n\n protected getAuthProvider(): AuthenticationProvider {\n return this.authProvider;\n }\n\n protected normalizePageParams(page?: number, size?: number): { page: number; size: number } {\n return {\n page: page === undefined || page < 1 ? 1 : page,\n size: size === undefined || size < 1 ? 20 : size,\n };\n }\n\n private buildHeaders(): Headers {\n const headers = new Headers();\n headers.set('Content-Type', 'application/json');\n this.authProvider.applyHeaders(headers);\n return headers;\n }\n\n private buildUrl(path: string, params?: Record<string, unknown>): string {\n const url = new URL(this.baseUrl + path);\n if (params) {\n Object.entries(params).forEach(([key, value]) => {\n if (value !== null && value !== undefined) {\n url.searchParams.set(key, String(value));\n }\n });\n }\n return url.toString();\n }\n\n private async handleResponse<T>(response: Response): Promise<T> {\n if (!response.ok) {\n const body = await response.text();\n throw new ApiException(response.status, body);\n }\n const text = await response.text();\n return text ? JSON.parse(text) : (undefined as T);\n }\n\n protected async httpGet<T>(path: string, params?: Record<string, unknown>): Promise<T> {\n const response = await fetch(this.buildUrl(path, params), {\n method: 'GET',\n headers: this.buildHeaders(),\n });\n return this.handleResponse<T>(response);\n }\n\n protected async httpPost<T>(path: string, body?: unknown, params?: Record<string, unknown>): Promise<T> {\n const response = await fetch(this.buildUrl(path, params), {\n method: 'POST',\n headers: this.buildHeaders(),\n body: body ? JSON.stringify(body) : undefined,\n });\n return this.handleResponse<T>(response);\n }\n\n protected async httpPut<T>(path: string, body: unknown): Promise<T> {\n const response = await fetch(this.baseUrl + path, {\n method: 'PUT',\n headers: this.buildHeaders(),\n body: JSON.stringify(body),\n });\n return this.handleResponse<T>(response);\n }\n\n protected async httpPatch<T>(path: string, body: unknown): Promise<T> {\n const response = await fetch(this.baseUrl + path, {\n method: 'PATCH',\n headers: this.buildHeaders(),\n body: JSON.stringify(body),\n });\n return this.handleResponse<T>(response);\n }\n\n protected async httpDelete(path: string): Promise<void> {\n const response = await fetch(this.baseUrl + path, {\n method: 'DELETE',\n headers: this.buildHeaders(),\n });\n if (!response.ok) {\n const body = await response.text();\n throw new ApiException(response.status, body);\n }\n }\n}\n","import { HttpApi } from '../http-api';\nimport { ApiException } from '../exceptions';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n Project,\n ProjectCreateRequest,\n ProjectUpdateRequest,\n ProjectDuplicateRequest,\n ProjectSubscription,\n ChangeProjectSubscriptionPlanRequest,\n AddProjectSubscriptionCreditsRequest,\n SetProjectSubscriptionInfiniteCreditsRequest,\n} from './types';\n\nexport class ProjectsApi extends HttpApi {\n private readonly billingBaseUrl: string;\n\n constructor(baseUrl: string, auth: string | AuthenticationProvider, billingBaseUrl?: string) {\n super(baseUrl, auth);\n this.billingBaseUrl = (billingBaseUrl || baseUrl).replace(/\\/$/, '');\n }\n\n async list(keyword: string | null, page: number, size: number): Promise<Paginated<Project>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<Project>>('/projects', params);\n }\n\n async get(projectId: string): Promise<Project> {\n return this.httpGet<Project>('/projects/' + projectId);\n }\n\n async getMine(): Promise<Project> {\n return this.httpGet<Project>('/projects/mine');\n }\n\n async create(request: ProjectCreateRequest): Promise<Project> {\n return this.httpPost<Project>('/projects', request);\n }\n\n async update(request: ProjectUpdateRequest): Promise<Project> {\n return this.httpPut<Project>('/projects/' + request.projectId, request);\n }\n\n async remove(projectId: string): Promise<void> {\n await this.httpDelete('/projects/' + projectId);\n }\n\n async duplicate(projectId: string, request: ProjectDuplicateRequest): Promise<Project> {\n return this.httpPost<Project>('/projects/' + projectId + '/actions/duplicate', request);\n }\n\n async getSubscription(projectId: string): Promise<ProjectSubscription> {\n return this.billingRequest<ProjectSubscription>('/projects/' + projectId + '/subscription', 'GET');\n }\n\n async changeSubscriptionPlan(projectId: string, request: ChangeProjectSubscriptionPlanRequest): Promise<ProjectSubscription> {\n return this.billingRequest<ProjectSubscription>('/projects/' + projectId + '/subscription/actions/change-plan', 'POST', request);\n }\n\n async addSubscriptionCredits(projectId: string, request: AddProjectSubscriptionCreditsRequest): Promise<ProjectSubscription> {\n return this.billingRequest<ProjectSubscription>('/projects/' + projectId + '/subscription/actions/add-credits', 'POST', request);\n }\n\n async setInfiniteCredits(projectId: string, request: SetProjectSubscriptionInfiniteCreditsRequest): Promise<ProjectSubscription> {\n return this.billingRequest<ProjectSubscription>('/projects/' + projectId + '/subscription/actions/set-infinite-credits', 'POST', request);\n }\n\n private async billingRequest<T>(path: string, method: string, body?: unknown): Promise<T> {\n const headers = new Headers();\n headers.set('Content-Type', 'application/json');\n this.getAuthProvider().applyHeaders(headers);\n\n const response = await fetch(this.billingBaseUrl + path, {\n method,\n headers,\n body: body ? JSON.stringify(body) : undefined,\n });\n\n if (!response.ok) {\n const text = await response.text();\n throw new ApiException(response.status, text);\n }\n\n const text = await response.text();\n return text ? JSON.parse(text) : (undefined as T);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n Agent,\n AgentCreateRequest,\n AgentUpdateRequest,\n SynthesizerVoice,\n Revision,\n} from './types';\n\nexport class AgentsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<Agent>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<Agent>>('/agents', params);\n }\n\n async get(agentId: string): Promise<Agent> {\n return this.httpGet<Agent>('/agents/' + agentId);\n }\n\n async create(request: AgentCreateRequest): Promise<Agent> {\n return this.httpPost<Agent>('/agents', request);\n }\n\n async update(request: AgentUpdateRequest): Promise<Agent> {\n return this.httpPut<Agent>('/agents/' + request.id, request);\n }\n\n async remove(agentId: string): Promise<void> {\n await this.httpDelete('/agents/' + agentId);\n }\n\n async getSynthesizerSupportedVoices(synthesizerName: string): Promise<SynthesizerVoice[]> {\n return this.httpGet<SynthesizerVoice[]>('/values/synthesizers/' + synthesizerName + '/voices');\n }\n\n async listRevisions(agentId: string): Promise<Revision[]> {\n return this.httpGet<Revision[]>('/agents/' + agentId + '/revisions');\n }\n\n async getRevision(agentId: string, revisionId: string): Promise<Revision> {\n return this.httpGet<Revision>('/agents/' + agentId + '/revisions/' + revisionId);\n }\n\n async rollback(agentId: string, revisionId: string): Promise<Agent> {\n return this.httpPost<Agent>('/agents/' + agentId + '/revisions/' + revisionId + '/rollback', {});\n }\n\n async generateSystemInstructions(prompt: string, sessionId?: string): Promise<string> {\n const body: Record<string, unknown> = { prompt };\n if (sessionId) body.sessionId = sessionId;\n const result = await this.httpPost<{ instructions: string }>('/agents/system-instructions', body);\n return result.instructions;\n }\n\n async getArchitect(): Promise<Agent> {\n return this.httpGet<Agent>('/agents/architect');\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n KnowledgeBaseDocument,\n KnowledgeBaseDocumentUploadRequest,\n} from './types';\n\nexport class KnowledgeBaseDocumentsApi extends HttpApi {\n private readonly knowledgeBaseId: string;\n\n constructor(baseUrl: string, auth: string | AuthenticationProvider, knowledgeBaseId: string) {\n super(baseUrl, auth);\n this.knowledgeBaseId = knowledgeBaseId;\n }\n\n async list(keyword?: string | null, page?: number, size?: number): Promise<Paginated<KnowledgeBaseDocument>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<KnowledgeBaseDocument>>('/knowledge-bases/' + this.knowledgeBaseId + '/documents', params);\n }\n\n async upload(request: KnowledgeBaseDocumentUploadRequest): Promise<KnowledgeBaseDocument> {\n return this.httpPost<KnowledgeBaseDocument>('/knowledge-bases/' + this.knowledgeBaseId + '/documents', request);\n }\n\n async get(documentId: string): Promise<KnowledgeBaseDocument> {\n return this.httpGet<KnowledgeBaseDocument>('/knowledge-bases/' + this.knowledgeBaseId + '/documents/' + documentId);\n }\n\n async reprocess(documentId: string): Promise<KnowledgeBaseDocument> {\n return this.httpPost<KnowledgeBaseDocument>('/knowledge-bases/' + this.knowledgeBaseId + '/documents', { document_id: documentId });\n }\n\n async remove(documentId: string): Promise<void> {\n await this.httpDelete('/knowledge-bases/' + this.knowledgeBaseId + '/documents/' + documentId);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n KnowledgeBase,\n KnowledgeBaseCreateRequest,\n KnowledgeBaseUpdateRequest,\n ChunkResult,\n SearchChunksRequest,\n} from './types';\nimport { KnowledgeBaseDocumentsApi } from './knowledge-base-documents-api';\n\nexport class KnowledgeBasesApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<KnowledgeBase>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<KnowledgeBase>>('/knowledge-bases', params);\n }\n\n async get(id: string): Promise<KnowledgeBase> {\n return this.httpGet<KnowledgeBase>('/knowledge-bases/' + id);\n }\n\n async create(request: KnowledgeBaseCreateRequest): Promise<KnowledgeBase> {\n return this.httpPost<KnowledgeBase>('/knowledge-bases', request);\n }\n\n async update(request: KnowledgeBaseUpdateRequest): Promise<KnowledgeBase> {\n return this.httpPut<KnowledgeBase>('/knowledge-bases/' + request.id, request);\n }\n\n async remove(id: string): Promise<void> {\n await this.httpDelete('/knowledge-bases/' + id);\n }\n\n documents(knowledgeBaseId: string): KnowledgeBaseDocumentsApi {\n return new KnowledgeBaseDocumentsApi(this.getBaseUrl(), this.getAuthProvider(), knowledgeBaseId);\n }\n\n async searchChunks(id: string, request: SearchChunksRequest): Promise<ChunkResult[]> {\n return this.httpPost<ChunkResult[]>('/knowledge-bases/' + id + '/search', request);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { Execution, ExecuteRequest } from './types';\n\nexport class WorkflowExecutionsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(workflowId: string, page?: number, size?: number): Promise<Paginated<Execution>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n return this.httpGet<Paginated<Execution>>('/workflows/' + workflowId + '/executions', params);\n }\n\n async get(workflowId: string, executionId: string): Promise<Execution> {\n return this.httpGet<Execution>('/workflows/' + workflowId + '/executions/' + executionId);\n }\n\n async run(workflowId: string, request: ExecuteRequest): Promise<Execution> {\n return this.httpPost<Execution>('/workflows/' + workflowId + '/executions', request);\n }\n\n async queue(workflowId: string, request: ExecuteRequest): Promise<Execution> {\n return this.httpPost<Execution>('/workflows/' + workflowId + '/executions/queue', request);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { Revision } from '../revisions/types';\nimport { Workflow } from './types';\nimport { WorkflowExecutionsApi } from './workflow-executions-api';\n\nexport class WorkflowsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<Workflow>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<Workflow>>('/workflows', params);\n }\n\n async create(workflow: Workflow): Promise<Workflow> {\n return this.httpPost<Workflow>('/workflows', workflow);\n }\n\n async update(workflowId: string, workflow: Workflow): Promise<Workflow> {\n workflow.id = workflowId;\n return this.httpPut<Workflow>('/workflows/' + workflowId, workflow);\n }\n\n async remove(workflowId: string): Promise<void> {\n await this.httpDelete('/workflows/' + workflowId);\n }\n\n async get(workflowId: string): Promise<Workflow> {\n return this.httpGet<Workflow>('/workflows/' + workflowId);\n }\n\n executions(): WorkflowExecutionsApi {\n return new WorkflowExecutionsApi(this.getBaseUrl(), this.getAuthProvider());\n }\n\n async listRevisions(workflowId: string): Promise<Revision[]> {\n return this.httpGet<Revision[]>('/workflows/' + workflowId + '/revisions');\n }\n\n async getRevision(workflowId: string, revisionId: string): Promise<Revision> {\n return this.httpGet<Revision>('/workflows/' + workflowId + '/revisions/' + revisionId);\n }\n\n async rollback(workflowId: string, revisionId: string): Promise<Workflow> {\n return this.httpPost<Workflow>('/workflows/' + workflowId + '/revisions/' + revisionId + '/rollback', {});\n }\n}\n","import { HttpApi } from '../http-api';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n Credentials,\n AuthorizeRequest,\n AuthorizeResponse,\n OAuth2CallbackResponse,\n} from './types';\n\nexport class CredentialsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async authorize(provider: string, request: AuthorizeRequest): Promise<AuthorizeResponse> {\n return this.httpPost<AuthorizeResponse>('/credentials/' + provider + '/authorize', request);\n }\n\n async handleOAuth2Callback(provider: string, code: string, state: string, scope?: string): Promise<OAuth2CallbackResponse> {\n const params: Record<string, unknown> = { code, state };\n if (scope) params.scope = scope;\n return this.httpGet<OAuth2CallbackResponse>('/credentials/' + provider + '/oauth2/callback', params);\n }\n\n async list(): Promise<Credentials[]> {\n return this.httpGet<Credentials[]>('/credentials');\n }\n\n async getByProvider(provider: string): Promise<Credentials[]> {\n return this.httpGet<Credentials[]>('/credentials/' + provider);\n }\n\n async getById(credentialsId: string): Promise<Credentials> {\n return this.httpGet<Credentials>('/credentials/all/' + credentialsId);\n }\n\n async remove(credentialsId: string): Promise<void> {\n await this.httpDelete('/credentials/all/' + credentialsId);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { FeatureTemplate, McpToolsResponse } from './types';\nimport { McpServerConfiguration } from '../agents/types';\n\nexport class FeatureTemplatesApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<FeatureTemplate>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<FeatureTemplate>>('/features/templates', params);\n }\n\n async get(templateId: string): Promise<FeatureTemplate> {\n return this.httpGet<FeatureTemplate>('/features/templates/' + templateId);\n }\n\n async create(template: FeatureTemplate): Promise<FeatureTemplate> {\n return this.httpPost<FeatureTemplate>('/features/templates', template);\n }\n\n async update(templateId: string, template: FeatureTemplate): Promise<FeatureTemplate> {\n return this.httpPut<FeatureTemplate>('/features/templates/' + templateId, template);\n }\n\n async patch(templateId: string, template: FeatureTemplate): Promise<FeatureTemplate> {\n return this.httpPatch<FeatureTemplate>('/features/templates/' + templateId, template);\n }\n\n async remove(templateId: string): Promise<void> {\n await this.httpDelete('/features/templates/' + templateId);\n }\n\n async getMcpAvailableTools(configuration: McpServerConfiguration, credentialsId?: string): Promise<McpToolsResponse> {\n const params = credentialsId ? { credentialsId } : undefined;\n return this.httpPost<McpToolsResponse>('/features/templates/mcp/available-tools', configuration, params);\n }\n}\n","import { AuthenticationProvider } from '../auth/authentication-provider';\nimport { FeatureTemplatesApi } from './feature-templates-api';\n\nexport class FeaturesApi {\n private readonly baseUrl: string;\n private readonly auth: string | AuthenticationProvider;\n\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n this.baseUrl = baseUrl;\n this.auth = auth;\n }\n\n templates(): FeatureTemplatesApi {\n return new FeatureTemplatesApi(this.baseUrl, this.auth);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { TriggerExecutionResult } from './types';\n\nexport class TriggerExecutionsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(triggerId: string, page?: number, size?: number): Promise<Paginated<TriggerExecutionResult>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n return this.httpGet<Paginated<TriggerExecutionResult>>('/triggers/' + triggerId + '/executions', params);\n }\n\n async execute(triggerId: string, execution: TriggerExecutionResult): Promise<TriggerExecutionResult> {\n return this.httpPost<TriggerExecutionResult>('/triggers/' + triggerId + '/executions', execution);\n }\n\n async get(executionId: string): Promise<TriggerExecutionResult> {\n return this.httpGet<TriggerExecutionResult>('/triggers/executions/' + executionId);\n }\n\n async remove(executionId: string): Promise<void> {\n await this.httpDelete('/triggers/executions/' + executionId);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { Trigger } from './types';\nimport { TriggerExecutionsApi } from './trigger-executions-api';\n\nexport class TriggersApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<Trigger>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<Trigger>>('/triggers', params);\n }\n\n async create(trigger: Trigger): Promise<Trigger> {\n return this.httpPost<Trigger>('/triggers', trigger);\n }\n\n async update(triggerId: string, trigger: Trigger): Promise<Trigger> {\n return this.httpPut<Trigger>('/triggers/' + triggerId, trigger);\n }\n\n async remove(triggerId: string): Promise<void> {\n await this.httpDelete('/triggers/' + triggerId);\n }\n\n async get(triggerId: string): Promise<Trigger> {\n return this.httpGet<Trigger>('/triggers/' + triggerId);\n }\n\n executions(): TriggerExecutionsApi {\n return new TriggerExecutionsApi(this.getBaseUrl(), this.getAuthProvider());\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { ServicePrice } from './types';\n\nexport class ServicePricesApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<ServicePrice>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<ServicePrice>>('/service-prices', params);\n }\n\n async get(id: string): Promise<ServicePrice> {\n return this.httpGet<ServicePrice>('/service-prices/' + id);\n }\n\n async create(servicePrice: ServicePrice): Promise<ServicePrice> {\n return this.httpPost<ServicePrice>('/service-prices', servicePrice);\n }\n\n async update(id: string, servicePrice: ServicePrice): Promise<ServicePrice> {\n return this.httpPut<ServicePrice>('/service-prices/' + id, servicePrice);\n }\n\n async remove(id: string): Promise<void> {\n await this.httpDelete('/service-prices/' + id);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { KnownModel } from './types';\n\nexport class KnownModelsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<KnownModel>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<KnownModel>>('/known-models', params);\n }\n\n async get(id: string): Promise<KnownModel> {\n return this.httpGet<KnownModel>('/known-models/' + id);\n }\n\n async create(knownModel: KnownModel): Promise<KnownModel> {\n return this.httpPost<KnownModel>('/known-models', knownModel);\n }\n\n async update(id: string, knownModel: KnownModel): Promise<KnownModel> {\n return this.httpPut<KnownModel>('/known-models/' + id, knownModel);\n }\n\n async remove(id: string): Promise<void> {\n await this.httpDelete('/known-models/' + id);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n Session,\n GenerationRequest,\n GenerationResponse,\n Message,\n CommittedUsage,\n AgentStateInfo,\n SteerAccepted,\n} from './types';\n\nexport class SessionsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(\n keyword?: string | null,\n status?: string | null,\n agentId?: string | null,\n userId?: string | null,\n page?: number,\n size?: number,\n ): Promise<Paginated<Session>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n if (keyword) params.keyword = keyword;\n if (status) params.status = status;\n if (agentId) params.agentId = agentId;\n if (userId) params.userId = userId;\n return this.httpGet<Paginated<Session>>('/sessions', params);\n }\n\n async get(sessionId: string): Promise<Session> {\n return this.httpGet<Session>('/sessions/' + sessionId);\n }\n\n async getUsage(sessionId: string): Promise<CommittedUsage[]> {\n return this.httpGet<CommittedUsage[]>('/sessions/' + sessionId + '/usage');\n }\n\n async generateMessage(code: string, request: GenerationRequest): Promise<GenerationResponse> {\n return this.httpPost<GenerationResponse>('/sessions/' + code + '/messages', request);\n }\n\n async findMessages(code: string, page?: number, size?: number): Promise<Paginated<Message>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n return this.httpGet<Paginated<Message>>('/sessions/' + code + '/messages', params);\n }\n\n async remove(code: string): Promise<void> {\n await this.httpDelete('/sessions/' + code);\n }\n\n async rename(sessionId: string, name: string): Promise<Session> {\n return this.httpPut<Session>('/sessions/' + sessionId + '/name', { name });\n }\n\n // ─── Agent Execution Lifecycle ────────────────────────────────\n\n /**\n * Get the current state of the agent execution for a session.\n */\n async getAgentState(code: string): Promise<AgentStateInfo> {\n return this.httpGet<AgentStateInfo>('/sessions/' + encodeURIComponent(code) + '/agent-state');\n }\n\n /**\n * Cancel a running agent execution for a session.\n */\n async cancelExecution(code: string): Promise<{ status: string; sessionId: string }> {\n return this.httpPost<{ status: string; sessionId: string }>(\n '/sessions/' + encodeURIComponent(code) + '/cancel',\n {},\n );\n }\n\n /**\n * Steer a running agent execution by injecting an instruction.\n */\n async steerExecution(code: string, text: string): Promise<SteerAccepted> {\n return this.httpPost<SteerAccepted>(\n '/sessions/' + encodeURIComponent(code) + '/steer',\n { text },\n );\n }\n}\n","import { HttpApi } from '../http-api';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { Paginated } from '../paginated';\nimport { Mission } from './types';\n\nexport class MissionsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, status?: string | null): Promise<Paginated<Mission>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n if (keyword) params.keyword = keyword;\n if (status) params.status = status;\n return this.httpGet<Paginated<Mission>>('/missions', params);\n }\n\n async get(missionId: string): Promise<Mission> {\n return this.httpGet<Mission>('/missions/' + missionId);\n }\n\n async create(mission: Mission): Promise<Mission> {\n return this.httpPost<Mission>('/missions', mission);\n }\n\n async update(missionId: string, mission: Mission): Promise<Mission> {\n return this.httpPut<Mission>('/missions/' + missionId, mission);\n }\n\n async remove(missionId: string): Promise<void> {\n await this.httpDelete('/missions/' + missionId);\n }\n\n async generate(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/generate');\n }\n\n async execute(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/execute');\n }\n\n async retry(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/retry');\n }\n\n async replan(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/replan');\n }\n\n async sendInstruction(missionId: string, instruction: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/instructions', { instruction });\n }\n\n async stop(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/stop');\n }\n\n async resume(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/continue');\n }\n}\n","import { AuthenticationProvider } from '../auth/authentication-provider';\nimport { ApiException } from '../exceptions';\nimport {\n Customer,\n Subscription,\n Invoice,\n CreateCustomerRequest,\n UpdateCustomerRequest,\n CreateSubscriptionRequest,\n UpgradeSubscriptionRequest,\n DowngradeSubscriptionRequest,\n MentorizeSubscriptionRequest,\n UsageStats,\n} from './types';\n\nexport class BillingClient {\n private readonly baseUrl: string;\n private readonly authProvider: AuthenticationProvider | string | null;\n\n constructor(baseUrl?: string, auth?: string | AuthenticationProvider | null) {\n this.baseUrl = (baseUrl || 'https://persona.applica.guru/billing').replace(/\\/$/, '');\n this.authProvider = auth ?? null;\n }\n\n private buildHeaders(): Headers {\n const headers = new Headers();\n headers.set('Content-Type', 'application/json');\n if (this.authProvider) {\n if (typeof this.authProvider === 'string') {\n headers.set('x-persona-apikey', this.authProvider);\n } else {\n this.authProvider.applyHeaders(headers);\n }\n }\n return headers;\n }\n\n private async request<T>(path: string, method: string, body?: unknown): Promise<T> {\n const response = await fetch(this.baseUrl + path, {\n method,\n headers: this.buildHeaders(),\n body: body ? JSON.stringify(body) : undefined,\n });\n if (!response.ok) {\n const text = await response.text();\n throw new ApiException(response.status, text);\n }\n const text = await response.text();\n return text ? JSON.parse(text) : (undefined as T);\n }\n\n async createCustomer(request: CreateCustomerRequest): Promise<Customer> {\n return this.request<Customer>('/customers', 'POST', request);\n }\n\n async updateCustomer(owner: string, request: UpdateCustomerRequest): Promise<Customer> {\n return this.request<Customer>('/customers/' + owner, 'PUT', request);\n }\n\n async getCustomer(owner: string): Promise<Customer> {\n return this.request<Customer>('/customers/' + owner, 'GET');\n }\n\n async saveCustomer(customer: Customer): Promise<Customer> {\n return this.request<Customer>('/customers', 'POST', customer);\n }\n\n async deleteCustomer(owner: string): Promise<void> {\n await this.request<void>('/customers/' + owner, 'DELETE');\n }\n\n async createSubscription(request: CreateSubscriptionRequest): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + request.owner + '/subscription', 'POST', request);\n }\n\n async getSubscription(owner: string): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription', 'GET');\n }\n\n async getProjectSubscription(projectId: string): Promise<Subscription> {\n return this.request<Subscription>('/projects/' + projectId + '/subscription', 'GET');\n }\n\n async changeProjectSubscriptionPlan(projectId: string, request: { toPlanType: string }): Promise<Subscription> {\n return this.request<Subscription>('/projects/' + projectId + '/subscription/actions/change-plan', 'POST', request);\n }\n\n async addProjectSubscriptionCredits(projectId: string, request: { credits: number }): Promise<Subscription> {\n return this.request<Subscription>('/projects/' + projectId + '/subscription/actions/add-credits', 'POST', request);\n }\n\n async beginUpgrade(owner: string, request: UpgradeSubscriptionRequest): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/actions/upgrade', 'POST', request);\n }\n\n async downgrade(owner: string, request: DowngradeSubscriptionRequest): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/actions/downgrade', 'POST', request);\n }\n\n async mentorize(owner: string, request: MentorizeSubscriptionRequest): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/actions/mentorize', 'POST', request);\n }\n\n async addCredits(owner: string, credits: number): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/credits', 'POST', { credits });\n }\n\n async useCredits(\n owner: string,\n credits: number,\n services: string[],\n referenceId?: string,\n totalCost?: number,\n totalPrice?: number,\n ): Promise<Subscription> {\n const body: Record<string, unknown> = { credits, services };\n if (referenceId) body.referenceId = referenceId;\n if (totalCost !== undefined) body.totalCost = totalCost;\n if (totalPrice !== undefined) body.totalPrice = totalPrice;\n return this.request<Subscription>('/customers/' + owner + '/subscription/credits', 'DELETE', body);\n }\n\n async getCredits(owner: string): Promise<number> {\n try {\n const result = await this.request<{ credits?: number }>('/customers/' + owner + '/subscription/credits', 'GET');\n return result.credits ?? 0;\n } catch {\n return 0;\n }\n }\n\n async isValid(owner: string): Promise<boolean> {\n try {\n const result = await this.request<{ valid?: boolean }>('/customers/' + owner + '/subscription/valid', 'GET');\n return result.valid ?? false;\n } catch {\n return false;\n }\n }\n\n async listInvoices(owner: string, dateFrom?: string, dateTo?: string): Promise<Invoice[]> {\n const params: string[] = [];\n if (dateFrom) params.push('date_from=' + dateFrom);\n if (dateTo) params.push('date_to=' + dateTo);\n const query = params.length > 0 ? '?' + params.join('&') : '';\n return this.request<Invoice[]>('/customers/' + owner + '/invoices' + query, 'GET');\n }\n\n async cancelSubscription(owner: string): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/actions/cancel', 'POST', {});\n }\n\n async getUsageStats(projectId: string, dateFrom?: string, dateTo?: string, models?: string[]): Promise<UsageStats> {\n const params: string[] = [];\n if (dateFrom) params.push('date_from=' + encodeURIComponent(dateFrom));\n if (dateTo) params.push('date_to=' + encodeURIComponent(dateTo));\n if (models?.length) models.forEach(m => params.push('model=' + encodeURIComponent(m)));\n const query = params.length > 0 ? '?' + params.join('&') : '';\n return this.request<UsageStats>('/projects/' + projectId + '/subscription/usage-stats' + query, 'GET');\n }\n}\n","import { HttpApi } from '../http-api';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\n\nexport class ValuesApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async get(category: string): Promise<Record<string, unknown>[]> {\n return this.httpGet<Record<string, unknown>[]>('/values/' + category);\n }\n\n async getLanguageCodes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/language-codes');\n }\n\n async getModelNames(): Promise<string[]> {\n return this.httpGet<string[]>('/values/model-names');\n }\n\n async getModelProviders(): Promise<string[]> {\n return this.httpGet<string[]>('/values/model-providers');\n }\n\n async getKnowledgeTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/knowledge-types');\n }\n\n async getCollaborationModes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/collaboration-modes');\n }\n\n async getTranscriberNames(): Promise<string[]> {\n return this.httpGet<string[]>('/values/transcriber-names');\n }\n\n async getSynthesizerNames(): Promise<string[]> {\n return this.httpGet<string[]>('/values/synthesizer-names');\n }\n\n async getSynthesizerVoices(synthesizerName: string): Promise<string[]> {\n return this.httpGet<string[]>('/values/synthesizers/' + synthesizerName + '/voices');\n }\n\n async getStmTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/stm-types');\n }\n\n async getDocumentExtractors(): Promise<string[]> {\n return this.httpGet<string[]>('/values/document-extractors');\n }\n\n async getEmbeddingModels(): Promise<string[]> {\n return this.httpGet<string[]>('/values/embedding-models');\n }\n\n async getQualityOptions(): Promise<string[]> {\n return this.httpGet<string[]>('/values/quality');\n }\n\n async getChunkSizeOptions(): Promise<string[]> {\n return this.httpGet<string[]>('/values/chunk-size');\n }\n\n async getFeatureTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/feature-types');\n }\n\n async getRoles(): Promise<string[]> {\n return this.httpGet<string[]>('/values/roles');\n }\n\n async getServiceUnits(): Promise<string[]> {\n return this.httpGet<string[]>('/values/service-units');\n }\n\n async getTriggerSourceTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/trigger-source-types');\n }\n\n async getTriggerDestinationTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/trigger-destination-types');\n }\n}\n","import { AuthenticationProvider } from './auth/authentication-provider';\nimport { ProjectsApi } from './projects/projects-api';\nimport { AgentsApi } from './agents/agents-api';\nimport { KnowledgeBasesApi } from './knowledges/knowledge-bases-api';\nimport { WorkflowsApi } from './workflows/workflows-api';\nimport { CredentialsApi } from './credentials/credentials-api';\nimport { FeaturesApi } from './features/features-api';\nimport { TriggersApi } from './triggers/triggers-api';\nimport { ServicePricesApi } from './service-prices/service-prices-api';\nimport { KnownModelsApi } from './known-models/known-models-api';\nimport { SessionsApi } from './sessions/sessions-api';\nimport { MissionsApi } from './missions/missions-api';\nimport { BillingClient } from './billing/billing-client';\nimport { ValuesApi } from './values/values-api';\n\nexport class PersonaSdk {\n private readonly baseUrl: string;\n private readonly workflowsBaseUrl: string;\n private readonly billingBaseUrl: string;\n\n constructor(baseUrl: string, workflowsBaseUrl: string, billingBaseUrl?: string) {\n this.baseUrl = baseUrl;\n this.workflowsBaseUrl = workflowsBaseUrl;\n this.billingBaseUrl = billingBaseUrl || 'https://persona.applica.guru/billing';\n }\n\n projects(apiKey: string): ProjectsApi;\n projects(authProvider: AuthenticationProvider): ProjectsApi;\n projects(auth: string | AuthenticationProvider): ProjectsApi {\n return new ProjectsApi(this.baseUrl, auth, this.billingBaseUrl);\n }\n\n agents(apiKey: string): AgentsApi;\n agents(authProvider: AuthenticationProvider): AgentsApi;\n agents(auth: string | AuthenticationProvider): AgentsApi {\n return new AgentsApi(this.baseUrl, auth);\n }\n\n knowledgeBases(apiKey: string): KnowledgeBasesApi;\n knowledgeBases(authProvider: AuthenticationProvider): KnowledgeBasesApi;\n knowledgeBases(auth: string | AuthenticationProvider): KnowledgeBasesApi {\n return new KnowledgeBasesApi(this.baseUrl, auth);\n }\n\n workflows(apiKey: string): WorkflowsApi;\n workflows(authProvider: AuthenticationProvider): WorkflowsApi;\n workflows(auth: string | AuthenticationProvider): WorkflowsApi {\n return new WorkflowsApi(this.workflowsBaseUrl, auth);\n }\n\n credentials(apiKey: string): CredentialsApi;\n credentials(authProvider: AuthenticationProvider): CredentialsApi;\n credentials(auth: string | AuthenticationProvider): CredentialsApi {\n return new CredentialsApi(this.baseUrl, auth);\n }\n\n features(apiKey: string): FeaturesApi;\n features(authProvider: AuthenticationProvider): FeaturesApi;\n features(auth: string | AuthenticationProvider): FeaturesApi {\n return new FeaturesApi(this.baseUrl, auth);\n }\n\n triggers(apiKey: string): TriggersApi;\n triggers(authProvider: AuthenticationProvider): TriggersApi;\n triggers(auth: string | AuthenticationProvider): TriggersApi {\n return new TriggersApi(this.baseUrl, auth);\n }\n\n servicePrices(apiKey: string): ServicePricesApi;\n servicePrices(authProvider: AuthenticationProvider): ServicePricesApi;\n servicePrices(auth: string | AuthenticationProvider): ServicePricesApi {\n return new ServicePricesApi(this.baseUrl, auth);\n }\n\n knownModels(apiKey: string): KnownModelsApi;\n knownModels(authProvider: AuthenticationProvider): KnownModelsApi;\n knownModels(auth: string | AuthenticationProvider): KnownModelsApi {\n return new KnownModelsApi(this.baseUrl, auth);\n }\n\n sessions(apiKey: string): SessionsApi;\n sessions(authProvider: AuthenticationProvider): SessionsApi;\n sessions(auth: string | AuthenticationProvider): SessionsApi {\n return new SessionsApi(this.baseUrl, auth);\n }\n\n missions(apiKey: string): MissionsApi;\n missions(authProvider: AuthenticationProvider): MissionsApi;\n missions(auth: string | AuthenticationProvider): MissionsApi {\n return new MissionsApi(this.baseUrl, auth);\n }\n\n billing(apiKey: string): BillingClient;\n billing(authProvider: AuthenticationProvider): BillingClient;\n billing(auth: string | AuthenticationProvider): BillingClient {\n return new BillingClient(this.billingBaseUrl, auth);\n }\n\n values(apiKey: string): ValuesApi;\n values(authProvider: AuthenticationProvider): ValuesApi;\n values(auth: string | AuthenticationProvider): ValuesApi {\n return new ValuesApi(this.baseUrl, auth);\n }\n}\n","import { AuthenticationProvider } from './authentication-provider';\n\nexport class BearerTokenAuthenticationProvider implements AuthenticationProvider {\n constructor(private readonly token: string) {}\n\n applyHeaders(headers: Headers): void {\n headers.set('Authorization', `Bearer ${this.token}`);\n }\n\n getCredentials(): string {\n return this.token;\n }\n}\n"],"names":["ApiException","statusCode","body","__publicField","ApiKeyAuthenticationProvider","apiKey","headers","HttpApi","baseUrl","page","size","path","params","url","key","value","response","text","ProjectsApi","auth","billingBaseUrl","keyword","p","s","projectId","request","method","AgentsApi","extraParams","agentId","synthesizerName","revisionId","prompt","sessionId","KnowledgeBaseDocumentsApi","knowledgeBaseId","documentId","KnowledgeBasesApi","id","WorkflowExecutionsApi","workflowId","executionId","WorkflowsApi","workflow","CredentialsApi","provider","code","state","scope","credentialsId","FeatureTemplatesApi","templateId","template","configuration","FeaturesApi","TriggerExecutionsApi","triggerId","execution","TriggersApi","trigger","ServicePricesApi","servicePrice","KnownModelsApi","knownModel","SessionsApi","status","userId","name","MissionsApi","missionId","mission","instruction","BillingClient","owner","customer","credits","services","referenceId","totalCost","totalPrice","dateFrom","dateTo","query","models","m","ValuesApi","category","PersonaSdk","workflowsBaseUrl","BearerTokenAuthenticationProvider","token"],"mappings":"oPAAO,MAAMA,UAAqB,KAAM,CAItC,YAAYC,EAAoBC,EAAc,CAC5C,MAAM,cAAcD,CAAU,MAAMC,CAAI,EAAE,EAJ5BC,EAAA,mBACAA,EAAA,aAId,KAAK,WAAaF,EAClB,KAAK,KAAOC,CACd,CACF,CCPO,MAAME,CAA+D,CAC1E,YAA6BC,EAAgB,CAAhB,KAAA,OAAAA,CAAiB,CAE9C,aAAaC,EAAwB,CACnCA,EAAQ,IAAI,mBAAoB,KAAK,MAAM,CAC7C,CAEA,gBAAyB,CACvB,OAAO,KAAK,MACd,CACF,CCRO,M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AC3D,OAAO,IAAIuC,EAAY,KAAK,QAASvC,CAAI,CAC3C,CAIA,cAAcA,EAAyD,CACrE,OAAO,IAAIyC,EAAiB,KAAK,QAASzC,CAAI,CAChD,CAIA,YAAYA,EAAuD,CACjE,OAAO,IAAI2C,EAAe,KAAK,QAAS3C,CAAI,CAC9C,CAIA,SAASA,EAAoD,CAC3D,OAAO,IAAI6C,EAAY,KAAK,QAAS7C,CAAI,CAC3C,CAIA,SAASA,EAAoD,CAC3D,OAAO,IAAIiD,EAAY,KAAK,QAASjD,CAAI,CAC3C,CAIA,QAAQA,EAAsD,CAC5D,OAAO,IAAIqD,EAAc,KAAK,eAAgBrD,CAAI,CACpD,CAIA,OAAOA,EAAkD,CACvD,OAAO,IAAIkE,EAAU,KAAK,QAASlE,CAAI,CACzC,CACF,CCrGO,MAAMsE,CAAoE,CAC/E,YAA6BC,EAAe,CAAf,KAAA,MAAAA,CAAgB,CAE7C,aAAapF,EAAwB,CACnCA,EAAQ,IAAI,gBAAiB,UAAU,KAAK,KAAK,EAAE,CACrD,CAEA,gBAAyB,CACvB,OAAO,KAAK,KACd,CACF"}
|
package/dist/bundle.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var u = (o, t, s) =>
|
|
1
|
+
var d = Object.defineProperty;
|
|
2
|
+
var g = (o, t, s) => t in o ? d(o, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : o[t] = s;
|
|
3
|
+
var u = (o, t, s) => g(o, typeof t != "symbol" ? t + "" : t, s);
|
|
4
4
|
class p extends Error {
|
|
5
5
|
constructor(s, e) {
|
|
6
6
|
super(`API Error: ${s} - ${e}`);
|
|
@@ -601,9 +601,9 @@ class B {
|
|
|
601
601
|
async addCredits(t, s) {
|
|
602
602
|
return this.request("/customers/" + t + "/subscription/credits", "POST", { credits: s });
|
|
603
603
|
}
|
|
604
|
-
async useCredits(t, s, e, r) {
|
|
605
|
-
const
|
|
606
|
-
return r && (
|
|
604
|
+
async useCredits(t, s, e, r, n, a) {
|
|
605
|
+
const i = { credits: s, services: e };
|
|
606
|
+
return r && (i.referenceId = r), n !== void 0 && (i.totalCost = n), a !== void 0 && (i.totalPrice = a), this.request("/customers/" + t + "/subscription/credits", "DELETE", i);
|
|
607
607
|
}
|
|
608
608
|
async getCredits(t) {
|
|
609
609
|
try {
|
package/dist/bundle.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.es.js","sources":["../src/exceptions.ts","../src/auth/api-key-auth.ts","../src/http-api.ts","../src/projects/projects-api.ts","../src/agents/agents-api.ts","../src/knowledges/knowledge-base-documents-api.ts","../src/knowledges/knowledge-bases-api.ts","../src/workflows/workflow-executions-api.ts","../src/workflows/workflows-api.ts","../src/credentials/credentials-api.ts","../src/features/feature-templates-api.ts","../src/features/features-api.ts","../src/triggers/trigger-executions-api.ts","../src/triggers/triggers-api.ts","../src/service-prices/service-prices-api.ts","../src/known-models/known-models-api.ts","../src/sessions/sessions-api.ts","../src/missions/missions-api.ts","../src/billing/billing-client.ts","../src/values/values-api.ts","../src/persona-sdk.ts","../src/auth/bearer-token-auth.ts"],"sourcesContent":["export class ApiException extends Error {\n public readonly statusCode: number;\n public readonly body: string;\n\n constructor(statusCode: number, body: string) {\n super(`API Error: ${statusCode} - ${body}`);\n this.statusCode = statusCode;\n this.body = body;\n }\n}\n","import { AuthenticationProvider } from './authentication-provider';\n\nexport class ApiKeyAuthenticationProvider implements AuthenticationProvider {\n constructor(private readonly apiKey: string) {}\n\n applyHeaders(headers: Headers): void {\n headers.set('x-persona-apikey', this.apiKey);\n }\n\n getCredentials(): string {\n return this.apiKey;\n }\n}\n","import { ApiException } from './exceptions';\nimport { AuthenticationProvider } from './auth/authentication-provider';\nimport { ApiKeyAuthenticationProvider } from './auth/api-key-auth';\n\nexport abstract class HttpApi {\n private readonly baseUrl: string;\n private readonly authProvider: AuthenticationProvider;\n\n constructor(baseUrl: string, apiKey: string | AuthenticationProvider) {\n this.baseUrl = baseUrl;\n this.authProvider = typeof apiKey === 'string' ? new ApiKeyAuthenticationProvider(apiKey) : apiKey;\n }\n\n protected getBaseUrl(): string {\n return this.baseUrl;\n }\n\n protected getAuthProvider(): AuthenticationProvider {\n return this.authProvider;\n }\n\n protected normalizePageParams(page?: number, size?: number): { page: number; size: number } {\n return {\n page: page === undefined || page < 1 ? 1 : page,\n size: size === undefined || size < 1 ? 20 : size,\n };\n }\n\n private buildHeaders(): Headers {\n const headers = new Headers();\n headers.set('Content-Type', 'application/json');\n this.authProvider.applyHeaders(headers);\n return headers;\n }\n\n private buildUrl(path: string, params?: Record<string, unknown>): string {\n const url = new URL(this.baseUrl + path);\n if (params) {\n Object.entries(params).forEach(([key, value]) => {\n if (value !== null && value !== undefined) {\n url.searchParams.set(key, String(value));\n }\n });\n }\n return url.toString();\n }\n\n private async handleResponse<T>(response: Response): Promise<T> {\n if (!response.ok) {\n const body = await response.text();\n throw new ApiException(response.status, body);\n }\n const text = await response.text();\n return text ? JSON.parse(text) : (undefined as T);\n }\n\n protected async httpGet<T>(path: string, params?: Record<string, unknown>): Promise<T> {\n const response = await fetch(this.buildUrl(path, params), {\n method: 'GET',\n headers: this.buildHeaders(),\n });\n return this.handleResponse<T>(response);\n }\n\n protected async httpPost<T>(path: string, body?: unknown, params?: Record<string, unknown>): Promise<T> {\n const response = await fetch(this.buildUrl(path, params), {\n method: 'POST',\n headers: this.buildHeaders(),\n body: body ? JSON.stringify(body) : undefined,\n });\n return this.handleResponse<T>(response);\n }\n\n protected async httpPut<T>(path: string, body: unknown): Promise<T> {\n const response = await fetch(this.baseUrl + path, {\n method: 'PUT',\n headers: this.buildHeaders(),\n body: JSON.stringify(body),\n });\n return this.handleResponse<T>(response);\n }\n\n protected async httpPatch<T>(path: string, body: unknown): Promise<T> {\n const response = await fetch(this.baseUrl + path, {\n method: 'PATCH',\n headers: this.buildHeaders(),\n body: JSON.stringify(body),\n });\n return this.handleResponse<T>(response);\n }\n\n protected async httpDelete(path: string): Promise<void> {\n const response = await fetch(this.baseUrl + path, {\n method: 'DELETE',\n headers: this.buildHeaders(),\n });\n if (!response.ok) {\n const body = await response.text();\n throw new ApiException(response.status, body);\n }\n }\n}\n","import { HttpApi } from '../http-api';\nimport { ApiException } from '../exceptions';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n Project,\n ProjectCreateRequest,\n ProjectUpdateRequest,\n ProjectDuplicateRequest,\n ProjectSubscription,\n ChangeProjectSubscriptionPlanRequest,\n AddProjectSubscriptionCreditsRequest,\n SetProjectSubscriptionInfiniteCreditsRequest,\n} from './types';\n\nexport class ProjectsApi extends HttpApi {\n private readonly billingBaseUrl: string;\n\n constructor(baseUrl: string, auth: string | AuthenticationProvider, billingBaseUrl?: string) {\n super(baseUrl, auth);\n this.billingBaseUrl = (billingBaseUrl || baseUrl).replace(/\\/$/, '');\n }\n\n async list(keyword: string | null, page: number, size: number): Promise<Paginated<Project>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<Project>>('/projects', params);\n }\n\n async get(projectId: string): Promise<Project> {\n return this.httpGet<Project>('/projects/' + projectId);\n }\n\n async getMine(): Promise<Project> {\n return this.httpGet<Project>('/projects/mine');\n }\n\n async create(request: ProjectCreateRequest): Promise<Project> {\n return this.httpPost<Project>('/projects', request);\n }\n\n async update(request: ProjectUpdateRequest): Promise<Project> {\n return this.httpPut<Project>('/projects/' + request.projectId, request);\n }\n\n async remove(projectId: string): Promise<void> {\n await this.httpDelete('/projects/' + projectId);\n }\n\n async duplicate(projectId: string, request: ProjectDuplicateRequest): Promise<Project> {\n return this.httpPost<Project>('/projects/' + projectId + '/actions/duplicate', request);\n }\n\n async getSubscription(projectId: string): Promise<ProjectSubscription> {\n return this.billingRequest<ProjectSubscription>('/projects/' + projectId + '/subscription', 'GET');\n }\n\n async changeSubscriptionPlan(projectId: string, request: ChangeProjectSubscriptionPlanRequest): Promise<ProjectSubscription> {\n return this.billingRequest<ProjectSubscription>('/projects/' + projectId + '/subscription/actions/change-plan', 'POST', request);\n }\n\n async addSubscriptionCredits(projectId: string, request: AddProjectSubscriptionCreditsRequest): Promise<ProjectSubscription> {\n return this.billingRequest<ProjectSubscription>('/projects/' + projectId + '/subscription/actions/add-credits', 'POST', request);\n }\n\n async setInfiniteCredits(projectId: string, request: SetProjectSubscriptionInfiniteCreditsRequest): Promise<ProjectSubscription> {\n return this.billingRequest<ProjectSubscription>('/projects/' + projectId + '/subscription/actions/set-infinite-credits', 'POST', request);\n }\n\n private async billingRequest<T>(path: string, method: string, body?: unknown): Promise<T> {\n const headers = new Headers();\n headers.set('Content-Type', 'application/json');\n this.getAuthProvider().applyHeaders(headers);\n\n const response = await fetch(this.billingBaseUrl + path, {\n method,\n headers,\n body: body ? JSON.stringify(body) : undefined,\n });\n\n if (!response.ok) {\n const text = await response.text();\n throw new ApiException(response.status, text);\n }\n\n const text = await response.text();\n return text ? JSON.parse(text) : (undefined as T);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n Agent,\n AgentCreateRequest,\n AgentUpdateRequest,\n SynthesizerVoice,\n Revision,\n} from './types';\n\nexport class AgentsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<Agent>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<Agent>>('/agents', params);\n }\n\n async get(agentId: string): Promise<Agent> {\n return this.httpGet<Agent>('/agents/' + agentId);\n }\n\n async create(request: AgentCreateRequest): Promise<Agent> {\n return this.httpPost<Agent>('/agents', request);\n }\n\n async update(request: AgentUpdateRequest): Promise<Agent> {\n return this.httpPut<Agent>('/agents/' + request.id, request);\n }\n\n async remove(agentId: string): Promise<void> {\n await this.httpDelete('/agents/' + agentId);\n }\n\n async getSynthesizerSupportedVoices(synthesizerName: string): Promise<SynthesizerVoice[]> {\n return this.httpGet<SynthesizerVoice[]>('/values/synthesizers/' + synthesizerName + '/voices');\n }\n\n async listRevisions(agentId: string): Promise<Revision[]> {\n return this.httpGet<Revision[]>('/agents/' + agentId + '/revisions');\n }\n\n async getRevision(agentId: string, revisionId: string): Promise<Revision> {\n return this.httpGet<Revision>('/agents/' + agentId + '/revisions/' + revisionId);\n }\n\n async rollback(agentId: string, revisionId: string): Promise<Agent> {\n return this.httpPost<Agent>('/agents/' + agentId + '/revisions/' + revisionId + '/rollback', {});\n }\n\n async generateSystemInstructions(prompt: string, sessionId?: string): Promise<string> {\n const body: Record<string, unknown> = { prompt };\n if (sessionId) body.sessionId = sessionId;\n const result = await this.httpPost<{ instructions: string }>('/agents/system-instructions', body);\n return result.instructions;\n }\n\n async getArchitect(): Promise<Agent> {\n return this.httpGet<Agent>('/agents/architect');\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n KnowledgeBaseDocument,\n KnowledgeBaseDocumentUploadRequest,\n} from './types';\n\nexport class KnowledgeBaseDocumentsApi extends HttpApi {\n private readonly knowledgeBaseId: string;\n\n constructor(baseUrl: string, auth: string | AuthenticationProvider, knowledgeBaseId: string) {\n super(baseUrl, auth);\n this.knowledgeBaseId = knowledgeBaseId;\n }\n\n async list(keyword?: string | null, page?: number, size?: number): Promise<Paginated<KnowledgeBaseDocument>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<KnowledgeBaseDocument>>('/knowledge-bases/' + this.knowledgeBaseId + '/documents', params);\n }\n\n async upload(request: KnowledgeBaseDocumentUploadRequest): Promise<KnowledgeBaseDocument> {\n return this.httpPost<KnowledgeBaseDocument>('/knowledge-bases/' + this.knowledgeBaseId + '/documents', request);\n }\n\n async get(documentId: string): Promise<KnowledgeBaseDocument> {\n return this.httpGet<KnowledgeBaseDocument>('/knowledge-bases/' + this.knowledgeBaseId + '/documents/' + documentId);\n }\n\n async reprocess(documentId: string): Promise<KnowledgeBaseDocument> {\n return this.httpPost<KnowledgeBaseDocument>('/knowledge-bases/' + this.knowledgeBaseId + '/documents', { document_id: documentId });\n }\n\n async remove(documentId: string): Promise<void> {\n await this.httpDelete('/knowledge-bases/' + this.knowledgeBaseId + '/documents/' + documentId);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n KnowledgeBase,\n KnowledgeBaseCreateRequest,\n KnowledgeBaseUpdateRequest,\n ChunkResult,\n SearchChunksRequest,\n} from './types';\nimport { KnowledgeBaseDocumentsApi } from './knowledge-base-documents-api';\n\nexport class KnowledgeBasesApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<KnowledgeBase>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<KnowledgeBase>>('/knowledge-bases', params);\n }\n\n async get(id: string): Promise<KnowledgeBase> {\n return this.httpGet<KnowledgeBase>('/knowledge-bases/' + id);\n }\n\n async create(request: KnowledgeBaseCreateRequest): Promise<KnowledgeBase> {\n return this.httpPost<KnowledgeBase>('/knowledge-bases', request);\n }\n\n async update(request: KnowledgeBaseUpdateRequest): Promise<KnowledgeBase> {\n return this.httpPut<KnowledgeBase>('/knowledge-bases/' + request.id, request);\n }\n\n async remove(id: string): Promise<void> {\n await this.httpDelete('/knowledge-bases/' + id);\n }\n\n documents(knowledgeBaseId: string): KnowledgeBaseDocumentsApi {\n return new KnowledgeBaseDocumentsApi(this.getBaseUrl(), this.getAuthProvider(), knowledgeBaseId);\n }\n\n async searchChunks(id: string, request: SearchChunksRequest): Promise<ChunkResult[]> {\n return this.httpPost<ChunkResult[]>('/knowledge-bases/' + id + '/search', request);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { Execution, ExecuteRequest } from './types';\n\nexport class WorkflowExecutionsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(workflowId: string, page?: number, size?: number): Promise<Paginated<Execution>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n return this.httpGet<Paginated<Execution>>('/workflows/' + workflowId + '/executions', params);\n }\n\n async get(workflowId: string, executionId: string): Promise<Execution> {\n return this.httpGet<Execution>('/workflows/' + workflowId + '/executions/' + executionId);\n }\n\n async run(workflowId: string, request: ExecuteRequest): Promise<Execution> {\n return this.httpPost<Execution>('/workflows/' + workflowId + '/executions', request);\n }\n\n async queue(workflowId: string, request: ExecuteRequest): Promise<Execution> {\n return this.httpPost<Execution>('/workflows/' + workflowId + '/executions/queue', request);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { Revision } from '../revisions/types';\nimport { Workflow } from './types';\nimport { WorkflowExecutionsApi } from './workflow-executions-api';\n\nexport class WorkflowsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<Workflow>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<Workflow>>('/workflows', params);\n }\n\n async create(workflow: Workflow): Promise<Workflow> {\n return this.httpPost<Workflow>('/workflows', workflow);\n }\n\n async update(workflowId: string, workflow: Workflow): Promise<Workflow> {\n workflow.id = workflowId;\n return this.httpPut<Workflow>('/workflows/' + workflowId, workflow);\n }\n\n async remove(workflowId: string): Promise<void> {\n await this.httpDelete('/workflows/' + workflowId);\n }\n\n async get(workflowId: string): Promise<Workflow> {\n return this.httpGet<Workflow>('/workflows/' + workflowId);\n }\n\n executions(): WorkflowExecutionsApi {\n return new WorkflowExecutionsApi(this.getBaseUrl(), this.getAuthProvider());\n }\n\n async listRevisions(workflowId: string): Promise<Revision[]> {\n return this.httpGet<Revision[]>('/workflows/' + workflowId + '/revisions');\n }\n\n async getRevision(workflowId: string, revisionId: string): Promise<Revision> {\n return this.httpGet<Revision>('/workflows/' + workflowId + '/revisions/' + revisionId);\n }\n\n async rollback(workflowId: string, revisionId: string): Promise<Workflow> {\n return this.httpPost<Workflow>('/workflows/' + workflowId + '/revisions/' + revisionId + '/rollback', {});\n }\n}\n","import { HttpApi } from '../http-api';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n Credentials,\n AuthorizeRequest,\n AuthorizeResponse,\n OAuth2CallbackResponse,\n} from './types';\n\nexport class CredentialsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async authorize(provider: string, request: AuthorizeRequest): Promise<AuthorizeResponse> {\n return this.httpPost<AuthorizeResponse>('/credentials/' + provider + '/authorize', request);\n }\n\n async handleOAuth2Callback(provider: string, code: string, state: string, scope?: string): Promise<OAuth2CallbackResponse> {\n const params: Record<string, unknown> = { code, state };\n if (scope) params.scope = scope;\n return this.httpGet<OAuth2CallbackResponse>('/credentials/' + provider + '/oauth2/callback', params);\n }\n\n async list(): Promise<Credentials[]> {\n return this.httpGet<Credentials[]>('/credentials');\n }\n\n async getByProvider(provider: string): Promise<Credentials[]> {\n return this.httpGet<Credentials[]>('/credentials/' + provider);\n }\n\n async getById(credentialsId: string): Promise<Credentials> {\n return this.httpGet<Credentials>('/credentials/all/' + credentialsId);\n }\n\n async remove(credentialsId: string): Promise<void> {\n await this.httpDelete('/credentials/all/' + credentialsId);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { FeatureTemplate, McpToolsResponse } from './types';\nimport { McpServerConfiguration } from '../agents/types';\n\nexport class FeatureTemplatesApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<FeatureTemplate>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<FeatureTemplate>>('/features/templates', params);\n }\n\n async get(templateId: string): Promise<FeatureTemplate> {\n return this.httpGet<FeatureTemplate>('/features/templates/' + templateId);\n }\n\n async create(template: FeatureTemplate): Promise<FeatureTemplate> {\n return this.httpPost<FeatureTemplate>('/features/templates', template);\n }\n\n async update(templateId: string, template: FeatureTemplate): Promise<FeatureTemplate> {\n return this.httpPut<FeatureTemplate>('/features/templates/' + templateId, template);\n }\n\n async patch(templateId: string, template: FeatureTemplate): Promise<FeatureTemplate> {\n return this.httpPatch<FeatureTemplate>('/features/templates/' + templateId, template);\n }\n\n async remove(templateId: string): Promise<void> {\n await this.httpDelete('/features/templates/' + templateId);\n }\n\n async getMcpAvailableTools(configuration: McpServerConfiguration, credentialsId?: string): Promise<McpToolsResponse> {\n const params = credentialsId ? { credentialsId } : undefined;\n return this.httpPost<McpToolsResponse>('/features/templates/mcp/available-tools', configuration, params);\n }\n}\n","import { AuthenticationProvider } from '../auth/authentication-provider';\nimport { FeatureTemplatesApi } from './feature-templates-api';\n\nexport class FeaturesApi {\n private readonly baseUrl: string;\n private readonly auth: string | AuthenticationProvider;\n\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n this.baseUrl = baseUrl;\n this.auth = auth;\n }\n\n templates(): FeatureTemplatesApi {\n return new FeatureTemplatesApi(this.baseUrl, this.auth);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { TriggerExecutionResult } from './types';\n\nexport class TriggerExecutionsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(triggerId: string, page?: number, size?: number): Promise<Paginated<TriggerExecutionResult>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n return this.httpGet<Paginated<TriggerExecutionResult>>('/triggers/' + triggerId + '/executions', params);\n }\n\n async execute(triggerId: string, execution: TriggerExecutionResult): Promise<TriggerExecutionResult> {\n return this.httpPost<TriggerExecutionResult>('/triggers/' + triggerId + '/executions', execution);\n }\n\n async get(executionId: string): Promise<TriggerExecutionResult> {\n return this.httpGet<TriggerExecutionResult>('/triggers/executions/' + executionId);\n }\n\n async remove(executionId: string): Promise<void> {\n await this.httpDelete('/triggers/executions/' + executionId);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { Trigger } from './types';\nimport { TriggerExecutionsApi } from './trigger-executions-api';\n\nexport class TriggersApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<Trigger>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<Trigger>>('/triggers', params);\n }\n\n async create(trigger: Trigger): Promise<Trigger> {\n return this.httpPost<Trigger>('/triggers', trigger);\n }\n\n async update(triggerId: string, trigger: Trigger): Promise<Trigger> {\n return this.httpPut<Trigger>('/triggers/' + triggerId, trigger);\n }\n\n async remove(triggerId: string): Promise<void> {\n await this.httpDelete('/triggers/' + triggerId);\n }\n\n async get(triggerId: string): Promise<Trigger> {\n return this.httpGet<Trigger>('/triggers/' + triggerId);\n }\n\n executions(): TriggerExecutionsApi {\n return new TriggerExecutionsApi(this.getBaseUrl(), this.getAuthProvider());\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { ServicePrice } from './types';\n\nexport class ServicePricesApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<ServicePrice>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<ServicePrice>>('/service-prices', params);\n }\n\n async get(id: string): Promise<ServicePrice> {\n return this.httpGet<ServicePrice>('/service-prices/' + id);\n }\n\n async create(servicePrice: ServicePrice): Promise<ServicePrice> {\n return this.httpPost<ServicePrice>('/service-prices', servicePrice);\n }\n\n async update(id: string, servicePrice: ServicePrice): Promise<ServicePrice> {\n return this.httpPut<ServicePrice>('/service-prices/' + id, servicePrice);\n }\n\n async remove(id: string): Promise<void> {\n await this.httpDelete('/service-prices/' + id);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { KnownModel } from './types';\n\nexport class KnownModelsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<KnownModel>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<KnownModel>>('/known-models', params);\n }\n\n async get(id: string): Promise<KnownModel> {\n return this.httpGet<KnownModel>('/known-models/' + id);\n }\n\n async create(knownModel: KnownModel): Promise<KnownModel> {\n return this.httpPost<KnownModel>('/known-models', knownModel);\n }\n\n async update(id: string, knownModel: KnownModel): Promise<KnownModel> {\n return this.httpPut<KnownModel>('/known-models/' + id, knownModel);\n }\n\n async remove(id: string): Promise<void> {\n await this.httpDelete('/known-models/' + id);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n Session,\n GenerationRequest,\n GenerationResponse,\n Message,\n CommittedUsage,\n AgentStateInfo,\n SteerAccepted,\n} from './types';\n\nexport class SessionsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(\n keyword?: string | null,\n status?: string | null,\n agentId?: string | null,\n userId?: string | null,\n page?: number,\n size?: number,\n ): Promise<Paginated<Session>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n if (keyword) params.keyword = keyword;\n if (status) params.status = status;\n if (agentId) params.agentId = agentId;\n if (userId) params.userId = userId;\n return this.httpGet<Paginated<Session>>('/sessions', params);\n }\n\n async get(sessionId: string): Promise<Session> {\n return this.httpGet<Session>('/sessions/' + sessionId);\n }\n\n async getUsage(sessionId: string): Promise<CommittedUsage[]> {\n return this.httpGet<CommittedUsage[]>('/sessions/' + sessionId + '/usage');\n }\n\n async generateMessage(code: string, request: GenerationRequest): Promise<GenerationResponse> {\n return this.httpPost<GenerationResponse>('/sessions/' + code + '/messages', request);\n }\n\n async findMessages(code: string, page?: number, size?: number): Promise<Paginated<Message>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n return this.httpGet<Paginated<Message>>('/sessions/' + code + '/messages', params);\n }\n\n async remove(code: string): Promise<void> {\n await this.httpDelete('/sessions/' + code);\n }\n\n async rename(sessionId: string, name: string): Promise<Session> {\n return this.httpPut<Session>('/sessions/' + sessionId + '/name', { name });\n }\n\n // ─── Agent Execution Lifecycle ────────────────────────────────\n\n /**\n * Get the current state of the agent execution for a session.\n */\n async getAgentState(code: string): Promise<AgentStateInfo> {\n return this.httpGet<AgentStateInfo>('/sessions/' + encodeURIComponent(code) + '/agent-state');\n }\n\n /**\n * Cancel a running agent execution for a session.\n */\n async cancelExecution(code: string): Promise<{ status: string; sessionId: string }> {\n return this.httpPost<{ status: string; sessionId: string }>(\n '/sessions/' + encodeURIComponent(code) + '/cancel',\n {},\n );\n }\n\n /**\n * Steer a running agent execution by injecting an instruction.\n */\n async steerExecution(code: string, text: string): Promise<SteerAccepted> {\n return this.httpPost<SteerAccepted>(\n '/sessions/' + encodeURIComponent(code) + '/steer',\n { text },\n );\n }\n}\n","import { HttpApi } from '../http-api';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { Paginated } from '../paginated';\nimport { Mission } from './types';\n\nexport class MissionsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, status?: string | null): Promise<Paginated<Mission>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n if (keyword) params.keyword = keyword;\n if (status) params.status = status;\n return this.httpGet<Paginated<Mission>>('/missions', params);\n }\n\n async get(missionId: string): Promise<Mission> {\n return this.httpGet<Mission>('/missions/' + missionId);\n }\n\n async create(mission: Mission): Promise<Mission> {\n return this.httpPost<Mission>('/missions', mission);\n }\n\n async update(missionId: string, mission: Mission): Promise<Mission> {\n return this.httpPut<Mission>('/missions/' + missionId, mission);\n }\n\n async remove(missionId: string): Promise<void> {\n await this.httpDelete('/missions/' + missionId);\n }\n\n async generate(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/generate');\n }\n\n async execute(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/execute');\n }\n\n async retry(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/retry');\n }\n\n async replan(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/replan');\n }\n\n async sendInstruction(missionId: string, instruction: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/instructions', { instruction });\n }\n\n async stop(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/stop');\n }\n\n async resume(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/continue');\n }\n}\n","import { AuthenticationProvider } from '../auth/authentication-provider';\nimport { ApiException } from '../exceptions';\nimport {\n Customer,\n Subscription,\n Invoice,\n CreateCustomerRequest,\n UpdateCustomerRequest,\n CreateSubscriptionRequest,\n UpgradeSubscriptionRequest,\n DowngradeSubscriptionRequest,\n MentorizeSubscriptionRequest,\n UsageStats,\n} from './types';\n\nexport class BillingClient {\n private readonly baseUrl: string;\n private readonly authProvider: AuthenticationProvider | string | null;\n\n constructor(baseUrl?: string, auth?: string | AuthenticationProvider | null) {\n this.baseUrl = (baseUrl || 'https://persona.applica.guru/billing').replace(/\\/$/, '');\n this.authProvider = auth ?? null;\n }\n\n private buildHeaders(): Headers {\n const headers = new Headers();\n headers.set('Content-Type', 'application/json');\n if (this.authProvider) {\n if (typeof this.authProvider === 'string') {\n headers.set('x-persona-apikey', this.authProvider);\n } else {\n this.authProvider.applyHeaders(headers);\n }\n }\n return headers;\n }\n\n private async request<T>(path: string, method: string, body?: unknown): Promise<T> {\n const response = await fetch(this.baseUrl + path, {\n method,\n headers: this.buildHeaders(),\n body: body ? JSON.stringify(body) : undefined,\n });\n if (!response.ok) {\n const text = await response.text();\n throw new ApiException(response.status, text);\n }\n const text = await response.text();\n return text ? JSON.parse(text) : (undefined as T);\n }\n\n async createCustomer(request: CreateCustomerRequest): Promise<Customer> {\n return this.request<Customer>('/customers', 'POST', request);\n }\n\n async updateCustomer(owner: string, request: UpdateCustomerRequest): Promise<Customer> {\n return this.request<Customer>('/customers/' + owner, 'PUT', request);\n }\n\n async getCustomer(owner: string): Promise<Customer> {\n return this.request<Customer>('/customers/' + owner, 'GET');\n }\n\n async saveCustomer(customer: Customer): Promise<Customer> {\n return this.request<Customer>('/customers', 'POST', customer);\n }\n\n async deleteCustomer(owner: string): Promise<void> {\n await this.request<void>('/customers/' + owner, 'DELETE');\n }\n\n async createSubscription(request: CreateSubscriptionRequest): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + request.owner + '/subscription', 'POST', request);\n }\n\n async getSubscription(owner: string): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription', 'GET');\n }\n\n async getProjectSubscription(projectId: string): Promise<Subscription> {\n return this.request<Subscription>('/projects/' + projectId + '/subscription', 'GET');\n }\n\n async changeProjectSubscriptionPlan(projectId: string, request: { toPlanType: string }): Promise<Subscription> {\n return this.request<Subscription>('/projects/' + projectId + '/subscription/actions/change-plan', 'POST', request);\n }\n\n async addProjectSubscriptionCredits(projectId: string, request: { credits: number }): Promise<Subscription> {\n return this.request<Subscription>('/projects/' + projectId + '/subscription/actions/add-credits', 'POST', request);\n }\n\n async beginUpgrade(owner: string, request: UpgradeSubscriptionRequest): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/actions/upgrade', 'POST', request);\n }\n\n async downgrade(owner: string, request: DowngradeSubscriptionRequest): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/actions/downgrade', 'POST', request);\n }\n\n async mentorize(owner: string, request: MentorizeSubscriptionRequest): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/actions/mentorize', 'POST', request);\n }\n\n async addCredits(owner: string, credits: number): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/credits', 'POST', { credits });\n }\n\n async useCredits(owner: string, credits: number, services: string[], referenceId?: string): Promise<Subscription> {\n const body: Record<string, unknown> = { credits, services };\n if (referenceId) body.referenceId = referenceId;\n return this.request<Subscription>('/customers/' + owner + '/subscription/credits', 'DELETE', body);\n }\n\n async getCredits(owner: string): Promise<number> {\n try {\n const result = await this.request<{ credits?: number }>('/customers/' + owner + '/subscription/credits', 'GET');\n return result.credits ?? 0;\n } catch {\n return 0;\n }\n }\n\n async isValid(owner: string): Promise<boolean> {\n try {\n const result = await this.request<{ valid?: boolean }>('/customers/' + owner + '/subscription/valid', 'GET');\n return result.valid ?? false;\n } catch {\n return false;\n }\n }\n\n async listInvoices(owner: string, dateFrom?: string, dateTo?: string): Promise<Invoice[]> {\n const params: string[] = [];\n if (dateFrom) params.push('date_from=' + dateFrom);\n if (dateTo) params.push('date_to=' + dateTo);\n const query = params.length > 0 ? '?' + params.join('&') : '';\n return this.request<Invoice[]>('/customers/' + owner + '/invoices' + query, 'GET');\n }\n\n async cancelSubscription(owner: string): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/actions/cancel', 'POST', {});\n }\n\n async getUsageStats(projectId: string, dateFrom?: string, dateTo?: string, models?: string[]): Promise<UsageStats> {\n const params: string[] = [];\n if (dateFrom) params.push('date_from=' + encodeURIComponent(dateFrom));\n if (dateTo) params.push('date_to=' + encodeURIComponent(dateTo));\n if (models?.length) models.forEach(m => params.push('model=' + encodeURIComponent(m)));\n const query = params.length > 0 ? '?' + params.join('&') : '';\n return this.request<UsageStats>('/projects/' + projectId + '/subscription/usage-stats' + query, 'GET');\n }\n}\n","import { HttpApi } from '../http-api';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\n\nexport class ValuesApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async get(category: string): Promise<Record<string, unknown>[]> {\n return this.httpGet<Record<string, unknown>[]>('/values/' + category);\n }\n\n async getLanguageCodes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/language-codes');\n }\n\n async getModelNames(): Promise<string[]> {\n return this.httpGet<string[]>('/values/model-names');\n }\n\n async getModelProviders(): Promise<string[]> {\n return this.httpGet<string[]>('/values/model-providers');\n }\n\n async getKnowledgeTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/knowledge-types');\n }\n\n async getCollaborationModes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/collaboration-modes');\n }\n\n async getTranscriberNames(): Promise<string[]> {\n return this.httpGet<string[]>('/values/transcriber-names');\n }\n\n async getSynthesizerNames(): Promise<string[]> {\n return this.httpGet<string[]>('/values/synthesizer-names');\n }\n\n async getSynthesizerVoices(synthesizerName: string): Promise<string[]> {\n return this.httpGet<string[]>('/values/synthesizers/' + synthesizerName + '/voices');\n }\n\n async getStmTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/stm-types');\n }\n\n async getDocumentExtractors(): Promise<string[]> {\n return this.httpGet<string[]>('/values/document-extractors');\n }\n\n async getEmbeddingModels(): Promise<string[]> {\n return this.httpGet<string[]>('/values/embedding-models');\n }\n\n async getQualityOptions(): Promise<string[]> {\n return this.httpGet<string[]>('/values/quality');\n }\n\n async getChunkSizeOptions(): Promise<string[]> {\n return this.httpGet<string[]>('/values/chunk-size');\n }\n\n async getFeatureTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/feature-types');\n }\n\n async getRoles(): Promise<string[]> {\n return this.httpGet<string[]>('/values/roles');\n }\n\n async getServiceUnits(): Promise<string[]> {\n return this.httpGet<string[]>('/values/service-units');\n }\n\n async getTriggerSourceTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/trigger-source-types');\n }\n\n async getTriggerDestinationTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/trigger-destination-types');\n }\n}\n","import { AuthenticationProvider } from './auth/authentication-provider';\nimport { ProjectsApi } from './projects/projects-api';\nimport { AgentsApi } from './agents/agents-api';\nimport { KnowledgeBasesApi } from './knowledges/knowledge-bases-api';\nimport { WorkflowsApi } from './workflows/workflows-api';\nimport { CredentialsApi } from './credentials/credentials-api';\nimport { FeaturesApi } from './features/features-api';\nimport { TriggersApi } from './triggers/triggers-api';\nimport { ServicePricesApi } from './service-prices/service-prices-api';\nimport { KnownModelsApi } from './known-models/known-models-api';\nimport { SessionsApi } from './sessions/sessions-api';\nimport { MissionsApi } from './missions/missions-api';\nimport { BillingClient } from './billing/billing-client';\nimport { ValuesApi } from './values/values-api';\n\nexport class PersonaSdk {\n private readonly baseUrl: string;\n private readonly workflowsBaseUrl: string;\n private readonly billingBaseUrl: string;\n\n constructor(baseUrl: string, workflowsBaseUrl: string, billingBaseUrl?: string) {\n this.baseUrl = baseUrl;\n this.workflowsBaseUrl = workflowsBaseUrl;\n this.billingBaseUrl = billingBaseUrl || 'https://persona.applica.guru/billing';\n }\n\n projects(apiKey: string): ProjectsApi;\n projects(authProvider: AuthenticationProvider): ProjectsApi;\n projects(auth: string | AuthenticationProvider): ProjectsApi {\n return new ProjectsApi(this.baseUrl, auth, this.billingBaseUrl);\n }\n\n agents(apiKey: string): AgentsApi;\n agents(authProvider: AuthenticationProvider): AgentsApi;\n agents(auth: string | AuthenticationProvider): AgentsApi {\n return new AgentsApi(this.baseUrl, auth);\n }\n\n knowledgeBases(apiKey: string): KnowledgeBasesApi;\n knowledgeBases(authProvider: AuthenticationProvider): KnowledgeBasesApi;\n knowledgeBases(auth: string | AuthenticationProvider): KnowledgeBasesApi {\n return new KnowledgeBasesApi(this.baseUrl, auth);\n }\n\n workflows(apiKey: string): WorkflowsApi;\n workflows(authProvider: AuthenticationProvider): WorkflowsApi;\n workflows(auth: string | AuthenticationProvider): WorkflowsApi {\n return new WorkflowsApi(this.workflowsBaseUrl, auth);\n }\n\n credentials(apiKey: string): CredentialsApi;\n credentials(authProvider: AuthenticationProvider): CredentialsApi;\n credentials(auth: string | AuthenticationProvider): CredentialsApi {\n return new CredentialsApi(this.baseUrl, auth);\n }\n\n features(apiKey: string): FeaturesApi;\n features(authProvider: AuthenticationProvider): FeaturesApi;\n features(auth: string | AuthenticationProvider): FeaturesApi {\n return new FeaturesApi(this.baseUrl, auth);\n }\n\n triggers(apiKey: string): TriggersApi;\n triggers(authProvider: AuthenticationProvider): TriggersApi;\n triggers(auth: string | AuthenticationProvider): TriggersApi {\n return new TriggersApi(this.baseUrl, auth);\n }\n\n servicePrices(apiKey: string): ServicePricesApi;\n servicePrices(authProvider: AuthenticationProvider): ServicePricesApi;\n servicePrices(auth: string | AuthenticationProvider): ServicePricesApi {\n return new ServicePricesApi(this.baseUrl, auth);\n }\n\n knownModels(apiKey: string): KnownModelsApi;\n knownModels(authProvider: AuthenticationProvider): KnownModelsApi;\n knownModels(auth: string | AuthenticationProvider): KnownModelsApi {\n return new KnownModelsApi(this.baseUrl, auth);\n }\n\n sessions(apiKey: string): SessionsApi;\n sessions(authProvider: AuthenticationProvider): SessionsApi;\n sessions(auth: string | AuthenticationProvider): SessionsApi {\n return new SessionsApi(this.baseUrl, auth);\n }\n\n missions(apiKey: string): MissionsApi;\n missions(authProvider: AuthenticationProvider): MissionsApi;\n missions(auth: string | AuthenticationProvider): MissionsApi {\n return new MissionsApi(this.baseUrl, auth);\n }\n\n billing(apiKey: string): BillingClient;\n billing(authProvider: AuthenticationProvider): BillingClient;\n billing(auth: string | AuthenticationProvider): BillingClient {\n return new BillingClient(this.billingBaseUrl, auth);\n }\n\n values(apiKey: string): ValuesApi;\n values(authProvider: AuthenticationProvider): ValuesApi;\n values(auth: string | AuthenticationProvider): ValuesApi {\n return new ValuesApi(this.baseUrl, auth);\n }\n}\n","import { AuthenticationProvider } from './authentication-provider';\n\nexport class BearerTokenAuthenticationProvider implements AuthenticationProvider {\n constructor(private readonly token: string) {}\n\n applyHeaders(headers: Headers): void {\n headers.set('Authorization', `Bearer ${this.token}`);\n }\n\n getCredentials(): string {\n return this.token;\n }\n}\n"],"names":["ApiException","statusCode","body","__publicField","ApiKeyAuthenticationProvider","apiKey","headers","HttpApi","baseUrl","page","size","path","params","url","key","value","response","text","ProjectsApi","auth","billingBaseUrl","keyword","p","s","projectId","request","method","AgentsApi","extraParams","agentId","synthesizerName","revisionId","prompt","sessionId","KnowledgeBaseDocumentsApi","knowledgeBaseId","documentId","KnowledgeBasesApi","id","WorkflowExecutionsApi","workflowId","executionId","WorkflowsApi","workflow","CredentialsApi","provider","code","state","scope","credentialsId","FeatureTemplatesApi","templateId","template","configuration","FeaturesApi","TriggerExecutionsApi","triggerId","execution","TriggersApi","trigger","ServicePricesApi","servicePrice","KnownModelsApi","knownModel","SessionsApi","status","userId","name","MissionsApi","missionId","mission","instruction","BillingClient","owner","customer","credits","services","referenceId","dateFrom","dateTo","query","models","m","ValuesApi","category","PersonaSdk","workflowsBaseUrl","BearerTokenAuthenticationProvider","token"],"mappings":";;;AAAO,MAAMA,UAAqB,MAAM;AAAA,EAItC,YAAYC,GAAoBC,GAAc;AAC5C,UAAM,cAAcD,CAAU,MAAMC,CAAI,EAAE;AAJ5B,IAAAC,EAAA;AACA,IAAAA,EAAA;AAId,SAAK,aAAaF,GAClB,KAAK,OAAOC;AAAA,EACd;AACF;ACPO,MAAME,EAA+D;AAAA,EAC1E,YAA6BC,GAAgB;AAAhB,SAAA,SAAAA;AAAA,EAAiB;AAAA,EAE9C,aAAaC,GAAwB;AACnC,IAAAA,EAAQ,IAAI,oBAAoB,KAAK,MAAM;AAAA,EAC7C;AAAA,EAEA,iBAAyB;AACvB,WAAO,KAAK;AAAA,EACd;AACF;ACRO,MAAeC,EAAQ;AAAA,EAI5B,YAAYC,GAAiBH,GAAyC;AAHrD,IAAAF,EAAA;AACA,IAAAA,EAAA;AAGf,SAAK,UAAUK,GACf,KAAK,eAAe,OAAOH,KAAW,WAAW,IAAID,EAA6BC,CAAM,IAAIA;AAAA,EAC9F;AAAA,EAEU,aAAqB;AAC7B,WAAO,KAAK;AAAA,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AiB,KAAK,SAASzC,CAAI;AAAA,EAChD;AAAA,EAIA,YAAYA,GAAuD;AACjE,WAAO,IAAI2C,EAAe,KAAK,SAAS3C,CAAI;AAAA,EAC9C;AAAA,EAIA,SAASA,GAAoD;AAC3D,WAAO,IAAI6C,EAAY,KAAK,SAAS7C,CAAI;AAAA,EAC3C;AAAA,EAIA,SAASA,GAAoD;AAC3D,WAAO,IAAIiD,EAAY,KAAK,SAASjD,CAAI;AAAA,EAC3C;AAAA,EAIA,QAAQA,GAAsD;AAC5D,WAAO,IAAIqD,EAAc,KAAK,gBAAgBrD,CAAI;AAAA,EACpD;AAAA,EAIA,OAAOA,GAAkD;AACvD,WAAO,IAAIgE,EAAU,KAAK,SAAShE,CAAI;AAAA,EACzC;AACF;ACrGO,MAAMoE,EAAoE;AAAA,EAC/E,YAA6BC,GAAe;AAAf,SAAA,QAAAA;AAAA,EAAgB;AAAA,EAE7C,aAAalF,GAAwB;AACnC,IAAAA,EAAQ,IAAI,iBAAiB,UAAU,KAAK,KAAK,EAAE;AAAA,EACrD;AAAA,EAEA,iBAAyB;AACvB,WAAO,KAAK;AAAA,EACd;AACF;"}
|
|
1
|
+
{"version":3,"file":"bundle.es.js","sources":["../src/exceptions.ts","../src/auth/api-key-auth.ts","../src/http-api.ts","../src/projects/projects-api.ts","../src/agents/agents-api.ts","../src/knowledges/knowledge-base-documents-api.ts","../src/knowledges/knowledge-bases-api.ts","../src/workflows/workflow-executions-api.ts","../src/workflows/workflows-api.ts","../src/credentials/credentials-api.ts","../src/features/feature-templates-api.ts","../src/features/features-api.ts","../src/triggers/trigger-executions-api.ts","../src/triggers/triggers-api.ts","../src/service-prices/service-prices-api.ts","../src/known-models/known-models-api.ts","../src/sessions/sessions-api.ts","../src/missions/missions-api.ts","../src/billing/billing-client.ts","../src/values/values-api.ts","../src/persona-sdk.ts","../src/auth/bearer-token-auth.ts"],"sourcesContent":["export class ApiException extends Error {\n public readonly statusCode: number;\n public readonly body: string;\n\n constructor(statusCode: number, body: string) {\n super(`API Error: ${statusCode} - ${body}`);\n this.statusCode = statusCode;\n this.body = body;\n }\n}\n","import { AuthenticationProvider } from './authentication-provider';\n\nexport class ApiKeyAuthenticationProvider implements AuthenticationProvider {\n constructor(private readonly apiKey: string) {}\n\n applyHeaders(headers: Headers): void {\n headers.set('x-persona-apikey', this.apiKey);\n }\n\n getCredentials(): string {\n return this.apiKey;\n }\n}\n","import { ApiException } from './exceptions';\nimport { AuthenticationProvider } from './auth/authentication-provider';\nimport { ApiKeyAuthenticationProvider } from './auth/api-key-auth';\n\nexport abstract class HttpApi {\n private readonly baseUrl: string;\n private readonly authProvider: AuthenticationProvider;\n\n constructor(baseUrl: string, apiKey: string | AuthenticationProvider) {\n this.baseUrl = baseUrl;\n this.authProvider = typeof apiKey === 'string' ? new ApiKeyAuthenticationProvider(apiKey) : apiKey;\n }\n\n protected getBaseUrl(): string {\n return this.baseUrl;\n }\n\n protected getAuthProvider(): AuthenticationProvider {\n return this.authProvider;\n }\n\n protected normalizePageParams(page?: number, size?: number): { page: number; size: number } {\n return {\n page: page === undefined || page < 1 ? 1 : page,\n size: size === undefined || size < 1 ? 20 : size,\n };\n }\n\n private buildHeaders(): Headers {\n const headers = new Headers();\n headers.set('Content-Type', 'application/json');\n this.authProvider.applyHeaders(headers);\n return headers;\n }\n\n private buildUrl(path: string, params?: Record<string, unknown>): string {\n const url = new URL(this.baseUrl + path);\n if (params) {\n Object.entries(params).forEach(([key, value]) => {\n if (value !== null && value !== undefined) {\n url.searchParams.set(key, String(value));\n }\n });\n }\n return url.toString();\n }\n\n private async handleResponse<T>(response: Response): Promise<T> {\n if (!response.ok) {\n const body = await response.text();\n throw new ApiException(response.status, body);\n }\n const text = await response.text();\n return text ? JSON.parse(text) : (undefined as T);\n }\n\n protected async httpGet<T>(path: string, params?: Record<string, unknown>): Promise<T> {\n const response = await fetch(this.buildUrl(path, params), {\n method: 'GET',\n headers: this.buildHeaders(),\n });\n return this.handleResponse<T>(response);\n }\n\n protected async httpPost<T>(path: string, body?: unknown, params?: Record<string, unknown>): Promise<T> {\n const response = await fetch(this.buildUrl(path, params), {\n method: 'POST',\n headers: this.buildHeaders(),\n body: body ? JSON.stringify(body) : undefined,\n });\n return this.handleResponse<T>(response);\n }\n\n protected async httpPut<T>(path: string, body: unknown): Promise<T> {\n const response = await fetch(this.baseUrl + path, {\n method: 'PUT',\n headers: this.buildHeaders(),\n body: JSON.stringify(body),\n });\n return this.handleResponse<T>(response);\n }\n\n protected async httpPatch<T>(path: string, body: unknown): Promise<T> {\n const response = await fetch(this.baseUrl + path, {\n method: 'PATCH',\n headers: this.buildHeaders(),\n body: JSON.stringify(body),\n });\n return this.handleResponse<T>(response);\n }\n\n protected async httpDelete(path: string): Promise<void> {\n const response = await fetch(this.baseUrl + path, {\n method: 'DELETE',\n headers: this.buildHeaders(),\n });\n if (!response.ok) {\n const body = await response.text();\n throw new ApiException(response.status, body);\n }\n }\n}\n","import { HttpApi } from '../http-api';\nimport { ApiException } from '../exceptions';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n Project,\n ProjectCreateRequest,\n ProjectUpdateRequest,\n ProjectDuplicateRequest,\n ProjectSubscription,\n ChangeProjectSubscriptionPlanRequest,\n AddProjectSubscriptionCreditsRequest,\n SetProjectSubscriptionInfiniteCreditsRequest,\n} from './types';\n\nexport class ProjectsApi extends HttpApi {\n private readonly billingBaseUrl: string;\n\n constructor(baseUrl: string, auth: string | AuthenticationProvider, billingBaseUrl?: string) {\n super(baseUrl, auth);\n this.billingBaseUrl = (billingBaseUrl || baseUrl).replace(/\\/$/, '');\n }\n\n async list(keyword: string | null, page: number, size: number): Promise<Paginated<Project>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<Project>>('/projects', params);\n }\n\n async get(projectId: string): Promise<Project> {\n return this.httpGet<Project>('/projects/' + projectId);\n }\n\n async getMine(): Promise<Project> {\n return this.httpGet<Project>('/projects/mine');\n }\n\n async create(request: ProjectCreateRequest): Promise<Project> {\n return this.httpPost<Project>('/projects', request);\n }\n\n async update(request: ProjectUpdateRequest): Promise<Project> {\n return this.httpPut<Project>('/projects/' + request.projectId, request);\n }\n\n async remove(projectId: string): Promise<void> {\n await this.httpDelete('/projects/' + projectId);\n }\n\n async duplicate(projectId: string, request: ProjectDuplicateRequest): Promise<Project> {\n return this.httpPost<Project>('/projects/' + projectId + '/actions/duplicate', request);\n }\n\n async getSubscription(projectId: string): Promise<ProjectSubscription> {\n return this.billingRequest<ProjectSubscription>('/projects/' + projectId + '/subscription', 'GET');\n }\n\n async changeSubscriptionPlan(projectId: string, request: ChangeProjectSubscriptionPlanRequest): Promise<ProjectSubscription> {\n return this.billingRequest<ProjectSubscription>('/projects/' + projectId + '/subscription/actions/change-plan', 'POST', request);\n }\n\n async addSubscriptionCredits(projectId: string, request: AddProjectSubscriptionCreditsRequest): Promise<ProjectSubscription> {\n return this.billingRequest<ProjectSubscription>('/projects/' + projectId + '/subscription/actions/add-credits', 'POST', request);\n }\n\n async setInfiniteCredits(projectId: string, request: SetProjectSubscriptionInfiniteCreditsRequest): Promise<ProjectSubscription> {\n return this.billingRequest<ProjectSubscription>('/projects/' + projectId + '/subscription/actions/set-infinite-credits', 'POST', request);\n }\n\n private async billingRequest<T>(path: string, method: string, body?: unknown): Promise<T> {\n const headers = new Headers();\n headers.set('Content-Type', 'application/json');\n this.getAuthProvider().applyHeaders(headers);\n\n const response = await fetch(this.billingBaseUrl + path, {\n method,\n headers,\n body: body ? JSON.stringify(body) : undefined,\n });\n\n if (!response.ok) {\n const text = await response.text();\n throw new ApiException(response.status, text);\n }\n\n const text = await response.text();\n return text ? JSON.parse(text) : (undefined as T);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n Agent,\n AgentCreateRequest,\n AgentUpdateRequest,\n SynthesizerVoice,\n Revision,\n} from './types';\n\nexport class AgentsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<Agent>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<Agent>>('/agents', params);\n }\n\n async get(agentId: string): Promise<Agent> {\n return this.httpGet<Agent>('/agents/' + agentId);\n }\n\n async create(request: AgentCreateRequest): Promise<Agent> {\n return this.httpPost<Agent>('/agents', request);\n }\n\n async update(request: AgentUpdateRequest): Promise<Agent> {\n return this.httpPut<Agent>('/agents/' + request.id, request);\n }\n\n async remove(agentId: string): Promise<void> {\n await this.httpDelete('/agents/' + agentId);\n }\n\n async getSynthesizerSupportedVoices(synthesizerName: string): Promise<SynthesizerVoice[]> {\n return this.httpGet<SynthesizerVoice[]>('/values/synthesizers/' + synthesizerName + '/voices');\n }\n\n async listRevisions(agentId: string): Promise<Revision[]> {\n return this.httpGet<Revision[]>('/agents/' + agentId + '/revisions');\n }\n\n async getRevision(agentId: string, revisionId: string): Promise<Revision> {\n return this.httpGet<Revision>('/agents/' + agentId + '/revisions/' + revisionId);\n }\n\n async rollback(agentId: string, revisionId: string): Promise<Agent> {\n return this.httpPost<Agent>('/agents/' + agentId + '/revisions/' + revisionId + '/rollback', {});\n }\n\n async generateSystemInstructions(prompt: string, sessionId?: string): Promise<string> {\n const body: Record<string, unknown> = { prompt };\n if (sessionId) body.sessionId = sessionId;\n const result = await this.httpPost<{ instructions: string }>('/agents/system-instructions', body);\n return result.instructions;\n }\n\n async getArchitect(): Promise<Agent> {\n return this.httpGet<Agent>('/agents/architect');\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n KnowledgeBaseDocument,\n KnowledgeBaseDocumentUploadRequest,\n} from './types';\n\nexport class KnowledgeBaseDocumentsApi extends HttpApi {\n private readonly knowledgeBaseId: string;\n\n constructor(baseUrl: string, auth: string | AuthenticationProvider, knowledgeBaseId: string) {\n super(baseUrl, auth);\n this.knowledgeBaseId = knowledgeBaseId;\n }\n\n async list(keyword?: string | null, page?: number, size?: number): Promise<Paginated<KnowledgeBaseDocument>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<KnowledgeBaseDocument>>('/knowledge-bases/' + this.knowledgeBaseId + '/documents', params);\n }\n\n async upload(request: KnowledgeBaseDocumentUploadRequest): Promise<KnowledgeBaseDocument> {\n return this.httpPost<KnowledgeBaseDocument>('/knowledge-bases/' + this.knowledgeBaseId + '/documents', request);\n }\n\n async get(documentId: string): Promise<KnowledgeBaseDocument> {\n return this.httpGet<KnowledgeBaseDocument>('/knowledge-bases/' + this.knowledgeBaseId + '/documents/' + documentId);\n }\n\n async reprocess(documentId: string): Promise<KnowledgeBaseDocument> {\n return this.httpPost<KnowledgeBaseDocument>('/knowledge-bases/' + this.knowledgeBaseId + '/documents', { document_id: documentId });\n }\n\n async remove(documentId: string): Promise<void> {\n await this.httpDelete('/knowledge-bases/' + this.knowledgeBaseId + '/documents/' + documentId);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n KnowledgeBase,\n KnowledgeBaseCreateRequest,\n KnowledgeBaseUpdateRequest,\n ChunkResult,\n SearchChunksRequest,\n} from './types';\nimport { KnowledgeBaseDocumentsApi } from './knowledge-base-documents-api';\n\nexport class KnowledgeBasesApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<KnowledgeBase>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<KnowledgeBase>>('/knowledge-bases', params);\n }\n\n async get(id: string): Promise<KnowledgeBase> {\n return this.httpGet<KnowledgeBase>('/knowledge-bases/' + id);\n }\n\n async create(request: KnowledgeBaseCreateRequest): Promise<KnowledgeBase> {\n return this.httpPost<KnowledgeBase>('/knowledge-bases', request);\n }\n\n async update(request: KnowledgeBaseUpdateRequest): Promise<KnowledgeBase> {\n return this.httpPut<KnowledgeBase>('/knowledge-bases/' + request.id, request);\n }\n\n async remove(id: string): Promise<void> {\n await this.httpDelete('/knowledge-bases/' + id);\n }\n\n documents(knowledgeBaseId: string): KnowledgeBaseDocumentsApi {\n return new KnowledgeBaseDocumentsApi(this.getBaseUrl(), this.getAuthProvider(), knowledgeBaseId);\n }\n\n async searchChunks(id: string, request: SearchChunksRequest): Promise<ChunkResult[]> {\n return this.httpPost<ChunkResult[]>('/knowledge-bases/' + id + '/search', request);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { Execution, ExecuteRequest } from './types';\n\nexport class WorkflowExecutionsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(workflowId: string, page?: number, size?: number): Promise<Paginated<Execution>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n return this.httpGet<Paginated<Execution>>('/workflows/' + workflowId + '/executions', params);\n }\n\n async get(workflowId: string, executionId: string): Promise<Execution> {\n return this.httpGet<Execution>('/workflows/' + workflowId + '/executions/' + executionId);\n }\n\n async run(workflowId: string, request: ExecuteRequest): Promise<Execution> {\n return this.httpPost<Execution>('/workflows/' + workflowId + '/executions', request);\n }\n\n async queue(workflowId: string, request: ExecuteRequest): Promise<Execution> {\n return this.httpPost<Execution>('/workflows/' + workflowId + '/executions/queue', request);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { Revision } from '../revisions/types';\nimport { Workflow } from './types';\nimport { WorkflowExecutionsApi } from './workflow-executions-api';\n\nexport class WorkflowsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<Workflow>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<Workflow>>('/workflows', params);\n }\n\n async create(workflow: Workflow): Promise<Workflow> {\n return this.httpPost<Workflow>('/workflows', workflow);\n }\n\n async update(workflowId: string, workflow: Workflow): Promise<Workflow> {\n workflow.id = workflowId;\n return this.httpPut<Workflow>('/workflows/' + workflowId, workflow);\n }\n\n async remove(workflowId: string): Promise<void> {\n await this.httpDelete('/workflows/' + workflowId);\n }\n\n async get(workflowId: string): Promise<Workflow> {\n return this.httpGet<Workflow>('/workflows/' + workflowId);\n }\n\n executions(): WorkflowExecutionsApi {\n return new WorkflowExecutionsApi(this.getBaseUrl(), this.getAuthProvider());\n }\n\n async listRevisions(workflowId: string): Promise<Revision[]> {\n return this.httpGet<Revision[]>('/workflows/' + workflowId + '/revisions');\n }\n\n async getRevision(workflowId: string, revisionId: string): Promise<Revision> {\n return this.httpGet<Revision>('/workflows/' + workflowId + '/revisions/' + revisionId);\n }\n\n async rollback(workflowId: string, revisionId: string): Promise<Workflow> {\n return this.httpPost<Workflow>('/workflows/' + workflowId + '/revisions/' + revisionId + '/rollback', {});\n }\n}\n","import { HttpApi } from '../http-api';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n Credentials,\n AuthorizeRequest,\n AuthorizeResponse,\n OAuth2CallbackResponse,\n} from './types';\n\nexport class CredentialsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async authorize(provider: string, request: AuthorizeRequest): Promise<AuthorizeResponse> {\n return this.httpPost<AuthorizeResponse>('/credentials/' + provider + '/authorize', request);\n }\n\n async handleOAuth2Callback(provider: string, code: string, state: string, scope?: string): Promise<OAuth2CallbackResponse> {\n const params: Record<string, unknown> = { code, state };\n if (scope) params.scope = scope;\n return this.httpGet<OAuth2CallbackResponse>('/credentials/' + provider + '/oauth2/callback', params);\n }\n\n async list(): Promise<Credentials[]> {\n return this.httpGet<Credentials[]>('/credentials');\n }\n\n async getByProvider(provider: string): Promise<Credentials[]> {\n return this.httpGet<Credentials[]>('/credentials/' + provider);\n }\n\n async getById(credentialsId: string): Promise<Credentials> {\n return this.httpGet<Credentials>('/credentials/all/' + credentialsId);\n }\n\n async remove(credentialsId: string): Promise<void> {\n await this.httpDelete('/credentials/all/' + credentialsId);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { FeatureTemplate, McpToolsResponse } from './types';\nimport { McpServerConfiguration } from '../agents/types';\n\nexport class FeatureTemplatesApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<FeatureTemplate>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<FeatureTemplate>>('/features/templates', params);\n }\n\n async get(templateId: string): Promise<FeatureTemplate> {\n return this.httpGet<FeatureTemplate>('/features/templates/' + templateId);\n }\n\n async create(template: FeatureTemplate): Promise<FeatureTemplate> {\n return this.httpPost<FeatureTemplate>('/features/templates', template);\n }\n\n async update(templateId: string, template: FeatureTemplate): Promise<FeatureTemplate> {\n return this.httpPut<FeatureTemplate>('/features/templates/' + templateId, template);\n }\n\n async patch(templateId: string, template: FeatureTemplate): Promise<FeatureTemplate> {\n return this.httpPatch<FeatureTemplate>('/features/templates/' + templateId, template);\n }\n\n async remove(templateId: string): Promise<void> {\n await this.httpDelete('/features/templates/' + templateId);\n }\n\n async getMcpAvailableTools(configuration: McpServerConfiguration, credentialsId?: string): Promise<McpToolsResponse> {\n const params = credentialsId ? { credentialsId } : undefined;\n return this.httpPost<McpToolsResponse>('/features/templates/mcp/available-tools', configuration, params);\n }\n}\n","import { AuthenticationProvider } from '../auth/authentication-provider';\nimport { FeatureTemplatesApi } from './feature-templates-api';\n\nexport class FeaturesApi {\n private readonly baseUrl: string;\n private readonly auth: string | AuthenticationProvider;\n\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n this.baseUrl = baseUrl;\n this.auth = auth;\n }\n\n templates(): FeatureTemplatesApi {\n return new FeatureTemplatesApi(this.baseUrl, this.auth);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { TriggerExecutionResult } from './types';\n\nexport class TriggerExecutionsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(triggerId: string, page?: number, size?: number): Promise<Paginated<TriggerExecutionResult>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n return this.httpGet<Paginated<TriggerExecutionResult>>('/triggers/' + triggerId + '/executions', params);\n }\n\n async execute(triggerId: string, execution: TriggerExecutionResult): Promise<TriggerExecutionResult> {\n return this.httpPost<TriggerExecutionResult>('/triggers/' + triggerId + '/executions', execution);\n }\n\n async get(executionId: string): Promise<TriggerExecutionResult> {\n return this.httpGet<TriggerExecutionResult>('/triggers/executions/' + executionId);\n }\n\n async remove(executionId: string): Promise<void> {\n await this.httpDelete('/triggers/executions/' + executionId);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { Trigger } from './types';\nimport { TriggerExecutionsApi } from './trigger-executions-api';\n\nexport class TriggersApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<Trigger>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<Trigger>>('/triggers', params);\n }\n\n async create(trigger: Trigger): Promise<Trigger> {\n return this.httpPost<Trigger>('/triggers', trigger);\n }\n\n async update(triggerId: string, trigger: Trigger): Promise<Trigger> {\n return this.httpPut<Trigger>('/triggers/' + triggerId, trigger);\n }\n\n async remove(triggerId: string): Promise<void> {\n await this.httpDelete('/triggers/' + triggerId);\n }\n\n async get(triggerId: string): Promise<Trigger> {\n return this.httpGet<Trigger>('/triggers/' + triggerId);\n }\n\n executions(): TriggerExecutionsApi {\n return new TriggerExecutionsApi(this.getBaseUrl(), this.getAuthProvider());\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { ServicePrice } from './types';\n\nexport class ServicePricesApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<ServicePrice>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<ServicePrice>>('/service-prices', params);\n }\n\n async get(id: string): Promise<ServicePrice> {\n return this.httpGet<ServicePrice>('/service-prices/' + id);\n }\n\n async create(servicePrice: ServicePrice): Promise<ServicePrice> {\n return this.httpPost<ServicePrice>('/service-prices', servicePrice);\n }\n\n async update(id: string, servicePrice: ServicePrice): Promise<ServicePrice> {\n return this.httpPut<ServicePrice>('/service-prices/' + id, servicePrice);\n }\n\n async remove(id: string): Promise<void> {\n await this.httpDelete('/service-prices/' + id);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { KnownModel } from './types';\n\nexport class KnownModelsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<KnownModel>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s, ...extraParams };\n if (keyword) params.keyword = keyword;\n return this.httpGet<Paginated<KnownModel>>('/known-models', params);\n }\n\n async get(id: string): Promise<KnownModel> {\n return this.httpGet<KnownModel>('/known-models/' + id);\n }\n\n async create(knownModel: KnownModel): Promise<KnownModel> {\n return this.httpPost<KnownModel>('/known-models', knownModel);\n }\n\n async update(id: string, knownModel: KnownModel): Promise<KnownModel> {\n return this.httpPut<KnownModel>('/known-models/' + id, knownModel);\n }\n\n async remove(id: string): Promise<void> {\n await this.httpDelete('/known-models/' + id);\n }\n}\n","import { HttpApi } from '../http-api';\nimport { Paginated } from '../paginated';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport {\n Session,\n GenerationRequest,\n GenerationResponse,\n Message,\n CommittedUsage,\n AgentStateInfo,\n SteerAccepted,\n} from './types';\n\nexport class SessionsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(\n keyword?: string | null,\n status?: string | null,\n agentId?: string | null,\n userId?: string | null,\n page?: number,\n size?: number,\n ): Promise<Paginated<Session>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n if (keyword) params.keyword = keyword;\n if (status) params.status = status;\n if (agentId) params.agentId = agentId;\n if (userId) params.userId = userId;\n return this.httpGet<Paginated<Session>>('/sessions', params);\n }\n\n async get(sessionId: string): Promise<Session> {\n return this.httpGet<Session>('/sessions/' + sessionId);\n }\n\n async getUsage(sessionId: string): Promise<CommittedUsage[]> {\n return this.httpGet<CommittedUsage[]>('/sessions/' + sessionId + '/usage');\n }\n\n async generateMessage(code: string, request: GenerationRequest): Promise<GenerationResponse> {\n return this.httpPost<GenerationResponse>('/sessions/' + code + '/messages', request);\n }\n\n async findMessages(code: string, page?: number, size?: number): Promise<Paginated<Message>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n return this.httpGet<Paginated<Message>>('/sessions/' + code + '/messages', params);\n }\n\n async remove(code: string): Promise<void> {\n await this.httpDelete('/sessions/' + code);\n }\n\n async rename(sessionId: string, name: string): Promise<Session> {\n return this.httpPut<Session>('/sessions/' + sessionId + '/name', { name });\n }\n\n // ─── Agent Execution Lifecycle ────────────────────────────────\n\n /**\n * Get the current state of the agent execution for a session.\n */\n async getAgentState(code: string): Promise<AgentStateInfo> {\n return this.httpGet<AgentStateInfo>('/sessions/' + encodeURIComponent(code) + '/agent-state');\n }\n\n /**\n * Cancel a running agent execution for a session.\n */\n async cancelExecution(code: string): Promise<{ status: string; sessionId: string }> {\n return this.httpPost<{ status: string; sessionId: string }>(\n '/sessions/' + encodeURIComponent(code) + '/cancel',\n {},\n );\n }\n\n /**\n * Steer a running agent execution by injecting an instruction.\n */\n async steerExecution(code: string, text: string): Promise<SteerAccepted> {\n return this.httpPost<SteerAccepted>(\n '/sessions/' + encodeURIComponent(code) + '/steer',\n { text },\n );\n }\n}\n","import { HttpApi } from '../http-api';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\nimport { Paginated } from '../paginated';\nimport { Mission } from './types';\n\nexport class MissionsApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async list(keyword?: string | null, page?: number, size?: number, status?: string | null): Promise<Paginated<Mission>> {\n const { page: p, size: s } = this.normalizePageParams(page, size);\n const params: Record<string, unknown> = { page: p, size: s };\n if (keyword) params.keyword = keyword;\n if (status) params.status = status;\n return this.httpGet<Paginated<Mission>>('/missions', params);\n }\n\n async get(missionId: string): Promise<Mission> {\n return this.httpGet<Mission>('/missions/' + missionId);\n }\n\n async create(mission: Mission): Promise<Mission> {\n return this.httpPost<Mission>('/missions', mission);\n }\n\n async update(missionId: string, mission: Mission): Promise<Mission> {\n return this.httpPut<Mission>('/missions/' + missionId, mission);\n }\n\n async remove(missionId: string): Promise<void> {\n await this.httpDelete('/missions/' + missionId);\n }\n\n async generate(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/generate');\n }\n\n async execute(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/execute');\n }\n\n async retry(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/retry');\n }\n\n async replan(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/replan');\n }\n\n async sendInstruction(missionId: string, instruction: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/instructions', { instruction });\n }\n\n async stop(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/stop');\n }\n\n async resume(missionId: string): Promise<Mission> {\n return this.httpPost<Mission>('/missions/' + missionId + '/continue');\n }\n}\n","import { AuthenticationProvider } from '../auth/authentication-provider';\nimport { ApiException } from '../exceptions';\nimport {\n Customer,\n Subscription,\n Invoice,\n CreateCustomerRequest,\n UpdateCustomerRequest,\n CreateSubscriptionRequest,\n UpgradeSubscriptionRequest,\n DowngradeSubscriptionRequest,\n MentorizeSubscriptionRequest,\n UsageStats,\n} from './types';\n\nexport class BillingClient {\n private readonly baseUrl: string;\n private readonly authProvider: AuthenticationProvider | string | null;\n\n constructor(baseUrl?: string, auth?: string | AuthenticationProvider | null) {\n this.baseUrl = (baseUrl || 'https://persona.applica.guru/billing').replace(/\\/$/, '');\n this.authProvider = auth ?? null;\n }\n\n private buildHeaders(): Headers {\n const headers = new Headers();\n headers.set('Content-Type', 'application/json');\n if (this.authProvider) {\n if (typeof this.authProvider === 'string') {\n headers.set('x-persona-apikey', this.authProvider);\n } else {\n this.authProvider.applyHeaders(headers);\n }\n }\n return headers;\n }\n\n private async request<T>(path: string, method: string, body?: unknown): Promise<T> {\n const response = await fetch(this.baseUrl + path, {\n method,\n headers: this.buildHeaders(),\n body: body ? JSON.stringify(body) : undefined,\n });\n if (!response.ok) {\n const text = await response.text();\n throw new ApiException(response.status, text);\n }\n const text = await response.text();\n return text ? JSON.parse(text) : (undefined as T);\n }\n\n async createCustomer(request: CreateCustomerRequest): Promise<Customer> {\n return this.request<Customer>('/customers', 'POST', request);\n }\n\n async updateCustomer(owner: string, request: UpdateCustomerRequest): Promise<Customer> {\n return this.request<Customer>('/customers/' + owner, 'PUT', request);\n }\n\n async getCustomer(owner: string): Promise<Customer> {\n return this.request<Customer>('/customers/' + owner, 'GET');\n }\n\n async saveCustomer(customer: Customer): Promise<Customer> {\n return this.request<Customer>('/customers', 'POST', customer);\n }\n\n async deleteCustomer(owner: string): Promise<void> {\n await this.request<void>('/customers/' + owner, 'DELETE');\n }\n\n async createSubscription(request: CreateSubscriptionRequest): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + request.owner + '/subscription', 'POST', request);\n }\n\n async getSubscription(owner: string): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription', 'GET');\n }\n\n async getProjectSubscription(projectId: string): Promise<Subscription> {\n return this.request<Subscription>('/projects/' + projectId + '/subscription', 'GET');\n }\n\n async changeProjectSubscriptionPlan(projectId: string, request: { toPlanType: string }): Promise<Subscription> {\n return this.request<Subscription>('/projects/' + projectId + '/subscription/actions/change-plan', 'POST', request);\n }\n\n async addProjectSubscriptionCredits(projectId: string, request: { credits: number }): Promise<Subscription> {\n return this.request<Subscription>('/projects/' + projectId + '/subscription/actions/add-credits', 'POST', request);\n }\n\n async beginUpgrade(owner: string, request: UpgradeSubscriptionRequest): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/actions/upgrade', 'POST', request);\n }\n\n async downgrade(owner: string, request: DowngradeSubscriptionRequest): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/actions/downgrade', 'POST', request);\n }\n\n async mentorize(owner: string, request: MentorizeSubscriptionRequest): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/actions/mentorize', 'POST', request);\n }\n\n async addCredits(owner: string, credits: number): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/credits', 'POST', { credits });\n }\n\n async useCredits(\n owner: string,\n credits: number,\n services: string[],\n referenceId?: string,\n totalCost?: number,\n totalPrice?: number,\n ): Promise<Subscription> {\n const body: Record<string, unknown> = { credits, services };\n if (referenceId) body.referenceId = referenceId;\n if (totalCost !== undefined) body.totalCost = totalCost;\n if (totalPrice !== undefined) body.totalPrice = totalPrice;\n return this.request<Subscription>('/customers/' + owner + '/subscription/credits', 'DELETE', body);\n }\n\n async getCredits(owner: string): Promise<number> {\n try {\n const result = await this.request<{ credits?: number }>('/customers/' + owner + '/subscription/credits', 'GET');\n return result.credits ?? 0;\n } catch {\n return 0;\n }\n }\n\n async isValid(owner: string): Promise<boolean> {\n try {\n const result = await this.request<{ valid?: boolean }>('/customers/' + owner + '/subscription/valid', 'GET');\n return result.valid ?? false;\n } catch {\n return false;\n }\n }\n\n async listInvoices(owner: string, dateFrom?: string, dateTo?: string): Promise<Invoice[]> {\n const params: string[] = [];\n if (dateFrom) params.push('date_from=' + dateFrom);\n if (dateTo) params.push('date_to=' + dateTo);\n const query = params.length > 0 ? '?' + params.join('&') : '';\n return this.request<Invoice[]>('/customers/' + owner + '/invoices' + query, 'GET');\n }\n\n async cancelSubscription(owner: string): Promise<Subscription> {\n return this.request<Subscription>('/customers/' + owner + '/subscription/actions/cancel', 'POST', {});\n }\n\n async getUsageStats(projectId: string, dateFrom?: string, dateTo?: string, models?: string[]): Promise<UsageStats> {\n const params: string[] = [];\n if (dateFrom) params.push('date_from=' + encodeURIComponent(dateFrom));\n if (dateTo) params.push('date_to=' + encodeURIComponent(dateTo));\n if (models?.length) models.forEach(m => params.push('model=' + encodeURIComponent(m)));\n const query = params.length > 0 ? '?' + params.join('&') : '';\n return this.request<UsageStats>('/projects/' + projectId + '/subscription/usage-stats' + query, 'GET');\n }\n}\n","import { HttpApi } from '../http-api';\nimport { AuthenticationProvider } from '../auth/authentication-provider';\n\nexport class ValuesApi extends HttpApi {\n constructor(baseUrl: string, auth: string | AuthenticationProvider) {\n super(baseUrl, auth);\n }\n\n async get(category: string): Promise<Record<string, unknown>[]> {\n return this.httpGet<Record<string, unknown>[]>('/values/' + category);\n }\n\n async getLanguageCodes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/language-codes');\n }\n\n async getModelNames(): Promise<string[]> {\n return this.httpGet<string[]>('/values/model-names');\n }\n\n async getModelProviders(): Promise<string[]> {\n return this.httpGet<string[]>('/values/model-providers');\n }\n\n async getKnowledgeTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/knowledge-types');\n }\n\n async getCollaborationModes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/collaboration-modes');\n }\n\n async getTranscriberNames(): Promise<string[]> {\n return this.httpGet<string[]>('/values/transcriber-names');\n }\n\n async getSynthesizerNames(): Promise<string[]> {\n return this.httpGet<string[]>('/values/synthesizer-names');\n }\n\n async getSynthesizerVoices(synthesizerName: string): Promise<string[]> {\n return this.httpGet<string[]>('/values/synthesizers/' + synthesizerName + '/voices');\n }\n\n async getStmTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/stm-types');\n }\n\n async getDocumentExtractors(): Promise<string[]> {\n return this.httpGet<string[]>('/values/document-extractors');\n }\n\n async getEmbeddingModels(): Promise<string[]> {\n return this.httpGet<string[]>('/values/embedding-models');\n }\n\n async getQualityOptions(): Promise<string[]> {\n return this.httpGet<string[]>('/values/quality');\n }\n\n async getChunkSizeOptions(): Promise<string[]> {\n return this.httpGet<string[]>('/values/chunk-size');\n }\n\n async getFeatureTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/feature-types');\n }\n\n async getRoles(): Promise<string[]> {\n return this.httpGet<string[]>('/values/roles');\n }\n\n async getServiceUnits(): Promise<string[]> {\n return this.httpGet<string[]>('/values/service-units');\n }\n\n async getTriggerSourceTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/trigger-source-types');\n }\n\n async getTriggerDestinationTypes(): Promise<string[]> {\n return this.httpGet<string[]>('/values/trigger-destination-types');\n }\n}\n","import { AuthenticationProvider } from './auth/authentication-provider';\nimport { ProjectsApi } from './projects/projects-api';\nimport { AgentsApi } from './agents/agents-api';\nimport { KnowledgeBasesApi } from './knowledges/knowledge-bases-api';\nimport { WorkflowsApi } from './workflows/workflows-api';\nimport { CredentialsApi } from './credentials/credentials-api';\nimport { FeaturesApi } from './features/features-api';\nimport { TriggersApi } from './triggers/triggers-api';\nimport { ServicePricesApi } from './service-prices/service-prices-api';\nimport { KnownModelsApi } from './known-models/known-models-api';\nimport { SessionsApi } from './sessions/sessions-api';\nimport { MissionsApi } from './missions/missions-api';\nimport { BillingClient } from './billing/billing-client';\nimport { ValuesApi } from './values/values-api';\n\nexport class PersonaSdk {\n private readonly baseUrl: string;\n private readonly workflowsBaseUrl: string;\n private readonly billingBaseUrl: string;\n\n constructor(baseUrl: string, workflowsBaseUrl: string, billingBaseUrl?: string) {\n this.baseUrl = baseUrl;\n this.workflowsBaseUrl = workflowsBaseUrl;\n this.billingBaseUrl = billingBaseUrl || 'https://persona.applica.guru/billing';\n }\n\n projects(apiKey: string): ProjectsApi;\n projects(authProvider: AuthenticationProvider): ProjectsApi;\n projects(auth: string | AuthenticationProvider): ProjectsApi {\n return new ProjectsApi(this.baseUrl, auth, this.billingBaseUrl);\n }\n\n agents(apiKey: string): AgentsApi;\n agents(authProvider: AuthenticationProvider): AgentsApi;\n agents(auth: string | AuthenticationProvider): AgentsApi {\n return new AgentsApi(this.baseUrl, auth);\n }\n\n knowledgeBases(apiKey: string): KnowledgeBasesApi;\n knowledgeBases(authProvider: AuthenticationProvider): KnowledgeBasesApi;\n knowledgeBases(auth: string | AuthenticationProvider): KnowledgeBasesApi {\n return new KnowledgeBasesApi(this.baseUrl, auth);\n }\n\n workflows(apiKey: string): WorkflowsApi;\n workflows(authProvider: AuthenticationProvider): WorkflowsApi;\n workflows(auth: string | AuthenticationProvider): WorkflowsApi {\n return new WorkflowsApi(this.workflowsBaseUrl, auth);\n }\n\n credentials(apiKey: string): CredentialsApi;\n credentials(authProvider: AuthenticationProvider): CredentialsApi;\n credentials(auth: string | AuthenticationProvider): CredentialsApi {\n return new CredentialsApi(this.baseUrl, auth);\n }\n\n features(apiKey: string): FeaturesApi;\n features(authProvider: AuthenticationProvider): FeaturesApi;\n features(auth: string | AuthenticationProvider): FeaturesApi {\n return new FeaturesApi(this.baseUrl, auth);\n }\n\n triggers(apiKey: string): TriggersApi;\n triggers(authProvider: AuthenticationProvider): TriggersApi;\n triggers(auth: string | AuthenticationProvider): TriggersApi {\n return new TriggersApi(this.baseUrl, auth);\n }\n\n servicePrices(apiKey: string): ServicePricesApi;\n servicePrices(authProvider: AuthenticationProvider): ServicePricesApi;\n servicePrices(auth: string | AuthenticationProvider): ServicePricesApi {\n return new ServicePricesApi(this.baseUrl, auth);\n }\n\n knownModels(apiKey: string): KnownModelsApi;\n knownModels(authProvider: AuthenticationProvider): KnownModelsApi;\n knownModels(auth: string | AuthenticationProvider): KnownModelsApi {\n return new KnownModelsApi(this.baseUrl, auth);\n }\n\n sessions(apiKey: string): SessionsApi;\n sessions(authProvider: AuthenticationProvider): SessionsApi;\n sessions(auth: string | AuthenticationProvider): SessionsApi {\n return new SessionsApi(this.baseUrl, auth);\n }\n\n missions(apiKey: string): MissionsApi;\n missions(authProvider: AuthenticationProvider): MissionsApi;\n missions(auth: string | AuthenticationProvider): MissionsApi {\n return new MissionsApi(this.baseUrl, auth);\n }\n\n billing(apiKey: string): BillingClient;\n billing(authProvider: AuthenticationProvider): BillingClient;\n billing(auth: string | AuthenticationProvider): BillingClient {\n return new BillingClient(this.billingBaseUrl, auth);\n }\n\n values(apiKey: string): ValuesApi;\n values(authProvider: AuthenticationProvider): ValuesApi;\n values(auth: string | AuthenticationProvider): ValuesApi {\n return new ValuesApi(this.baseUrl, auth);\n }\n}\n","import { AuthenticationProvider } from './authentication-provider';\n\nexport class BearerTokenAuthenticationProvider implements AuthenticationProvider {\n constructor(private readonly token: string) {}\n\n applyHeaders(headers: Headers): void {\n headers.set('Authorization', `Bearer ${this.token}`);\n }\n\n getCredentials(): string {\n return this.token;\n }\n}\n"],"names":["ApiException","statusCode","body","__publicField","ApiKeyAuthenticationProvider","apiKey","headers","HttpApi","baseUrl","page","size","path","params","url","key","value","response","text","ProjectsApi","auth","billingBaseUrl","keyword","p","s","projectId","request","method","AgentsApi","extraParams","agentId","synthesizerName","revisionId","prompt","sessionId","KnowledgeBaseDocumentsApi","knowledgeBaseId","documentId","KnowledgeBasesApi","id","WorkflowExecutionsApi","workflowId","executionId","WorkflowsApi","workflow","CredentialsApi","provider","code","state","scope","credentialsId","FeatureTemplatesApi","templateId","template","configuration","FeaturesApi","TriggerExecutionsApi","triggerId","execution","TriggersApi","trigger","ServicePricesApi","servicePrice","KnownModelsApi","knownModel","SessionsApi","status","userId","name","MissionsApi","missionId","mission","instruction","BillingClient","owner","customer","credits","services","referenceId","totalCost","totalPrice","dateFrom","dateTo","query","models","m","ValuesApi","category","PersonaSdk","workflowsBaseUrl","BearerTokenAuthenticationProvider","token"],"mappings":";;;AAAO,MAAMA,UAAqB,MAAM;AAAA,EAItC,YAAYC,GAAoBC,GAAc;AAC5C,UAAM,cAAcD,CAAU,MAAMC,CAAI,EAAE;A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AAI,iBAAiB,UAAU,KAAK,KAAK,EAAE;AAAA,EACrD;AAAA,EAEA,iBAAyB;AACvB,WAAO,KAAK;AAAA,EACd;AACF;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -198,7 +198,7 @@ export declare class BillingClient {
|
|
|
198
198
|
downgrade(owner: string, request: DowngradeSubscriptionRequest): Promise<Subscription>;
|
|
199
199
|
mentorize(owner: string, request: MentorizeSubscriptionRequest): Promise<Subscription>;
|
|
200
200
|
addCredits(owner: string, credits: number): Promise<Subscription>;
|
|
201
|
-
useCredits(owner: string, credits: number, services: string[], referenceId?: string): Promise<Subscription>;
|
|
201
|
+
useCredits(owner: string, credits: number, services: string[], referenceId?: string, totalCost?: number, totalPrice?: number): Promise<Subscription>;
|
|
202
202
|
getCredits(owner: string): Promise<number>;
|
|
203
203
|
isValid(owner: string): Promise<boolean>;
|
|
204
204
|
listInvoices(owner: string, dateFrom?: string, dateTo?: string): Promise<Invoice[]>;
|
|
@@ -211,6 +211,8 @@ export declare interface BillingUsage {
|
|
|
211
211
|
subscriptionId?: string;
|
|
212
212
|
creditsUsed?: number;
|
|
213
213
|
services?: string[];
|
|
214
|
+
totalCost?: number;
|
|
215
|
+
totalPrice?: number;
|
|
214
216
|
referenceId?: string;
|
|
215
217
|
createdAt?: string;
|
|
216
218
|
}
|
|
@@ -1276,12 +1278,16 @@ export declare interface UsageDailyEntry {
|
|
|
1276
1278
|
date: string;
|
|
1277
1279
|
credits: number;
|
|
1278
1280
|
count: number;
|
|
1281
|
+
totalCost?: number;
|
|
1282
|
+
totalPrice?: number;
|
|
1279
1283
|
}
|
|
1280
1284
|
|
|
1281
1285
|
export declare interface UsageModelEntry {
|
|
1282
1286
|
model: string;
|
|
1283
1287
|
credits: number;
|
|
1284
1288
|
count: number;
|
|
1289
|
+
totalCost?: number;
|
|
1290
|
+
totalPrice?: number;
|
|
1285
1291
|
}
|
|
1286
1292
|
|
|
1287
1293
|
export declare interface UsageStats {
|
|
@@ -1290,12 +1296,17 @@ export declare interface UsageStats {
|
|
|
1290
1296
|
daily: UsageDailyEntry[];
|
|
1291
1297
|
byModel: UsageModelEntry[];
|
|
1292
1298
|
availableModels: string[];
|
|
1299
|
+
hasCostData?: boolean;
|
|
1293
1300
|
}
|
|
1294
1301
|
|
|
1295
1302
|
export declare interface UsageTotals {
|
|
1296
1303
|
creditsUsed: number;
|
|
1297
1304
|
usageCount: number;
|
|
1298
1305
|
previousCreditsUsed: number;
|
|
1306
|
+
totalCost?: number;
|
|
1307
|
+
totalPrice?: number;
|
|
1308
|
+
previousTotalCost?: number;
|
|
1309
|
+
previousTotalPrice?: number;
|
|
1299
1310
|
}
|
|
1300
1311
|
|
|
1301
1312
|
export declare class ValuesApi extends HttpApi {
|
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.
|
|
5
|
+
"version": "0.1.34",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"dev": "vite",
|
|
@@ -105,9 +105,18 @@ export class BillingClient {
|
|
|
105
105
|
return this.request<Subscription>('/customers/' + owner + '/subscription/credits', 'POST', { credits });
|
|
106
106
|
}
|
|
107
107
|
|
|
108
|
-
async useCredits(
|
|
108
|
+
async useCredits(
|
|
109
|
+
owner: string,
|
|
110
|
+
credits: number,
|
|
111
|
+
services: string[],
|
|
112
|
+
referenceId?: string,
|
|
113
|
+
totalCost?: number,
|
|
114
|
+
totalPrice?: number,
|
|
115
|
+
): Promise<Subscription> {
|
|
109
116
|
const body: Record<string, unknown> = { credits, services };
|
|
110
117
|
if (referenceId) body.referenceId = referenceId;
|
|
118
|
+
if (totalCost !== undefined) body.totalCost = totalCost;
|
|
119
|
+
if (totalPrice !== undefined) body.totalPrice = totalPrice;
|
|
111
120
|
return this.request<Subscription>('/customers/' + owner + '/subscription/credits', 'DELETE', body);
|
|
112
121
|
}
|
|
113
122
|
|
package/src/billing/types.ts
CHANGED
|
@@ -56,6 +56,8 @@ export interface Usage {
|
|
|
56
56
|
subscriptionId?: string;
|
|
57
57
|
creditsUsed?: number;
|
|
58
58
|
services?: string[];
|
|
59
|
+
totalCost?: number;
|
|
60
|
+
totalPrice?: number;
|
|
59
61
|
referenceId?: string;
|
|
60
62
|
createdAt?: string;
|
|
61
63
|
}
|
|
@@ -107,18 +109,26 @@ export interface UsageDailyEntry {
|
|
|
107
109
|
date: string;
|
|
108
110
|
credits: number;
|
|
109
111
|
count: number;
|
|
112
|
+
totalCost?: number;
|
|
113
|
+
totalPrice?: number;
|
|
110
114
|
}
|
|
111
115
|
|
|
112
116
|
export interface UsageModelEntry {
|
|
113
117
|
model: string;
|
|
114
118
|
credits: number;
|
|
115
119
|
count: number;
|
|
120
|
+
totalCost?: number;
|
|
121
|
+
totalPrice?: number;
|
|
116
122
|
}
|
|
117
123
|
|
|
118
124
|
export interface UsageTotals {
|
|
119
125
|
creditsUsed: number;
|
|
120
126
|
usageCount: number;
|
|
121
127
|
previousCreditsUsed: number;
|
|
128
|
+
totalCost?: number;
|
|
129
|
+
totalPrice?: number;
|
|
130
|
+
previousTotalCost?: number;
|
|
131
|
+
previousTotalPrice?: number;
|
|
122
132
|
}
|
|
123
133
|
|
|
124
134
|
export interface UsageStats {
|
|
@@ -127,4 +137,5 @@ export interface UsageStats {
|
|
|
127
137
|
daily: UsageDailyEntry[];
|
|
128
138
|
byModel: UsageModelEntry[];
|
|
129
139
|
availableModels: string[];
|
|
140
|
+
hasCostData?: boolean;
|
|
130
141
|
}
|