@agentica/chat 0.34.2 → 0.35.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.
Files changed (33) hide show
  1. package/dist/assets/VendorConfigurationMovie-A3EDRuuv.js +3445 -0
  2. package/dist/assets/bbs/index-DJ2TSI_V.js +41 -0
  3. package/dist/assets/shopping/index.html-DwrDQLUl.js +3 -0
  4. package/dist/assets/uploader/index.html-qTzoYxoF.js +17 -0
  5. package/dist/bbs/index.html +2 -2
  6. package/dist/shopping/index.html +2 -2
  7. package/dist/uploader/index.html +2 -2
  8. package/lib/AgenticaChatApplication.d.ts +3 -4
  9. package/lib/examples/bbs/BbsChatApplication.d.ts +0 -2
  10. package/lib/examples/common/VendorConfigurationMovie.d.ts +0 -2
  11. package/lib/examples/shopping/ShoppingChatApplication.d.ts +1 -2
  12. package/lib/index.mjs +0 -3
  13. package/lib/index.mjs.map +1 -1
  14. package/lib/movies/AgenticaChatMovie.d.ts +3 -4
  15. package/lib/movies/messages/AgenticaChatDescribeMessageMovie.d.ts +3 -4
  16. package/lib/movies/messages/AgenticaChatExecuteMessageMovie.d.ts +3 -4
  17. package/lib/movies/messages/AgenticaChatMessageMovie.d.ts +3 -4
  18. package/lib/movies/messages/AgenticaChatSelectMessageMovie.d.ts +3 -4
  19. package/lib/movies/sides/AgenticaChatFunctionStackSideMovie.d.ts +3 -4
  20. package/lib/movies/sides/AgenticaChatSideMovie.d.ts +4 -6
  21. package/package.json +7 -7
  22. package/src/AgenticaChatApplication.tsx +3 -4
  23. package/src/movies/AgenticaChatMovie.tsx +11 -13
  24. package/src/movies/messages/AgenticaChatDescribeMessageMovie.tsx +4 -7
  25. package/src/movies/messages/AgenticaChatExecuteMessageMovie.tsx +5 -8
  26. package/src/movies/messages/AgenticaChatMessageMovie.tsx +4 -5
  27. package/src/movies/messages/AgenticaChatSelectMessageMovie.tsx +4 -5
  28. package/src/movies/sides/AgenticaChatFunctionStackSideMovie.tsx +5 -6
  29. package/src/movies/sides/AgenticaChatSideMovie.tsx +4 -11
  30. package/dist/assets/VendorConfigurationMovie-RyNqJgVh.js +0 -3472
  31. package/dist/assets/bbs/index-Cm56m_DU.js +0 -257
  32. package/dist/assets/shopping/index.html-CWl5SH2s.js +0 -3
  33. package/dist/assets/uploader/index.html-Yr3xbsVI.js +0 -17
