@agentica/chat 0.37.0 → 0.39.0

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.
@@ -1,4 +1,4 @@
1
- import{j as c,o as A,r as g,T as b}from"../client-B3aq8qpT.js";import{n as B,t as U,o as v,p as T,q as $,r as S,s as F,v as R,w as k,x as M,_,d as P,V as j,c as z,F as O,T as E,B as q}from"../VendorConfigurationMovie-CimbPruT.js";import{D}from"../Divider-DX1xhf0M.js";function L(s){if(s.success!==!0){{if(s.value instanceof Error)throw s.value;if(typeof s.value=="object"&&s.value!==null){const t=new Error("Error from execute failure");throw Object.assign(t,s.value),t}}throw s.value}}class w{constructor(t){this.props=t,this.operations_=B.compose({controllers:t.controllers,config:t.config}),this.histories_=(t.histories??[]).map(a=>U({operations:this.operations_.group,history:a})),this.token_usage_=this.props.tokenUsage!==void 0?this.props.tokenUsage instanceof v?this.props.tokenUsage:new v(this.props.tokenUsage):v.zero(),this.listeners_=new Map,this.semaphore_=t.vendor.semaphore!=null?typeof t.vendor.semaphore=="object"?t.vendor.semaphore:new T(t.vendor.semaphore):null}clone(){var t;return new w({...this.props,histories:(t=this.props.histories)==null?void 0:t.slice()})}async conversate(t,a={}){var n,e,r;const l=[],u=async i=>{try{await this.dispatch(i),"toHistory"in i&&("join"in i?l.push(async()=>(await i.join(),i.toHistory())):l.push(async()=>i.toHistory()))}catch{}},f=$({contents:Array.isArray(t)?t:typeof t=="string"?[{type:"text",text:t}]:[t]});u(f).catch(()=>{});const h=this.getContext({prompt:f,dispatch:u,usage:this.token_usage_,abortSignal:a.abortSignal}),p=await S(h,this.operations_.array);if(((n=this.props.config)==null?void 0:n.throw)===!0)for(const i of p)L(i);p.length&&((r=(e=this.props.config)==null?void 0:e.executor)!=null&&r.describe)&&await(typeof this.props.config.executor.describe=="function"?this.props.config.executor.describe:F)(h,p);const o=await Promise.all(l.map(async i=>i()));return this.histories_.push(...o),o}getConfig(){return this.props.config}getVendor(){return this.props.vendor}getOperations(){return this.operations_.array}getControllers(){return this.props.controllers}getHistories(){return this.histories_}getTokenUsage(){return this.token_usage_}getContext(t){const a=R({vendor:this.props.vendor,config:this.props.config,dispatch:t.dispatch,abortSignal:t.abortSignal,usage:this.token_usage_});return{operations:this.operations_,config:this.props.config,histories:this.histories_,prompt:t.prompt,dispatch:t.dispatch,request:this.semaphore_===null?a:async(l,u)=>{await this.semaphore_.acquire();try{return await a(l,u)}finally{this.semaphore_.release().catch(()=>{})}}}}on(t,a){return k(this.listeners_,t,()=>new Set).add(a),this}off(t,a){const l=this.listeners_.get(t);return l!==void 0&&(l.delete(a),l.size===0&&this.listeners_.delete(t)),this}async dispatch(t){const a=this.listeners_.get(t.type);a!==void 0&&await Promise.all(Array.from(a).map(async l=>{try{await l(t)}catch{}}))}}var x={};Object.defineProperty(x,"__esModule",{value:!0});var m=x._isFormatUri=void 0;const H=s=>K.test(s)&&V.test(s);m=x._isFormatUri=H;const K=/\/|:/,V=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;var I={};Object.defineProperty(I,"__esModule",{value:!0});var y=I._isFormatUuid=void 0;const N=s=>W.test(s);y=I._isFormatUuid=N;const W=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;class G{constructor(){this.articles=[]}index(){return this.articles}create(t){const a={id:M(),title:t.input.title,body:t.input.body,thumbnail:t.input.thumbnail,created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return this.articles.push(a),a}update(t){const a=this.articles.find(l=>l.id===t.id);if(a===void 0)throw new Error("Unable to find the matched article.");t.input.title!==void 0&&(a.title=t.input.title),t.input.body!==void 0&&(a.body=t.input.body),t.input.thumbnail!==void 0&&(a.thumbnail=t.input.thumbnail),a.updated_at=new Date().toISOString()}erase(t){const a=this.articles.findIndex(l=>l.id===t.id);if(a===-1)throw new Error("Unable to find the matched article.");this.articles.splice(a,1)}}function J(s){const t=new G,a=new w({vendor:{api:s.api,model:s.vendorModel},controllers:[{protocol:"class",name:"bbs",application:{config:{reference:!0,strict:!1,separate:null,validate:null},functions:[{name:"index",parameters:{type:"object",properties:{},additionalProperties:!1,required:[],$defs:{IBbsArticle:{description:"Article entity.\n\n`IBbsArticle` is an entity representing an article in the BBS (Bulletin Board System).",type:"object",properties:{id:{description:"Primary Key.",type:"string",format:"uuid"},created_at:{description:"Creation time of the article.",type:"string",format:"date-time"},updated_at:{description:"Last updated time of the article.",type:"string",format:"date-time"},title:{description:`Title of the article.
1
+ import{j as c,o as A,r as g,T as b}from"../client-B3aq8qpT.js";import{n as B,t as U,o as v,p as T,q as $,r as S,s as F,v as R,w as k,x as M,_,d as P,V as j,c as z,F as O,T as E,B as q}from"../VendorConfigurationMovie-CxowcbGN.js";import{D}from"../Divider-DX1xhf0M.js";function L(s){if(s.success!==!0){{if(s.value instanceof Error)throw s.value;if(typeof s.value=="object"&&s.value!==null){const t=new Error("Error from execute failure");throw Object.assign(t,s.value),t}}throw s.value}}class w{constructor(t){this.props=t,this.operations_=B.compose({controllers:t.controllers,config:t.config}),this.histories_=(t.histories??[]).map(a=>U({operations:this.operations_.group,history:a})),this.token_usage_=this.props.tokenUsage!==void 0?this.props.tokenUsage instanceof v?this.props.tokenUsage:new v(this.props.tokenUsage):v.zero(),this.listeners_=new Map,this.semaphore_=t.vendor.semaphore!=null?typeof t.vendor.semaphore=="object"?t.vendor.semaphore:new T(t.vendor.semaphore):null}clone(){var t;return new w({...this.props,histories:(t=this.props.histories)==null?void 0:t.slice()})}async conversate(t,a={}){var n,e,r;const l=[],u=async i=>{try{await this.dispatch(i),"toHistory"in i&&("join"in i?l.push(async()=>(await i.join(),i.toHistory())):l.push(async()=>i.toHistory()))}catch{}},p=$({contents:Array.isArray(t)?t:typeof t=="string"?[{type:"text",text:t}]:[t]});u(p).catch(()=>{});const h=this.getContext({prompt:p,dispatch:u,usage:this.token_usage_,abortSignal:a.abortSignal}),f=await S(h,this.operations_.array);f.length&&((e=(n=this.props.config)==null?void 0:n.executor)!=null&&e.describe)&&await(typeof this.props.config.executor.describe=="function"?this.props.config.executor.describe:F)(h,f);const o=await Promise.all(l.map(async i=>i()));if(this.histories_.push(...o),((r=this.props.config)==null?void 0:r.throw)!==!1)for(const i of f)L(i);return o}getConfig(){return this.props.config}getVendor(){return this.props.vendor}getOperations(){return this.operations_.array}getControllers(){return this.props.controllers}getHistories(){return this.histories_}getTokenUsage(){return this.token_usage_}getContext(t){const a=R({vendor:this.props.vendor,config:this.props.config,dispatch:t.dispatch,abortSignal:t.abortSignal,usage:this.token_usage_});return{operations:this.operations_,config:this.props.config,histories:this.histories_,prompt:t.prompt,dispatch:t.dispatch,request:this.semaphore_===null?a:async(l,u)=>{await this.semaphore_.acquire();try{return await a(l,u)}finally{this.semaphore_.release().catch(()=>{})}}}}on(t,a){return k(this.listeners_,t,()=>new Set).add(a),this}off(t,a){const l=this.listeners_.get(t);return l!==void 0&&(l.delete(a),l.size===0&&this.listeners_.delete(t)),this}async dispatch(t){const a=this.listeners_.get(t.type);a!==void 0&&await Promise.all(Array.from(a).map(async l=>{try{await l(t)}catch{}}))}}var x={};Object.defineProperty(x,"__esModule",{value:!0});var m=x._isFormatUri=void 0;const H=s=>K.test(s)&&V.test(s);m=x._isFormatUri=H;const K=/\/|:/,V=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;var I={};Object.defineProperty(I,"__esModule",{value:!0});var y=I._isFormatUuid=void 0;const N=s=>W.test(s);y=I._isFormatUuid=N;const W=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;class G{constructor(){this.articles=[]}index(){return this.articles}create(t){const a={id:M(),title:t.input.title,body:t.input.body,thumbnail:t.input.thumbnail,created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return this.articles.push(a),a}update(t){const a=this.articles.find(l=>l.id===t.id);if(a===void 0)throw new Error("Unable to find the matched article.");t.input.title!==void 0&&(a.title=t.input.title),t.input.body!==void 0&&(a.body=t.input.body),t.input.thumbnail!==void 0&&(a.thumbnail=t.input.thumbnail),a.updated_at=new Date().toISOString()}erase(t){const a=this.articles.findIndex(l=>l.id===t.id);if(a===-1)throw new Error("Unable to find the matched article.");this.articles.splice(a,1)}}function J(s){const t=new G,a=new w({vendor:{api:s.api,model:s.vendorModel},controllers:[{protocol:"class",name:"bbs",application:{config:{reference:!0,strict:!1,separate:null,validate:null},functions:[{name:"index",parameters:{type:"object",properties:{},additionalProperties:!1,required:[],$defs:{IBbsArticle:{description:"Article entity.\n\n`IBbsArticle` is an entity representing an article in the BBS (Bulletin Board System).",type:"object",properties:{id:{description:"Primary Key.",type:"string",format:"uuid"},created_at:{description:"Creation time of the article.",type:"string",format:"date-time"},updated_at:{description:"Last updated time of the article.",type:"string",format:"date-time"},title:{description:`Title of the article.
2
2
 
3
3
  Representative title of the article.`,type:"string"},body:{description:`Content body.
4
4
 
@@ -26,7 +26,7 @@ Thumbnail image URI which can represent the article.
26
26
 
27
27
  If configured as \`null\`, it means that no thumbnail image in the article.`,anyOf:[{type:"null"},{type:"string",format:"uri",contentMediaType:"image/*"}]}},required:["id","created_at","updated_at","title","body","thumbnail"]}}},output:{$ref:"#/$defs/IBbsArticle"},description:`Create a new article.
28
28
 
29
- Writes a new article and archives it into the DB.`,validate:(()=>{const l=e=>typeof e.input=="object"&&e.input!==null&&u(e.input),u=e=>typeof e.title=="string"&&typeof e.body=="string"&&(e.thumbnail===null||typeof e.thumbnail=="string"&&m(e.thumbnail)),f=(e,r,i=!0)=>[(typeof e.input=="object"&&e.input!==null||n(i,{path:r+".input",expected:"IBbsArticle.ICreate",value:e.input}))&&h(e.input,r+".input",i)||n(i,{path:r+".input",expected:"IBbsArticle.ICreate",value:e.input})].every(d=>d),h=(e,r,i=!0)=>[typeof e.title=="string"||n(i,{path:r+".title",expected:"string",value:e.title}),typeof e.body=="string"||n(i,{path:r+".body",expected:"string",value:e.body}),e.thumbnail===null||typeof e.thumbnail=="string"&&(m(e.thumbnail)||n(i,{path:r+".thumbnail",expected:'string & Format<"uri">',value:e.thumbnail}))||n(i,{path:r+".thumbnail",expected:'((string & Format<"uri"> & ContentMediaType<"image/*">) | null)',value:e.thumbnail})].every(d=>d),p=e=>typeof e=="object"&&e!==null&&l(e);let o,n;return e=>{if(p(e)===!1){o=[],n=_(o),((i,d,C=!0)=>(typeof i=="object"&&i!==null||n(!0,{path:d+"",expected:"__type",value:i}))&&f(i,d+"",!0)||n(!0,{path:d+"",expected:"__type",value:i}))(e,"$input",!0);const r=o.length===0;return r?{success:r,data:e}:{success:r,errors:o,data:e}}return{success:!0,data:e}}})()},{name:"update",parameters:{description:" Properties of update function",type:"object",properties:{id:{description:"Target article's {@link IBbsArticle.id}.",type:"string",format:"uuid"},input:{description:"New content to update.",$ref:"#/$defs/PartialIBbsArticle.ICreate"}},required:["id","input"],additionalProperties:!1,$defs:{"PartialIBbsArticle.ICreate":{description:"Make all properties in T optional",type:"object",properties:{title:{description:`Title of the article.
29
+ Writes a new article and archives it into the DB.`,validate:(()=>{const l=e=>typeof e.input=="object"&&e.input!==null&&u(e.input),u=e=>typeof e.title=="string"&&typeof e.body=="string"&&(e.thumbnail===null||typeof e.thumbnail=="string"&&m(e.thumbnail)),p=(e,r,i=!0)=>[(typeof e.input=="object"&&e.input!==null||n(i,{path:r+".input",expected:"IBbsArticle.ICreate",value:e.input}))&&h(e.input,r+".input",i)||n(i,{path:r+".input",expected:"IBbsArticle.ICreate",value:e.input})].every(d=>d),h=(e,r,i=!0)=>[typeof e.title=="string"||n(i,{path:r+".title",expected:"string",value:e.title}),typeof e.body=="string"||n(i,{path:r+".body",expected:"string",value:e.body}),e.thumbnail===null||typeof e.thumbnail=="string"&&(m(e.thumbnail)||n(i,{path:r+".thumbnail",expected:'string & Format<"uri">',value:e.thumbnail}))||n(i,{path:r+".thumbnail",expected:'((string & Format<"uri"> & ContentMediaType<"image/*">) | null)',value:e.thumbnail})].every(d=>d),f=e=>typeof e=="object"&&e!==null&&l(e);let o,n;return e=>{if(f(e)===!1){o=[],n=_(o),((i,d,C=!0)=>(typeof i=="object"&&i!==null||n(!0,{path:d+"",expected:"__type",value:i}))&&p(i,d+"",!0)||n(!0,{path:d+"",expected:"__type",value:i}))(e,"$input",!0);const r=o.length===0;return r?{success:r,data:e}:{success:r,errors:o,data:e}}return{success:!0,data:e}}})()},{name:"update",parameters:{description:" Properties of update function",type:"object",properties:{id:{description:"Target article's {@link IBbsArticle.id}.",type:"string",format:"uuid"},input:{description:"New content to update.",$ref:"#/$defs/PartialIBbsArticle.ICreate"}},required:["id","input"],additionalProperties:!1,$defs:{"PartialIBbsArticle.ICreate":{description:"Make all properties in T optional",type:"object",properties:{title:{description:`Title of the article.
30
30
 
31
31
  Representative title of the article.`,type:"string"},body:{description:`Content body.
32
32
 
@@ -36,6 +36,6 @@ Thumbnail image URI which can represent the article.
36
36
 
37
37
  If configured as \`null\`, it means that no thumbnail image in the article.`,anyOf:[{type:"null"},{type:"string",format:"uri",contentMediaType:"image/*"}]}},required:[]}}},description:`Update an article.
38
38
 
39
- Updates an article with new content.`,validate:(()=>{const l=e=>typeof e.id=="string"&&y(e.id)&&typeof e.input=="object"&&e.input!==null&&Array.isArray(e.input)===!1&&u(e.input),u=e=>(e.title===void 0||typeof e.title=="string")&&(e.body===void 0||typeof e.body=="string")&&(e.thumbnail===null||e.thumbnail===void 0||typeof e.thumbnail=="string"&&m(e.thumbnail)),f=(e,r,i=!0)=>[typeof e.id=="string"&&(y(e.id)||n(i,{path:r+".id",expected:'string & Format<"uuid">',value:e.id}))||n(i,{path:r+".id",expected:'(string & Format<"uuid">)',value:e.id}),(typeof e.input=="object"&&e.input!==null&&Array.isArray(e.input)===!1||n(i,{path:r+".input",expected:"Partial<IBbsArticle.ICreate>",value:e.input}))&&h(e.input,r+".input",i)||n(i,{path:r+".input",expected:"Partial<IBbsArticle.ICreate>",value:e.input})].every(d=>d),h=(e,r,i=!0)=>[e.title===void 0||typeof e.title=="string"||n(i,{path:r+".title",expected:"(string | undefined)",value:e.title}),e.body===void 0||typeof e.body=="string"||n(i,{path:r+".body",expected:"(string | undefined)",value:e.body}),e.thumbnail===null||e.thumbnail===void 0||typeof e.thumbnail=="string"&&(m(e.thumbnail)||n(i,{path:r+".thumbnail",expected:'string & Format<"uri">',value:e.thumbnail}))||n(i,{path:r+".thumbnail",expected:'((string & Format<"uri"> & ContentMediaType<"image/*">) | null | undefined)',value:e.thumbnail})].every(d=>d),p=e=>typeof e=="object"&&e!==null&&l(e);let o,n;return e=>{if(p(e)===!1){o=[],n=_(o),((i,d,C=!0)=>(typeof i=="object"&&i!==null||n(!0,{path:d+"",expected:"__type",value:i}))&&f(i,d+"",!0)||n(!0,{path:d+"",expected:"__type",value:i}))(e,"$input",!0);const r=o.length===0;return r?{success:r,data:e}:{success:r,errors:o,data:e}}return{success:!0,data:e}}})()},{name:"erase",parameters:{description:" Properties of erase function",type:"object",properties:{id:{description:"Target article's {@link IBbsArticle.id}.",type:"string",format:"uuid"}},required:["id"],additionalProperties:!1,$defs:{}},description:`Erase an article.
39
+ Updates an article with new content.`,validate:(()=>{const l=e=>typeof e.id=="string"&&y(e.id)&&typeof e.input=="object"&&e.input!==null&&Array.isArray(e.input)===!1&&u(e.input),u=e=>(e.title===void 0||typeof e.title=="string")&&(e.body===void 0||typeof e.body=="string")&&(e.thumbnail===null||e.thumbnail===void 0||typeof e.thumbnail=="string"&&m(e.thumbnail)),p=(e,r,i=!0)=>[typeof e.id=="string"&&(y(e.id)||n(i,{path:r+".id",expected:'string & Format<"uuid">',value:e.id}))||n(i,{path:r+".id",expected:'(string & Format<"uuid">)',value:e.id}),(typeof e.input=="object"&&e.input!==null&&Array.isArray(e.input)===!1||n(i,{path:r+".input",expected:"Partial<IBbsArticle.ICreate>",value:e.input}))&&h(e.input,r+".input",i)||n(i,{path:r+".input",expected:"Partial<IBbsArticle.ICreate>",value:e.input})].every(d=>d),h=(e,r,i=!0)=>[e.title===void 0||typeof e.title=="string"||n(i,{path:r+".title",expected:"(string | undefined)",value:e.title}),e.body===void 0||typeof e.body=="string"||n(i,{path:r+".body",expected:"(string | undefined)",value:e.body}),e.thumbnail===null||e.thumbnail===void 0||typeof e.thumbnail=="string"&&(m(e.thumbnail)||n(i,{path:r+".thumbnail",expected:'string & Format<"uri">',value:e.thumbnail}))||n(i,{path:r+".thumbnail",expected:'((string & Format<"uri"> & ContentMediaType<"image/*">) | null | undefined)',value:e.thumbnail})].every(d=>d),f=e=>typeof e=="object"&&e!==null&&l(e);let o,n;return e=>{if(f(e)===!1){o=[],n=_(o),((i,d,C=!0)=>(typeof i=="object"&&i!==null||n(!0,{path:d+"",expected:"__type",value:i}))&&p(i,d+"",!0)||n(!0,{path:d+"",expected:"__type",value:i}))(e,"$input",!0);const r=o.length===0;return r?{success:r,data:e}:{success:r,errors:o,data:e}}return{success:!0,data:e}}})()},{name:"erase",parameters:{description:" Properties of erase function",type:"object",properties:{id:{description:"Target article's {@link IBbsArticle.id}.",type:"string",format:"uuid"}},required:["id"],additionalProperties:!1,$defs:{}},description:`Erase an article.
40
40
 
41
- Erases an article from the DB.`,validate:(()=>{const l=o=>typeof o.id=="string"&&y(o.id),u=(o,n,e=!0)=>[typeof o.id=="string"&&(y(o.id)||p(e,{path:n+".id",expected:'string & Format<"uuid">',value:o.id}))||p(e,{path:n+".id",expected:'(string & Format<"uuid">)',value:o.id})].every(r=>r),f=o=>typeof o=="object"&&o!==null&&l(o);let h,p;return o=>{if(f(o)===!1){h=[],p=_(h),((e,r,i=!0)=>(typeof e=="object"&&e!==null||p(!0,{path:r+"",expected:"__type",value:e}))&&u(e,r+"",!0)||p(!0,{path:r+"",expected:"__type",value:e}))(o,"$input",!0);const n=h.length===0;return n?{success:n,data:o}:{success:n,errors:h,data:o}}return{success:!0,data:o}}})()}]},execute:t}],config:{locale:s.locale,timezone:s.timezone}});return c.jsx(P,{agent:a})}function Q(){const[s,t]=g.useState(j.defaultConfig()),[a,l]=g.useState(window.navigator.language),[u,f]=g.useState(!1);return c.jsx("div",{style:{width:"100%",height:"100%",overflow:u===!0?void 0:"auto"},children:u===!0?c.jsx(J,{api:new z({apiKey:s.apiKey,baseURL:s.baseURL,dangerouslyAllowBrowser:!0}),vendorModel:s.vendorModel,locale:a}):c.jsxs(O,{style:{width:"calc(100% - 60px)",padding:15,margin:15},children:[c.jsx(b,{variant:"h6",children:"BBS AI Chatbot"}),c.jsx("br",{}),c.jsx(D,{}),c.jsx("br",{}),"Demonstration of Agentica with TypeScript Controller Class.",c.jsx("br",{}),c.jsx("br",{}),c.jsx(b,{variant:"h6",children:" OpenAI Configuration "}),c.jsx("br",{}),c.jsx(j,{config:s,onChange:t}),c.jsx("br",{}),c.jsx(b,{variant:"h6",children:" Membership Information "}),c.jsx("br",{}),c.jsx(E,{onChange:h=>l(h.target.value),defaultValue:a,label:"Locale",variant:"outlined",error:a.length===0}),c.jsx("br",{}),c.jsx("br",{}),c.jsx(q,{component:"a",fullWidth:!0,variant:"contained",color:"info",size:"large",disabled:s.apiKey.length===0||s.vendorModel.length===0||a.length===0,onClick:()=>f(!0),children:"Start AI Chatbot"})]})})}A(window.document.getElementById("root")).render(c.jsx(Q,{}));
41
+ Erases an article from the DB.`,validate:(()=>{const l=o=>typeof o.id=="string"&&y(o.id),u=(o,n,e=!0)=>[typeof o.id=="string"&&(y(o.id)||f(e,{path:n+".id",expected:'string & Format<"uuid">',value:o.id}))||f(e,{path:n+".id",expected:'(string & Format<"uuid">)',value:o.id})].every(r=>r),p=o=>typeof o=="object"&&o!==null&&l(o);let h,f;return o=>{if(p(o)===!1){h=[],f=_(h),((e,r,i=!0)=>(typeof e=="object"&&e!==null||f(!0,{path:r+"",expected:"__type",value:e}))&&u(e,r+"",!0)||f(!0,{path:r+"",expected:"__type",value:e}))(o,"$input",!0);const n=h.length===0;return n?{success:n,data:o}:{success:n,errors:h,data:o}}return{success:!0,data:o}}})()}]},execute:t}],config:{locale:s.locale,timezone:s.timezone}});return c.jsx(P,{agent:a})}function Q(){const[s,t]=g.useState(j.defaultConfig()),[a,l]=g.useState(window.navigator.language),[u,p]=g.useState(!1);return c.jsx("div",{style:{width:"100%",height:"100%",overflow:u===!0?void 0:"auto"},children:u===!0?c.jsx(J,{api:new z({apiKey:s.apiKey,baseURL:s.baseURL,dangerouslyAllowBrowser:!0}),vendorModel:s.vendorModel,locale:a}):c.jsxs(O,{style:{width:"calc(100% - 60px)",padding:15,margin:15},children:[c.jsx(b,{variant:"h6",children:"BBS AI Chatbot"}),c.jsx("br",{}),c.jsx(D,{}),c.jsx("br",{}),"Demonstration of Agentica with TypeScript Controller Class.",c.jsx("br",{}),c.jsx("br",{}),c.jsx(b,{variant:"h6",children:" OpenAI Configuration "}),c.jsx("br",{}),c.jsx(j,{config:s,onChange:t}),c.jsx("br",{}),c.jsx(b,{variant:"h6",children:" Membership Information "}),c.jsx("br",{}),c.jsx(E,{onChange:h=>l(h.target.value),defaultValue:a,label:"Locale",variant:"outlined",error:a.length===0}),c.jsx("br",{}),c.jsx("br",{}),c.jsx(q,{component:"a",fullWidth:!0,variant:"contained",color:"info",size:"large",disabled:s.apiKey.length===0||s.vendorModel.length===0||a.length===0,onClick:()=>p(!0),children:"Start AI Chatbot"})]})})}A(window.document.getElementById("root")).render(c.jsx(Q,{}));