@@ -1,257 +0,0 @@
1
- import{j as m,o as j,r as b,T as g}from"../client-B3aq8qpT.js";import{q as T,t as _,r as v,s as x,w as $,x as P,y as U,z as R,E as F,v as k,d as M,_ as y,V as w,c as S,F as q,T as D,B as O}from"../VendorConfigurationMovie-RyNqJgVh.js";import{D as L}from"../Divider-DX1xhf0M.js";class I{constructor(o){this.props=o,this.operations_=T.compose({controllers:o.controllers,config:o.config}),this.histories_=(o.histories??[]).map(s=>_({operations:this.operations_.group,history:s})),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_=o.vendor.semaphore!=null?typeof o.vendor.semaphore=="object"?o.vendor.semaphore:new x(o.vendor.semaphore):null}clone(){var o;return new I({...this.props,histories:(o=this.props.histories)==null?void 0:o.slice()})}async conversate(o,s={}){var i,n,f,C;const l=[],c=async h=>{try{await this.dispatch(h),"toHistory"in h&&("join"in h?l.push(async()=>(await h.join(),h.toHistory())):l.push(async()=>h.toHistory()))}catch{}},a=$({contents:Array.isArray(o)?o:typeof o=="string"?[{type:"text",text:o}]:[o]});c(a).catch(()=>{});const r=this.getContext({prompt:a,dispatch:c,usage:this.token_usage_,abortSignal:s.abortSignal}),e=await P(r,this.operations_.array);e.length&&((n=(i=this.props.config)==null?void 0:i.executor)==null?void 0:n.describe)!==null&&((C=(f=this.props.config)==null?void 0:f.executor)==null?void 0:C.describe)!==!1&&await U(r,e);const t=await Promise.all(l.map(async h=>h()));return this.histories_.push(...t),t}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(o){const s=R({vendor:this.props.vendor,config:this.props.config,dispatch:o.dispatch,abortSignal:o.abortSignal,usage:this.token_usage_});return{operations:this.operations_,config:this.props.config,histories:this.histories_,prompt:o.prompt,dispatch:o.dispatch,request:this.semaphore_===null?s:async(l,c)=>{await this.semaphore_.acquire();try{return await s(l,c)}finally{this.semaphore_.release().catch(()=>{})}}}}on(o,s){return F(this.listeners_,o,()=>new Set).add(s),this}off(o,s){const l=this.listeners_.get(o);return l!==void 0&&(l.delete(s),l.size===0&&this.listeners_.delete(o)),this}async dispatch(o){const s=this.listeners_.get(o.type);s!==void 0&&await Promise.all(Array.from(s).map(async l=>{try{await l(o)}catch{}}))}}var B={};Object.defineProperty(B,"__esModule",{value:!0});var u=B._isFormatUri=void 0;const E=d=>z.test(d)&&K.test(d);u=B._isFormatUri=E;const z=/\/|:/,K=/^(?:[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 A={};Object.defineProperty(A,"__esModule",{value:!0});var p=A._isFormatUuid=void 0;const N=d=>W.test(d);p=A._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(o){const s={id:k(),title:o.input.title,body:o.input.body,thumbnail:o.input.thumbnail,created_at:new Date().toISOString(),updated_at:new Date().toISOString()};return this.articles.push(s),s}update(o){const s=this.articles.find(l=>l.id===o.id);if(s===void 0)throw new Error("Unable to find the matched article.");o.input.title!==void 0&&(s.title=o.input.title),o.input.body!==void 0&&(s.body=o.input.body),o.input.thumbnail!==void 0&&(s.thumbnail=o.input.thumbnail),s.updated_at=new Date().toISOString()}erase(o){const s=this.articles.findIndex(l=>l.id===o.id);if(s===-1)throw new Error("Unable to find the matched article.");this.articles.splice(s,1)}}const H={chatgpt:{model:"chatgpt",options:{reference:!0,strict:!1,separate: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.
2
-
3
-
4
- @format uuid`,type:"string"},created_at:{description:`Creation time of the article.
5
-
6
-
7
- @format date-time`,type:"string"},updated_at:{description:`Last updated time of the article.
8
-
9
-
10
- @format date-time`,type:"string"},title:{description:`Title of the article.
11
-
12
- Representative title of the article.`,type:"string"},body:{description:`Content body.
13
-
14
- Content body of the article writtn in the markdown format.`,type:"string"},thumbnail:{description:`Thumbnail image URI.
15
-
16
- Thumbnail image URI which can represent the article.
17
-
18
- If configured as \`null\`, it means that no thumbnail image in the article.`,anyOf:[{type:"null"},{type:"string",description:`@format uri
19
- @contentMediaType image/*`}]}},required:["id","created_at","updated_at","title","body","thumbnail"]}}},output:{type:"array",items:{$ref:"#/$defs/IBbsArticle"}},description:`Get all articles.
20
-
21
- List up every articles archived in the BBS DB.`,validate:d=>({success:!0,data:d})},{name:"create",parameters:{description:" Properties of create function",type:"object",properties:{input:{description:"Information of the article to create",$ref:"#/$defs/IBbsArticle.ICreate"}},required:["input"],additionalProperties:!1,$defs:{"IBbsArticle.ICreate":{description:"Information of the article to create.",type:"object",properties:{title:{description:`Title of the article.
22
-
23
- Representative title of the article.`,type:"string"},body:{description:`Content body.
24
-
25
- Content body of the article writtn in the markdown format.`,type:"string"},thumbnail:{description:`Thumbnail image URI.
26
-
27
- Thumbnail image URI which can represent the article.
28
-
29
- If configured as \`null\`, it means that no thumbnail image in the article.`,anyOf:[{type:"null"},{type:"string",description:`@format uri
30
- @contentMediaType image/*`}]}},required:["title","body","thumbnail"]},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.
31
-
32
-
33
- @format uuid`,type:"string"},created_at:{description:`Creation time of the article.
34
-
35
-
36
- @format date-time`,type:"string"},updated_at:{description:`Last updated time of the article.
37
-
38
-
39
- @format date-time`,type:"string"},title:{description:`Title of the article.
40
-
41
- Representative title of the article.`,type:"string"},body:{description:`Content body.
42
-
43
- Content body of the article writtn in the markdown format.`,type:"string"},thumbnail:{description:`Thumbnail image URI.
44
-
45
- Thumbnail image URI which can represent the article.
46
-
47
- If configured as \`null\`, it means that no thumbnail image in the article.`,anyOf:[{type:"null"},{type:"string",description:`@format uri
48
- @contentMediaType image/*`}]}},required:["id","created_at","updated_at","title","body","thumbnail"]}}},output:{$ref:"#/$defs/IBbsArticle"},description:`Create a new article.
49
-
50
- Writes a new article and archives it into the DB.`,validate:(()=>{const d=e=>typeof e.input=="object"&&e.input!==null&&o(e.input),o=e=>typeof e.title=="string"&&typeof e.body=="string"&&(e.thumbnail===null||typeof e.thumbnail=="string"&&u(e.thumbnail)),s=(e,t,i=!0)=>[(typeof e.input=="object"&&e.input!==null||r(i,{path:t+".input",expected:"IBbsArticle.ICreate",value:e.input}))&&l(e.input,t+".input",i)||r(i,{path:t+".input",expected:"IBbsArticle.ICreate",value:e.input})].every(n=>n),l=(e,t,i=!0)=>[typeof e.title=="string"||r(i,{path:t+".title",expected:"string",value:e.title}),typeof e.body=="string"||r(i,{path:t+".body",expected:"string",value:e.body}),e.thumbnail===null||typeof e.thumbnail=="string"&&(u(e.thumbnail)||r(i,{path:t+".thumbnail",expected:'string & Format<"uri">',value:e.thumbnail}))||r(i,{path:t+".thumbnail",expected:'((string & Format<"uri"> & ContentMediaType<"image/*">) | null)',value:e.thumbnail})].every(n=>n),c=e=>typeof e=="object"&&e!==null&&d(e);let a,r;return e=>{if(c(e)===!1){a=[],r=y(a),((i,n,f=!0)=>(typeof i=="object"&&i!==null||r(!0,{path:n+"",expected:"__type",value:i}))&&s(i,n+"",!0)||r(!0,{path:n+"",expected:"__type",value:i}))(e,"$input",!0);const t=a.length===0;return t?{success:t,data:e}:{success:t,errors:a,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}.
51
-
52
-
53
- @format uuid`,type:"string"},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.
54
-
55
- Representative title of the article.`,type:"string"},body:{description:`Content body.
56
-
57
- Content body of the article writtn in the markdown format.`,type:"string"},thumbnail:{description:`Thumbnail image URI.
58
-
59
- Thumbnail image URI which can represent the article.
60
-
61
- If configured as \`null\`, it means that no thumbnail image in the article.`,anyOf:[{type:"null"},{type:"string",description:`@format uri
62
- @contentMediaType image/*`}]}},required:[]}}},description:`Update an article.
63
-
64
- Updates an article with new content.`,validate:(()=>{const d=e=>typeof e.id=="string"&&p(e.id)&&typeof e.input=="object"&&e.input!==null&&Array.isArray(e.input)===!1&&o(e.input),o=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"&&u(e.thumbnail)),s=(e,t,i=!0)=>[typeof e.id=="string"&&(p(e.id)||r(i,{path:t+".id",expected:'string & Format<"uuid">',value:e.id}))||r(i,{path:t+".id",expected:'(string & Format<"uuid">)',value:e.id}),(typeof e.input=="object"&&e.input!==null&&Array.isArray(e.input)===!1||r(i,{path:t+".input",expected:"Partial<IBbsArticle.ICreate>",value:e.input}))&&l(e.input,t+".input",i)||r(i,{path:t+".input",expected:"Partial<IBbsArticle.ICreate>",value:e.input})].every(n=>n),l=(e,t,i=!0)=>[e.title===void 0||typeof e.title=="string"||r(i,{path:t+".title",expected:"(string | undefined)",value:e.title}),e.body===void 0||typeof e.body=="string"||r(i,{path:t+".body",expected:"(string | undefined)",value:e.body}),e.thumbnail===null||e.thumbnail===void 0||typeof e.thumbnail=="string"&&(u(e.thumbnail)||r(i,{path:t+".thumbnail",expected:'string & Format<"uri">',value:e.thumbnail}))||r(i,{path:t+".thumbnail",expected:'((string & Format<"uri"> & ContentMediaType<"image/*">) | null | undefined)',value:e.thumbnail})].every(n=>n),c=e=>typeof e=="object"&&e!==null&&d(e);let a,r;return e=>{if(c(e)===!1){a=[],r=y(a),((i,n,f=!0)=>(typeof i=="object"&&i!==null||r(!0,{path:n+"",expected:"__type",value:i}))&&s(i,n+"",!0)||r(!0,{path:n+"",expected:"__type",value:i}))(e,"$input",!0);const t=a.length===0;return t?{success:t,data:e}:{success:t,errors:a,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}.
65
-
66
-
67
- @format uuid`,type:"string"}},required:["id"],additionalProperties:!1,$defs:{}},description:`Erase an article.
68
-
69
- Erases an article from the DB.`,validate:(()=>{const d=a=>typeof a.id=="string"&&p(a.id),o=(a,r,e=!0)=>[typeof a.id=="string"&&(p(a.id)||c(e,{path:r+".id",expected:'string & Format<"uuid">',value:a.id}))||c(e,{path:r+".id",expected:'(string & Format<"uuid">)',value:a.id})].every(t=>t),s=a=>typeof a=="object"&&a!==null&&d(a);let l,c;return a=>{if(s(a)===!1){l=[],c=y(l),((e,t,i=!0)=>(typeof e=="object"&&e!==null||c(!0,{path:t+"",expected:"__type",value:e}))&&o(e,t+"",!0)||c(!0,{path:t+"",expected:"__type",value:e}))(a,"$input",!0);const r=l.length===0;return r?{success:r,data:a}:{success:r,errors:l,data:a}}return{success:!0,data:a}}})()}]},claude:{model:"claude",options:{reference:!0,separate: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.
70
-
71
- Representative title of the article.`,type:"string"},body:{description:`Content body.
72
-
73
- Content body of the article writtn in the markdown format.`,type:"string"},thumbnail:{description:`Thumbnail image URI.
74
-
75
- Thumbnail image URI which can represent the article.
76
-
77
- If configured as \`null\`, it means that no thumbnail image in the article.`,oneOf:[{type:"null"},{type:"string",format:"uri",contentMediaType:"image/*"}]}},required:["id","created_at","updated_at","title","body","thumbnail"]}}},output:{description:"List of every articles",type:"array",items:{$ref:"#/$defs/IBbsArticle"}},description:`Get all articles.
78
-
79
- List up every articles archived in the BBS DB.`,validate:d=>({success:!0,data:d})},{name:"create",parameters:{description:" Properties of create function",type:"object",properties:{input:{description:"Information of the article to create",$ref:"#/$defs/IBbsArticle.ICreate"}},required:["input"],additionalProperties:!1,$defs:{"IBbsArticle.ICreate":{description:"Information of the article to create.",type:"object",properties:{title:{description:`Title of the article.
80
-
81
- Representative title of the article.`,type:"string"},body:{description:`Content body.
82
-
83
- Content body of the article writtn in the markdown format.`,type:"string"},thumbnail:{description:`Thumbnail image URI.
84
-
85
- Thumbnail image URI which can represent the article.
86
-
87
- If configured as \`null\`, it means that no thumbnail image in the article.`,oneOf:[{type:"null"},{type:"string",format:"uri",contentMediaType:"image/*"}]}},required:["title","body","thumbnail"]},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.
88
-
89
- Representative title of the article.`,type:"string"},body:{description:`Content body.
90
-
91
- Content body of the article writtn in the markdown format.`,type:"string"},thumbnail:{description:`Thumbnail image URI.
92
-
93
- Thumbnail image URI which can represent the article.
94
-
95
- If configured as \`null\`, it means that no thumbnail image in the article.`,oneOf:[{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.
96
-
97
- Writes a new article and archives it into the DB.`,validate:(()=>{const d=e=>typeof e.input=="object"&&e.input!==null&&o(e.input),o=e=>typeof e.title=="string"&&typeof e.body=="string"&&(e.thumbnail===null||typeof e.thumbnail=="string"&&u(e.thumbnail)),s=(e,t,i=!0)=>[(typeof e.input=="object"&&e.input!==null||r(i,{path:t+".input",expected:"IBbsArticle.ICreate",value:e.input}))&&l(e.input,t+".input",i)||r(i,{path:t+".input",expected:"IBbsArticle.ICreate",value:e.input})].every(n=>n),l=(e,t,i=!0)=>[typeof e.title=="string"||r(i,{path:t+".title",expected:"string",value:e.title}),typeof e.body=="string"||r(i,{path:t+".body",expected:"string",value:e.body}),e.thumbnail===null||typeof e.thumbnail=="string"&&(u(e.thumbnail)||r(i,{path:t+".thumbnail",expected:'string & Format<"uri">',value:e.thumbnail}))||r(i,{path:t+".thumbnail",expected:'((string & Format<"uri"> & ContentMediaType<"image/*">) | null)',value:e.thumbnail})].every(n=>n),c=e=>typeof e=="object"&&e!==null&&d(e);let a,r;return e=>{if(c(e)===!1){a=[],r=y(a),((i,n,f=!0)=>(typeof i=="object"&&i!==null||r(!0,{path:n+"",expected:"__type",value:i}))&&s(i,n+"",!0)||r(!0,{path:n+"",expected:"__type",value:i}))(e,"$input",!0);const t=a.length===0;return t?{success:t,data:e}:{success:t,errors:a,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.
98
-
99
- Representative title of the article.`,type:"string"},body:{description:`Content body.
100
-
101
- Content body of the article writtn in the markdown format.`,type:"string"},thumbnail:{description:`Thumbnail image URI.
102
-
103
- Thumbnail image URI which can represent the article.
104
-
105
- If configured as \`null\`, it means that no thumbnail image in the article.`,oneOf:[{type:"null"},{type:"string",format:"uri",contentMediaType:"image/*"}]}},required:[]}}},description:`Update an article.
106
-
107
- Updates an article with new content.`,validate:(()=>{const d=e=>typeof e.id=="string"&&p(e.id)&&typeof e.input=="object"&&e.input!==null&&Array.isArray(e.input)===!1&&o(e.input),o=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"&&u(e.thumbnail)),s=(e,t,i=!0)=>[typeof e.id=="string"&&(p(e.id)||r(i,{path:t+".id",expected:'string & Format<"uuid">',value:e.id}))||r(i,{path:t+".id",expected:'(string & Format<"uuid">)',value:e.id}),(typeof e.input=="object"&&e.input!==null&&Array.isArray(e.input)===!1||r(i,{path:t+".input",expected:"Partial<IBbsArticle.ICreate>",value:e.input}))&&l(e.input,t+".input",i)||r(i,{path:t+".input",expected:"Partial<IBbsArticle.ICreate>",value:e.input})].every(n=>n),l=(e,t,i=!0)=>[e.title===void 0||typeof e.title=="string"||r(i,{path:t+".title",expected:"(string | undefined)",value:e.title}),e.body===void 0||typeof e.body=="string"||r(i,{path:t+".body",expected:"(string | undefined)",value:e.body}),e.thumbnail===null||e.thumbnail===void 0||typeof e.thumbnail=="string"&&(u(e.thumbnail)||r(i,{path:t+".thumbnail",expected:'string & Format<"uri">',value:e.thumbnail}))||r(i,{path:t+".thumbnail",expected:'((string & Format<"uri"> & ContentMediaType<"image/*">) | null | undefined)',value:e.thumbnail})].every(n=>n),c=e=>typeof e=="object"&&e!==null&&d(e);let a,r;return e=>{if(c(e)===!1){a=[],r=y(a),((i,n,f=!0)=>(typeof i=="object"&&i!==null||r(!0,{path:n+"",expected:"__type",value:i}))&&s(i,n+"",!0)||r(!0,{path:n+"",expected:"__type",value:i}))(e,"$input",!0);const t=a.length===0;return t?{success:t,data:e}:{success:t,errors:a,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.
108
-
109
- Erases an article from the DB.`,validate:(()=>{const d=a=>typeof a.id=="string"&&p(a.id),o=(a,r,e=!0)=>[typeof a.id=="string"&&(p(a.id)||c(e,{path:r+".id",expected:'string & Format<"uuid">',value:a.id}))||c(e,{path:r+".id",expected:'(string & Format<"uuid">)',value:a.id})].every(t=>t),s=a=>typeof a=="object"&&a!==null&&d(a);let l,c;return a=>{if(s(a)===!1){l=[],c=y(l),((e,t,i=!0)=>(typeof e=="object"&&e!==null||c(!0,{path:t+"",expected:"__type",value:e}))&&o(e,t+"",!0)||c(!0,{path:t+"",expected:"__type",value:e}))(a,"$input",!0);const r=l.length===0;return r?{success:r,data:a}:{success:r,errors:l,data:a}}return{success:!0,data:a}}})()}]},gemini:{model:"gemini",options:{reference:!0,separate: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.
110
-
111
- Representative title of the article.`,type:"string"},body:{description:`Content body.
112
-
113
- Content body of the article writtn in the markdown format.`,type:"string"},thumbnail:{description:`Thumbnail image URI.
114
-
115
- Thumbnail image URI which can represent the article.
116
-
117
- 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:{description:"List of every articles",type:"array",items:{$ref:"#/$defs/IBbsArticle"}},description:`Get all articles.
118
-
119
- List up every articles archived in the BBS DB.`,validate:d=>({success:!0,data:d})},{name:"create",parameters:{description:" Properties of create function",type:"object",properties:{input:{description:"Information of the article to create",$ref:"#/$defs/IBbsArticle.ICreate"}},required:["input"],additionalProperties:!1,$defs:{"IBbsArticle.ICreate":{description:"Information of the article to create.",type:"object",properties:{title:{description:`Title of the article.
120
-
121
- Representative title of the article.`,type:"string"},body:{description:`Content body.
122
-
123
- Content body of the article writtn in the markdown format.`,type:"string"},thumbnail:{description:`Thumbnail image URI.
124
-
125
- Thumbnail image URI which can represent the article.
126
-
127
- If configured as \`null\`, it means that no thumbnail image in the article.`,anyOf:[{type:"null"},{type:"string",format:"uri",contentMediaType:"image/*"}]}},required:["title","body","thumbnail"]},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.
128
-
129
- Representative title of the article.`,type:"string"},body:{description:`Content body.
130
-
131
- Content body of the article writtn in the markdown format.`,type:"string"},thumbnail:{description:`Thumbnail image URI.
132
-
133
- Thumbnail image URI which can represent the article.
134
-
135
- 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.
136
-
137
- Writes a new article and archives it into the DB.`,validate:(()=>{const d=e=>typeof e.input=="object"&&e.input!==null&&o(e.input),o=e=>typeof e.title=="string"&&typeof e.body=="string"&&(e.thumbnail===null||typeof e.thumbnail=="string"&&u(e.thumbnail)),s=(e,t,i=!0)=>[(typeof e.input=="object"&&e.input!==null||r(i,{path:t+".input",expected:"IBbsArticle.ICreate",value:e.input}))&&l(e.input,t+".input",i)||r(i,{path:t+".input",expected:"IBbsArticle.ICreate",value:e.input})].every(n=>n),l=(e,t,i=!0)=>[typeof e.title=="string"||r(i,{path:t+".title",expected:"string",value:e.title}),typeof e.body=="string"||r(i,{path:t+".body",expected:"string",value:e.body}),e.thumbnail===null||typeof e.thumbnail=="string"&&(u(e.thumbnail)||r(i,{path:t+".thumbnail",expected:'string & Format<"uri">',value:e.thumbnail}))||r(i,{path:t+".thumbnail",expected:'((string & Format<"uri"> & ContentMediaType<"image/*">) | null)',value:e.thumbnail})].every(n=>n),c=e=>typeof e=="object"&&e!==null&&d(e);let a,r;return e=>{if(c(e)===!1){a=[],r=y(a),((i,n,f=!0)=>(typeof i=="object"&&i!==null||r(!0,{path:n+"",expected:"__type",value:i}))&&s(i,n+"",!0)||r(!0,{path:n+"",expected:"__type",value:i}))(e,"$input",!0);const t=a.length===0;return t?{success:t,data:e}:{success:t,errors:a,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.
138
-
139
- Representative title of the article.`,type:"string"},body:{description:`Content body.
140
-
141
- Content body of the article writtn in the markdown format.`,type:"string"},thumbnail:{description:`Thumbnail image URI.
142
-
143
- Thumbnail image URI which can represent the article.
144
-
145
- 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.
146
-
147
- Updates an article with new content.`,validate:(()=>{const d=e=>typeof e.id=="string"&&p(e.id)&&typeof e.input=="object"&&e.input!==null&&Array.isArray(e.input)===!1&&o(e.input),o=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"&&u(e.thumbnail)),s=(e,t,i=!0)=>[typeof e.id=="string"&&(p(e.id)||r(i,{path:t+".id",expected:'string & Format<"uuid">',value:e.id}))||r(i,{path:t+".id",expected:'(string & Format<"uuid">)',value:e.id}),(typeof e.input=="object"&&e.input!==null&&Array.isArray(e.input)===!1||r(i,{path:t+".input",expected:"Partial<IBbsArticle.ICreate>",value:e.input}))&&l(e.input,t+".input",i)||r(i,{path:t+".input",expected:"Partial<IBbsArticle.ICreate>",value:e.input})].every(n=>n),l=(e,t,i=!0)=>[e.title===void 0||typeof e.title=="string"||r(i,{path:t+".title",expected:"(string | undefined)",value:e.title}),e.body===void 0||typeof e.body=="string"||r(i,{path:t+".body",expected:"(string | undefined)",value:e.body}),e.thumbnail===null||e.thumbnail===void 0||typeof e.thumbnail=="string"&&(u(e.thumbnail)||r(i,{path:t+".thumbnail",expected:'string & Format<"uri">',value:e.thumbnail}))||r(i,{path:t+".thumbnail",expected:'((string & Format<"uri"> & ContentMediaType<"image/*">) | null | undefined)',value:e.thumbnail})].every(n=>n),c=e=>typeof e=="object"&&e!==null&&d(e);let a,r;return e=>{if(c(e)===!1){a=[],r=y(a),((i,n,f=!0)=>(typeof i=="object"&&i!==null||r(!0,{path:n+"",expected:"__type",value:i}))&&s(i,n+"",!0)||r(!0,{path:n+"",expected:"__type",value:i}))(e,"$input",!0);const t=a.length===0;return t?{success:t,data:e}:{success:t,errors:a,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.
148
-
149
- Erases an article from the DB.`,validate:(()=>{const d=a=>typeof a.id=="string"&&p(a.id),o=(a,r,e=!0)=>[typeof a.id=="string"&&(p(a.id)||c(e,{path:r+".id",expected:'string & Format<"uuid">',value:a.id}))||c(e,{path:r+".id",expected:'(string & Format<"uuid">)',value:a.id})].every(t=>t),s=a=>typeof a=="object"&&a!==null&&d(a);let l,c;return a=>{if(s(a)===!1){l=[],c=y(l),((e,t,i=!0)=>(typeof e=="object"&&e!==null||c(!0,{path:t+"",expected:"__type",value:e}))&&o(e,t+"",!0)||c(!0,{path:t+"",expected:"__type",value:e}))(a,"$input",!0);const r=l.length===0;return r?{success:r,data:a}:{success:r,errors:l,data:a}}return{success:!0,data:a}}})()}]},"3.0":{model:"3.0",options:{recursive:3,constraint:!0,separate:null},functions:[{name:"index",parameters:{type:"object",properties:{},additionalProperties:!1,required:[]},output:{type:"array",items:{type:"object",properties:{id:{type:"string",format:"uuid",description:"Primary Key."},created_at:{type:"string",format:"date-time",description:"Creation time of the article."},updated_at:{type:"string",format:"date-time",description:"Last updated time of the article."},title:{type:"string",description:`Title of the article.
150
-
151
- Representative title of the article.`},body:{type:"string",description:`Content body.
152
-
153
- Content body of the article writtn in the markdown format.`},thumbnail:{type:"string",format:"uri",contentMediaType:"image/*",nullable:!0,description:`Thumbnail image URI.
154
-
155
- Thumbnail image URI which can represent the article.
156
-
157
- If configured as \`null\`, it means that no thumbnail image in the article.`}},required:["id","created_at","updated_at","title","body","thumbnail"],description:`Description of the current {@link IBbsArticle} type:
158
-
159
- > Article entity.
160
- >
161
- > \`IBbsArticle\` is an entity representing an article in the BBS (Bulletin Board System).`,additionalProperties:!1},description:"List of every articles"},description:`Get all articles.
162
-
163
- List up every articles archived in the BBS DB.`,validate:d=>({success:!0,data:d})},{name:"create",parameters:{type:"object",properties:{input:{type:"object",properties:{title:{type:"string",description:`Title of the article.
164
-
165
- Representative title of the article.`},body:{type:"string",description:`Content body.
166
-
167
- Content body of the article writtn in the markdown format.`},thumbnail:{type:"string",format:"uri",contentMediaType:"image/*",nullable:!0,description:`Thumbnail image URI.
168
-
169
- Thumbnail image URI which can represent the article.
170
-
171
- If configured as \`null\`, it means that no thumbnail image in the article.`}},required:["title","body","thumbnail"],description:`Information of the article to create
172
-
173
- ------------------------------
174
-
175
- Description of the current {@link IBbsArticle.ICreate} type:
176
-
177
- > Information of the article to create.
178
-
179
- ------------------------------
180
-
181
- Description of the parent {@link IBbsArticle} type:
182
-
183
- > Article entity.
184
- >
185
- > \`IBbsArticle\` is an entity representing an article in the BBS (Bulletin Board System).`,additionalProperties:!1}},required:["input"],description:" Properties of create function",additionalProperties:!1},output:{type:"object",properties:{id:{type:"string",format:"uuid",description:"Primary Key."},created_at:{type:"string",format:"date-time",description:"Creation time of the article."},updated_at:{type:"string",format:"date-time",description:"Last updated time of the article."},title:{type:"string",description:`Title of the article.
186
-
187
- Representative title of the article.`},body:{type:"string",description:`Content body.
188
-
189
- Content body of the article writtn in the markdown format.`},thumbnail:{type:"string",format:"uri",contentMediaType:"image/*",nullable:!0,description:`Thumbnail image URI.
190
-
191
- Thumbnail image URI which can represent the article.
192
-
193
- If configured as \`null\`, it means that no thumbnail image in the article.`}},required:["id","created_at","updated_at","title","body","thumbnail"],description:`Description of the current {@link IBbsArticle} type:
194
-
195
- > Article entity.
196
- >
197
- > \`IBbsArticle\` is an entity representing an article in the BBS (Bulletin Board System).`,additionalProperties:!1},description:`Create a new article.
198
-
199
- Writes a new article and archives it into the DB.`,validate:(()=>{const d=e=>typeof e.input=="object"&&e.input!==null&&o(e.input),o=e=>typeof e.title=="string"&&typeof e.body=="string"&&(e.thumbnail===null||typeof e.thumbnail=="string"&&u(e.thumbnail)),s=(e,t,i=!0)=>[(typeof e.input=="object"&&e.input!==null||r(i,{path:t+".input",expected:"IBbsArticle.ICreate",value:e.input}))&&l(e.input,t+".input",i)||r(i,{path:t+".input",expected:"IBbsArticle.ICreate",value:e.input})].every(n=>n),l=(e,t,i=!0)=>[typeof e.title=="string"||r(i,{path:t+".title",expected:"string",value:e.title}),typeof e.body=="string"||r(i,{path:t+".body",expected:"string",value:e.body}),e.thumbnail===null||typeof e.thumbnail=="string"&&(u(e.thumbnail)||r(i,{path:t+".thumbnail",expected:'string & Format<"uri">',value:e.thumbnail}))||r(i,{path:t+".thumbnail",expected:'((string & Format<"uri"> & ContentMediaType<"image/*">) | null)',value:e.thumbnail})].every(n=>n),c=e=>typeof e=="object"&&e!==null&&d(e);let a,r;return e=>{if(c(e)===!1){a=[],r=y(a),((i,n,f=!0)=>(typeof i=="object"&&i!==null||r(!0,{path:n+"",expected:"__type",value:i}))&&s(i,n+"",!0)||r(!0,{path:n+"",expected:"__type",value:i}))(e,"$input",!0);const t=a.length===0;return t?{success:t,data:e}:{success:t,errors:a,data:e}}return{success:!0,data:e}}})()},{name:"update",parameters:{type:"object",properties:{id:{type:"string",format:"uuid",description:"Target article's {@link IBbsArticle.id}."},input:{type:"object",properties:{title:{type:"string",description:`Title of the article.
200
-
201
- Representative title of the article.`},body:{type:"string",description:`Content body.
202
-
203
- Content body of the article writtn in the markdown format.`},thumbnail:{type:"string",format:"uri",contentMediaType:"image/*",nullable:!0,description:`Thumbnail image URI.
204
-
205
- Thumbnail image URI which can represent the article.
206
-
207
- If configured as \`null\`, it means that no thumbnail image in the article.`}},required:[],description:`New content to update.
208
-
209
- ------------------------------
210
-
211
- Description of the current {@link PartialIBbsArticle.ICreate} type:
212
-
213
- > Make all properties in T optional`,additionalProperties:!1}},required:["id","input"],description:" Properties of update function",additionalProperties:!1},description:`Update an article.
214
-
215
- Updates an article with new content.`,validate:(()=>{const d=e=>typeof e.id=="string"&&p(e.id)&&typeof e.input=="object"&&e.input!==null&&Array.isArray(e.input)===!1&&o(e.input),o=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"&&u(e.thumbnail)),s=(e,t,i=!0)=>[typeof e.id=="string"&&(p(e.id)||r(i,{path:t+".id",expected:'string & Format<"uuid">',value:e.id}))||r(i,{path:t+".id",expected:'(string & Format<"uuid">)',value:e.id}),(typeof e.input=="object"&&e.input!==null&&Array.isArray(e.input)===!1||r(i,{path:t+".input",expected:"Partial<IBbsArticle.ICreate>",value:e.input}))&&l(e.input,t+".input",i)||r(i,{path:t+".input",expected:"Partial<IBbsArticle.ICreate>",value:e.input})].every(n=>n),l=(e,t,i=!0)=>[e.title===void 0||typeof e.title=="string"||r(i,{path:t+".title",expected:"(string | undefined)",value:e.title}),e.body===void 0||typeof e.body=="string"||r(i,{path:t+".body",expected:"(string | undefined)",value:e.body}),e.thumbnail===null||e.thumbnail===void 0||typeof e.thumbnail=="string"&&(u(e.thumbnail)||r(i,{path:t+".thumbnail",expected:'string & Format<"uri">',value:e.thumbnail}))||r(i,{path:t+".thumbnail",expected:'((string & Format<"uri"> & ContentMediaType<"image/*">) | null | undefined)',value:e.thumbnail})].every(n=>n),c=e=>typeof e=="object"&&e!==null&&d(e);let a,r;return e=>{if(c(e)===!1){a=[],r=y(a),((i,n,f=!0)=>(typeof i=="object"&&i!==null||r(!0,{path:n+"",expected:"__type",value:i}))&&s(i,n+"",!0)||r(!0,{path:n+"",expected:"__type",value:i}))(e,"$input",!0);const t=a.length===0;return t?{success:t,data:e}:{success:t,errors:a,data:e}}return{success:!0,data:e}}})()},{name:"erase",parameters:{type:"object",properties:{id:{type:"string",format:"uuid",description:"Target article's {@link IBbsArticle.id}."}},required:["id"],description:" Properties of erase function",additionalProperties:!1},description:`Erase an article.
216
-
217
- Erases an article from the DB.`,validate:(()=>{const d=a=>typeof a.id=="string"&&p(a.id),o=(a,r,e=!0)=>[typeof a.id=="string"&&(p(a.id)||c(e,{path:r+".id",expected:'string & Format<"uuid">',value:a.id}))||c(e,{path:r+".id",expected:'(string & Format<"uuid">)',value:a.id})].every(t=>t),s=a=>typeof a=="object"&&a!==null&&d(a);let l,c;return a=>{if(s(a)===!1){l=[],c=y(l),((e,t,i=!0)=>(typeof e=="object"&&e!==null||c(!0,{path:t+"",expected:"__type",value:e}))&&o(e,t+"",!0)||c(!0,{path:t+"",expected:"__type",value:e}))(a,"$input",!0);const r=l.length===0;return r?{success:r,data:a}:{success:r,errors:l,data:a}}return{success:!0,data:a}}})()}]},"3.1":{model:"3.1",options:{reference:!0,constraint:!0,separate: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.
218
-
219
- Representative title of the article.`,type:"string"},body:{description:`Content body.
220
-
221
- Content body of the article writtn in the markdown format.`,type:"string"},thumbnail:{description:`Thumbnail image URI.
222
-
223
- Thumbnail image URI which can represent the article.
224
-
225
- If configured as \`null\`, it means that no thumbnail image in the article.`,oneOf:[{type:"null"},{type:"string",format:"uri",contentMediaType:"image/*"}]}},required:["id","created_at","updated_at","title","body","thumbnail"]}}},output:{description:"List of every articles",type:"array",items:{$ref:"#/$defs/IBbsArticle"}},description:`Get all articles.
226
-
227
- List up every articles archived in the BBS DB.`,validate:d=>({success:!0,data:d})},{name:"create",parameters:{description:" Properties of create function",type:"object",properties:{input:{description:"Information of the article to create",$ref:"#/$defs/IBbsArticle.ICreate"}},required:["input"],additionalProperties:!1,$defs:{"IBbsArticle.ICreate":{description:"Information of the article to create.",type:"object",properties:{title:{description:`Title of the article.
228
-
229
- Representative title of the article.`,type:"string"},body:{description:`Content body.
230
-
231
- Content body of the article writtn in the markdown format.`,type:"string"},thumbnail:{description:`Thumbnail image URI.
232
-
233
- Thumbnail image URI which can represent the article.
234
-
235
- If configured as \`null\`, it means that no thumbnail image in the article.`,oneOf:[{type:"null"},{type:"string",format:"uri",contentMediaType:"image/*"}]}},required:["title","body","thumbnail"]},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.
236
-
237
- Representative title of the article.`,type:"string"},body:{description:`Content body.
238
-
239
- Content body of the article writtn in the markdown format.`,type:"string"},thumbnail:{description:`Thumbnail image URI.
240
-
241
- Thumbnail image URI which can represent the article.
242
-
243
- If configured as \`null\`, it means that no thumbnail image in the article.`,oneOf:[{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.
244
-
245
- Writes a new article and archives it into the DB.`,validate:(()=>{const d=e=>typeof e.input=="object"&&e.input!==null&&o(e.input),o=e=>typeof e.title=="string"&&typeof e.body=="string"&&(e.thumbnail===null||typeof e.thumbnail=="string"&&u(e.thumbnail)),s=(e,t,i=!0)=>[(typeof e.input=="object"&&e.input!==null||r(i,{path:t+".input",expected:"IBbsArticle.ICreate",value:e.input}))&&l(e.input,t+".input",i)||r(i,{path:t+".input",expected:"IBbsArticle.ICreate",value:e.input})].every(n=>n),l=(e,t,i=!0)=>[typeof e.title=="string"||r(i,{path:t+".title",expected:"string",value:e.title}),typeof e.body=="string"||r(i,{path:t+".body",expected:"string",value:e.body}),e.thumbnail===null||typeof e.thumbnail=="string"&&(u(e.thumbnail)||r(i,{path:t+".thumbnail",expected:'string & Format<"uri">',value:e.thumbnail}))||r(i,{path:t+".thumbnail",expected:'((string & Format<"uri"> & ContentMediaType<"image/*">) | null)',value:e.thumbnail})].every(n=>n),c=e=>typeof e=="object"&&e!==null&&d(e);let a,r;return e=>{if(c(e)===!1){a=[],r=y(a),((i,n,f=!0)=>(typeof i=="object"&&i!==null||r(!0,{path:n+"",expected:"__type",value:i}))&&s(i,n+"",!0)||r(!0,{path:n+"",expected:"__type",value:i}))(e,"$input",!0);const t=a.length===0;return t?{success:t,data:e}:{success:t,errors:a,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.
246
-
247
- Representative title of the article.`,type:"string"},body:{description:`Content body.
248
-
249
- Content body of the article writtn in the markdown format.`,type:"string"},thumbnail:{description:`Thumbnail image URI.
250
-
251
- Thumbnail image URI which can represent the article.
252
-
253
- If configured as \`null\`, it means that no thumbnail image in the article.`,oneOf:[{type:"null"},{type:"string",format:"uri",contentMediaType:"image/*"}]}},required:[]}}},description:`Update an article.
254
-
255
- Updates an article with new content.`,validate:(()=>{const d=e=>typeof e.id=="string"&&p(e.id)&&typeof e.input=="object"&&e.input!==null&&Array.isArray(e.input)===!1&&o(e.input),o=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"&&u(e.thumbnail)),s=(e,t,i=!0)=>[typeof e.id=="string"&&(p(e.id)||r(i,{path:t+".id",expected:'string & Format<"uuid">',value:e.id}))||r(i,{path:t+".id",expected:'(string & Format<"uuid">)',value:e.id}),(typeof e.input=="object"&&e.input!==null&&Array.isArray(e.input)===!1||r(i,{path:t+".input",expected:"Partial<IBbsArticle.ICreate>",value:e.input}))&&l(e.input,t+".input",i)||r(i,{path:t+".input",expected:"Partial<IBbsArticle.ICreate>",value:e.input})].every(n=>n),l=(e,t,i=!0)=>[e.title===void 0||typeof e.title=="string"||r(i,{path:t+".title",expected:"(string | undefined)",value:e.title}),e.body===void 0||typeof e.body=="string"||r(i,{path:t+".body",expected:"(string | undefined)",value:e.body}),e.thumbnail===null||e.thumbnail===void 0||typeof e.thumbnail=="string"&&(u(e.thumbnail)||r(i,{path:t+".thumbnail",expected:'string & Format<"uri">',value:e.thumbnail}))||r(i,{path:t+".thumbnail",expected:'((string & Format<"uri"> & ContentMediaType<"image/*">) | null | undefined)',value:e.thumbnail})].every(n=>n),c=e=>typeof e=="object"&&e!==null&&d(e);let a,r;return e=>{if(c(e)===!1){a=[],r=y(a),((i,n,f=!0)=>(typeof i=="object"&&i!==null||r(!0,{path:n+"",expected:"__type",value:i}))&&s(i,n+"",!0)||r(!0,{path:n+"",expected:"__type",value:i}))(e,"$input",!0);const t=a.length===0;return t?{success:t,data:e}:{success:t,errors:a,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.
256
-
257
- Erases an article from the DB.`,validate:(()=>{const d=a=>typeof a.id=="string"&&p(a.id),o=(a,r,e=!0)=>[typeof a.id=="string"&&(p(a.id)||c(e,{path:r+".id",expected:'string & Format<"uuid">',value:a.id}))||c(e,{path:r+".id",expected:'(string & Format<"uuid">)',value:a.id})].every(t=>t),s=a=>typeof a=="object"&&a!==null&&d(a);let l,c;return a=>{if(s(a)===!1){l=[],c=y(l),((e,t,i=!0)=>(typeof e=="object"&&e!==null||c(!0,{path:t+"",expected:"__type",value:e}))&&o(e,t+"",!0)||c(!0,{path:t+"",expected:"__type",value:e}))(a,"$input",!0);const r=l.length===0;return r?{success:r,data:a}:{success:r,errors:l,data:a}}return{success:!0,data:a}}})()}]}};function V(d){const o=new G,s=new I({model:"chatgpt",vendor:{api:d.api,model:d.vendorModel},controllers:[{protocol:"class",name:"bbs",application:H[d.schemaModel],execute:o}],config:{locale:d.locale,timezone:d.timezone}});return m.jsx(M,{agent:s})}function J(){const[d,o]=b.useState(w.defaultConfig()),[s,l]=b.useState(window.navigator.language),[c,a]=b.useState(!1);return m.jsx("div",{style:{width:"100%",height:"100%",overflow:c===!0?void 0:"auto"},children:c===!0?m.jsx(V,{api:new S({apiKey:d.apiKey,baseURL:d.baseURL,dangerouslyAllowBrowser:!0}),vendorModel:d.vendorModel,schemaModel:d.schemaModel,locale:s}):m.jsxs(q,{style:{width:"calc(100% - 60px)",padding:15,margin:15},children:[m.jsx(g,{variant:"h6",children:"BBS AI Chatbot"}),m.jsx("br",{}),m.jsx(L,{}),m.jsx("br",{}),"Demonstration of Agentica with TypeScript Controller Class.",m.jsx("br",{}),m.jsx("br",{}),m.jsx(g,{variant:"h6",children:" OpenAI Configuration "}),m.jsx("br",{}),m.jsx(w,{config:d,onChange:o}),m.jsx("br",{}),m.jsx(g,{variant:"h6",children:" Membership Information "}),m.jsx("br",{}),m.jsx(D,{onChange:r=>l(r.target.value),defaultValue:s,label:"Locale",variant:"outlined",error:s.length===0}),m.jsx("br",{}),m.jsx("br",{}),m.jsx(O,{component:"a",fullWidth:!0,variant:"contained",color:"info",size:"large",disabled:d.apiKey.length===0||d.vendorModel.length===0||d.schemaModel.length===0||s.length===0,onClick:()=>a(!0),children:"Start AI Chatbot"})]})})}j(window.document.getElementById("root")).render(m.jsx(J,{}));