@fugood/bricks-cli 2.24.12 → 2.24.13
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/lib/611.js +1 -1
- package/lib/627.js +1 -1
- package/lib/703.js +1 -1
- package/lib/737.js +1 -1
- package/lib/890.js +1 -1
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/lib/737.js
CHANGED
|
@@ -2449,4 +2449,4 @@ export const __webpack_esm_id__=737;export const __webpack_esm_ids__=[737];expor
|
|
|
2449
2449
|
}
|
|
2450
2450
|
}
|
|
2451
2451
|
${Ht}
|
|
2452
|
-
`,An={query:"query",mutation:"mutate"},Sn=(e,i,t)=>([n,a])=>{if(e[n])throw new Error(`Overwriting client.${n}`);e[n]=async(o,r={})=>{let s,d;const c={[i]:a,variables:o,...r};if(t&&(c.variables={...t,...c.variables}),r.readQuery)s=e.readQuery(c);else if(r.writeQuery)e.writeQuery({...c,data:r.writeQuery});else{const t=await e[An[i]](c);({data:s,errors:d}=t||{})}if(d)throw new Error(d.map(e=>e.message).join("\n"));return s?s[n]:null}},Cn=e=>({data:i,errors:t})=>{const n=((e,i)=>e?.length?new Error(e.map(e=>e.message).join("\n")):i?new Error(i):null)(t,!i?.mediaBoxChanged&&"Missing mediaBoxChanged payload");return n?e(n):e(null,i.mediaBoxChanged)},Tn=(e={})=>{const i=(({endpoint:e="http://localhost:3002",accessToken:i,boxId:t,passcode:n,enableSubscription:a=!0,enableRetry:o=!0,subscriptionOnConnectionOrError:r,onNetworkError:s}={})=>{const d=t&&n;let c=`${e}/api/graphql`;return d&&(c=`${e}/api/graphql_with_passcode`),Xt({endpointURL:c,subscriptionEndpointURL:c.replace("http:","ws:"),accessToken:i,enableSubscription:!d&&a,enableRetry:o,subscriptionOnConnectionOrError:r,onNetworkError:s})})(e);if(e.boxId&&e.passcode){i.type="passcode",i.queries=p,i.mutations=u;const t={boxId:e.boxId,passcode:e.passcode};Object.entries(p).forEach(Sn(i,"query",t)),Object.entries(u).forEach(Sn(i,"mutation",t)),i.listenBoxChanged=(e,n)=>{const a=i.subscribe({query:wn,variables:{...t,...e}}).subscribe({next:Cn(n),error(e){n(e)}});return a}}else i.accessToken=e.accessToken,i.type="token",i.queries=c,i.mutations=l,Object.entries(c).forEach(Sn(i,"query")),Object.entries(l).forEach(Sn(i,"mutation")),i.listenBoxChanged=(e,t)=>{const n=i.subscribe({query:yn,variables:e}).subscribe({next:Cn(t),error(e){t(e)}});return n};return i};var xn,En,Bn,Un,Rn=G(function e(i,t){L(this,e),this.baseUrl=i,this.token=t,this.graphqlUrl=`${i}/api/graphql`},[{key:"graphql",value:(Un=m(function*(e,i){var t=yield(0,A.Ay)(this.graphqlUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.token}`,Accept:"application/json"},body:JSON.stringify({query:e,variables:i})});if(!t.ok){var n=yield t.text().catch(()=>"");throw new Error(`Activity-log query failed (${t.status}): ${n}`)}var a=yield t.json();if(a.errors?.length)throw new Error(a.errors.map(e=>e.message).join("\n"));return a.data}),function(e,i){return Un.apply(this,arguments)})},{key:"events",value:(Bn=m(function*(e,{limit:i,offset:t}={}){var n={...e};return null!=i&&(n.limit=i),null!=t&&(n.offset=t),(yield this.graphql("\n query AL_events($filter: EventsFilter!) {\n events(filter: $filter) {\n device_id\n event_type\n event_name\n subspace_id\n sender\n payload\n timestamp\n }\n }\n",{filter:n})).events}),function(e){return Bn.apply(this,arguments)})},{key:"screenshots",value:(En=m(function*(e){return(yield this.graphql("\n query AL_screenshots($filter: ScreenshotFilter!) {\n screenshots(filter: $filter) {\n timestamp\n }\n }\n",{filter:e})).screenshots}),function(e){return En.apply(this,arguments)})},{key:"downloadScreenshot",value:(xn=m(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,A.Ay)(n,{headers:{Authorization:`Bearer ${this.token}`}});if(!a.ok){var o=yield a.text().catch(()=>"");throw new Error(`Screenshot fetch failed (${a.status}): ${o}`)}return Buffer.from(yield a.arrayBuffer())}),function(e,i,t){return xn.apply(this,arguments)})}]);function On(e,i,t){switch(t){case"user":return new Li(e,i);case"workspace":return new Rt(e,i);default:throw new Error(`Invalid token type: ${t}.`)}}process.env.STAGE,process.env.URL_BASE;var Mn="bricks-mcp",Pn={bricks:process.env.BRICKS_API_SERVER||"https://display-beta.bricks.tools",media:process.env.MEDIA_API_SERVER||"https://media-beta.bricks.tools",activityLog:process.env.ACTIVITY_LOG_API_SERVER||"https://activity-log-beta.bricks.tools"},Fn=(process.env.AUTH0_DOMAIN,process.env.CACHE_URL,t(17199));const Nn=({type:e,title:i,template_key:t})=>{var n,a,o=(0,Fn.makeId)(e);switch(e){case"subspace":n={title:i,layout:{width:"number",height:"number"},root_canvas_id:"CANVAS_<UUID>",canvas_map:{},brick_map:{},animation_map:{},generator_map:{},property_bank_map:{},property_bank_calc_map:{}},a={"canvas_map.CANVAS_<UUID>.item_list":[{type:"subspace",subspace_id:"SUBSPACE_<UUID>",$note:"If not a root subspace, it can be linked to canvas in other subspace"}]};break;case"canvas":var r=N(F.Ji);n={title:i,item_list:[],property:{$definitions:Object.fromEntries(Object.entries(r.propTypes).map(([e,i])=>[e,{...i,description:r.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(r.eventTypes).map(([e])=>[e,{description:r.brickEventDescriptions[e]}]))}},a={property_bank_map:{[(0,Fn.makeId)("property_bank")]:{title:`Canvas ID: ${i}`,type:"string",value:o,routing:"read-only",kind:"auto-generated-item-id",idType:"canvas"}}};break;case"brick":var s=N(F.dK.Basic),d=N(F.eW[t]);if(!d)throw new Error(`Brick ${t} not found`);var c={...d,propTypes:{...s.propTypes,...d.propTypes},brickPropDescriptions:{...s.brickPropDescriptions,...d.brickPropDescriptions},eventTypes:{...s.eventTypes,...d.eventTypes},brickEventDescriptions:{...s.brickEventDescriptions,...d.brickEventDescriptions}};n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(c.propTypes).map(([e,i])=>[e,{...i,description:c.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(c.eventTypes).map(([e])=>[e,{description:c.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(c.outletTypes??{}).map(([e])=>[e,{description:(c.brickOutletDescriptions??{})[e]}]))},state_group:{"BRICK_STATE_GROUP_<UUID>":{}}},a={canvas_map:{"CANVAS_<UUID WHICH NEED DISPLAY THIS BRICK>":{item_list:[{type:"brick",brick_id:o,frame:{x:"number",y:"number",width:"number",height:"number",standby_mode:"custom|top|left|right|bottom",standby_delay:"number",standby_easing:{default:{method:"ease",duration:"number"}}}}]}}};break;case"state_group":n={title:i,description:"State Group Description",conds:[{type:"property_bank|inner_state",key:"PROPERTY_BANK#<Data Node ID>|[current_canvas|BRICK_<OUTLET NAME>]|",method:"==|!=|>|>=|<|<=",value:"value_to_compare"}],override:{property:!1,event:!1,outlet:!1},commented:!1,break:!1,property:{},outlet:{},animation:{}};break;case"generator":var l=N(F.wj[t]);if(!l)throw new Error(`Generator ${t} not found`);n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(l.propTypes).map(([e,i])=>[e,{...i,description:l.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(l.eventTypes).map(([e])=>[e,{description:l.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(l.outletTypes).map(([e])=>[e,{description:l.brickOutletDescriptions[e]}]))}};break;case"animation":n={title:i,type:"timing|decay|spring",property:"opacity|transform.translateX|transform.scale|etc",config:{$note:"Config for the animation"},compose_type:"parallel|sequence",item_list:[{animation_id:"ANIMATION_<SUB ANIMATION UUID>"}]};break;case"property_bank":n={title:i,description:"Property Bank Description",linkedFrom:"SUBSPACE_<UUID WHICH IS CROSS SUBSPACE>",type:"string|number|bool|object|array|any",kind:"color|datetime|id|media-resource-*|lottie-file-uri",unit:"grid|px|ms",routing:"read-only|default",value:"fit-to-type",event_map:{$note:`Available events: ${Object.keys(F.qJ.eventTypes).join(", ")}`},local_sync:{update_mode:"all|main-only|minor-only|dont-sync"},$remote_update_additional:{$note:"Configure remote update behavior",enable_remote_update:!0,bank_type:"create|create-device-specific"}};break;case"property_bank_command":break;case"property_bank_calc":var p=(0,Fn.makeId)("property_bank_command"),u=(0,Fn.makeId)("property_bank_command"),m=(0,Fn.makeId)("property_bank_command"),_="const { arg_name } = inputs;\n\nreturn { arg_name };";n={title:i,map:{$note:"Required, actual implementation","PROPERTY_BANK_DATA_NODE_<UUID>":{type:"data-node",properties:{},in:{change:null},out:{value:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID>",port:"value"}]},$note:"Use this to input data to the sandbox"},"PROPERTY_BANK_COMMAND_NODE_<UUID FIRST>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:null,path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},"PROPERTY_BANK_COMMAND_NODE_<UUID SECOND>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PREVIOUS>",port:"result"}],path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID SECOND>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},[p]:{type:"command-node-sandbox",title:"Command: SANDBOX_RUN_JAVASCRIPT",properties:{command:"SANDBOX_RUN_JAVASCRIPT",args:{code:_,enable_async:!1}},in:{code:null,inputs:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID FINAL>",port:"result"}]},out:{result:[{id:m,port:"result"},{id:u,port:"result"}]}},[m]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_ERROR",properties:{command:"SANDBOX_GET_ERROR"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR>",port:"change"}],$note:"Set `result` as null if there is no error"}},[u]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_RETURN_VALUE",properties:{command:"SANDBOX_GET_RETURN_VALUE"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT> | null",port:"change"}]}},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT>":{type:"data-node",properties:{},in:{change:[{id:u,port:"result"}]},out:{value:null},$note:"Put full result into data node"},"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>":{type:"command-node-object",title:"Command: OBJECT_GET",properties:{command:"OBJECT_GET",args:{path:"obj_key"}},in:{obj:[{id:u,port:"obj"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>",port:"change"}]},$note:"Parse result object into data node"},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>":{type:"data-node",properties:{},in:{change:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>",port:"result"}]},out:{value:null},$note:"Put partial result into data node"}},editor_info:{},type:"script",script_config:{title:i,enable_async:!1,inputs:{"PROPERTY_BANK_DATA_NODE_<UUID>":"arg_name"},disabled_triggers:{},error:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR> | null",output:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | null",outputs:{obj_key:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>"},code:_,$note:"Required, info for GUI editor"}}}return D({id:o,example:n,extraInfo:a})};function qn(e,i){var t,n,a,o,r,s,d,c,l,p,u,_,g,f,y,$,v,h,I,C,T,x,E,B,U,R,O,P,F="user"===i.tokenType,N=((e,i=null)=>({name:t,description:n,inputSchema:a,permission:o},r)=>{K(i,o)&&e.tool(t,n,a,r)})(e,i),q=e=>({...e,...F?{workspace_id:b.Yj().describe("Workspace ID")}:{}}),W=i.client,j=F?function(e){var i=e.endpoint,t=e.accessToken;if(!i)throw new Error("Media API endpoint is required");if(!t)throw new Error("Access token is required");return Tn({endpoint:i,accessToken:t,enableSubscription:!1,enableRetry:!0})}({endpoint:Pn.media,accessToken:i.token}):W,V=e=>F?{fileId:e}:{id:e},G=e=>F?{list:e}:{fileIds:e};if(F&&e.tool("list_workspaces","List all workspaces",{},m(function*(){return D(yield W.workspaces())})),N({name:"get_workspace_overview",description:"Get comprehensive overview of the BRICKS workspace including stats and summary",inputSchema:q({}),permission:"info"},(t=m(function*({workspace_id:e}){var i=yield Promise.all([W.workspace({id:e}),W.applications({workspaceId:e,paginate:{limit:50,offset:0}}),W.modules({workspaceId:e,paginate:{limit:50,offset:0}}),W.devices({workspaceId:e,paginate:{limit:50,offset:0}}),F?j.mediaWorkspace({workspaceId:e}).catch(()=>null):j.mediaWorkspace().catch(()=>null),F?j.mediaBoxes({workspaceId:e}).catch(()=>[]):j.mediaBoxes().catch(()=>[])]),t=w(i,6),n=t[0],a=t[1],o=t[2],r=t[3],s=t[4],d=t[5];if(!n)throw new Error("Authentication failed, please check your token");return D({workspace:n,stats:{applications:a?.length??"No permission",modules:o?.length??"No permission",devices:r?.length??"No permission",running_apps:a?.filter(e=>e.status?.running).length??"No permission",media_boxes:d?.length??"No permission",media_enabled:!!s,notes:"Note: The stats are based on the first 50 applications, modules, and devices in the workspace."},recent_activity:{latest_apps:a?.slice(0,5).map(e=>({id:e._id,name:e.name,status:e.status?.running?"running":"stopped",last_update:e.last_modify_datetime}))||[]},media_info:s?{workspace_id:s.id,name:s.name,size_used:s.size,size_limit:s.sizeLimit,boxes:d?.slice(0,5).map(e=>({id:e.id,name:e.name,size:e.size,description:e.description}))||[]}:{enabled:!1,note:"Media workspace is not enabled for this workspace"}})}),function(e){return t.apply(this,arguments)})),N({name:"get_applications",description:"List all applications in the workspace",inputSchema:q({limit:b.ai().describe("Maximum number of applications to return").optional().default(50),offset:b.ai().describe("Number of applications to skip").optional().default(0)}),permission:"query_application"},(n=m(function*({workspace_id:e,limit:i=50,offset:t=0}){return D(yield W.applications({workspaceId:e,paginate:{limit:i,offset:t}}))}),function(e){return n.apply(this,arguments)})),N({name:"get_application",description:"Get detailed info and config of a specific application",inputSchema:q({id:b.Yj().describe("Application ID")}),permission:"query_application"},(a=m(function*({workspace_id:e,id:i}){return D(yield W.application({workspaceId:e,id:i}))}),function(e){return a.apply(this,arguments)})),N({name:"get_modules",description:"List all modules in the workspace",inputSchema:q({limit:b.ai().describe("Maximum number of modules to return").optional().default(50),offset:b.ai().describe("Number of modules to skip").optional().default(0)}),permission:"query_module"},(o=m(function*({workspace_id:e,limit:i=50,offset:t=0}){return D(yield W.modules({workspaceId:e,paginate:{limit:i,offset:t}}))}),function(e){return o.apply(this,arguments)})),N({name:"get_module",description:"Get detailed info and config of a specific module",inputSchema:q({id:b.Yj().describe("Module ID")}),permission:"query_module"},(r=m(function*({workspace_id:e,id:i}){return D(yield W.module({workspaceId:e,id:i}))}),function(e){return r.apply(this,arguments)})),N({name:"update_module_info",description:"Update a specific module info",inputSchema:q({id:b.Yj().describe("Module ID"),name:b.Yj().describe("Module name"),description:b.Yj().describe("Module description")}),permission:"update_module"},(s=m(function*({workspace_id:e,id:i,name:t,description:n}){return D(yield W.updateModule({workspaceId:e,id:i,name:t,description:n}))}),function(e){return s.apply(this,arguments)})),N({name:"update_module_config",description:"Update a specific module configuration",inputSchema:q({id:b.Yj().describe("Module ID"),config:b.Ik({}).passthrough().describe("New configuration object, see file://docs/config-schema.md for schema reference")}),permission:"update_module"},(d=m(function*({workspace_id:e,id:i,config:t}){var n=yield M(t);if(!n.valid)throw new Error(`Config validation failed: ${n.errors.join(", ")}`);return D(yield W.updateModule({workspaceId:e,id:i,config:JSON.stringify(t),validateConfig:!0}))}),function(e){return d.apply(this,arguments)})),N({name:"get_devices",description:"List all devices in the workspace",inputSchema:q({limit:b.ai().describe("Maximum number of devices to return").optional().default(50),offset:b.ai().describe("Number of devices to skip").optional().default(0)}),permission:"query_device"},(c=m(function*({workspace_id:e,limit:i=50,offset:t=0}){return D(yield W.devices({workspaceId:e,paginate:{limit:i,offset:t}}))}),function(e){return c.apply(this,arguments)})),N({name:"create_application",description:"Create a new BRICKS application with default grid layout",inputSchema:q({name:b.Yj().describe("Application name"),description:b.Yj().describe("Application description").optional(),grid_width:b.ai().describe("Grid width in units").optional().default(96),grid_height:b.ai().describe("Grid height in units").optional().default(54)}),permission:"create_application"},(l=m(function*({workspace_id:e,name:i,description:t,grid_width:n,grid_height:a}){return D(yield W.createApplication({workspaceId:e,name:i,description:t,gridWidth:n,gridHeight:a}))}),function(e){return l.apply(this,arguments)})),N({name:"update_application_info",description:"Update application info",inputSchema:{id:b.Yj().describe("Application ID"),name:b.Yj().describe("Application name"),description:b.Yj().describe("Application description")},permission:"update_application"},(p=m(function*({id:e,name:i,description:t}){return D(yield W.updateApplication({id:e,name:i,description:t}))}),function(e){return p.apply(this,arguments)})),N({name:"update_application_config",description:"Update application configuration with validation",inputSchema:{id:b.Yj().describe("Application ID"),config:b.Ik({}).passthrough().describe("New application configuration. Please read `getting-started` for BRICKS concepts before changing")},permission:"update_application"},(u=m(function*({id:e,config:i}){var t=yield M(i);if(!t.valid)throw new Error(`Config validation failed: ${t.errors.join(", ")}`);return D(yield W.updateApplication({id:e,config:JSON.stringify(i)}))}),function(e){return u.apply(this,arguments)})),N({name:"bind_application",description:"Bind application to device with viewport configuration",inputSchema:{app_id:b.Yj().describe("Application ID"),viewports:b.YO(b.Ik({device_id:b.Yj().describe("Device ID"),x:b.ai().describe("X coordinate"),y:b.ai().describe("Y coordinate"),width:b.ai().describe("Width"),height:b.ai().describe("Height"),rotate:b.ai().describe("Rotation"),rotateType:b.Yj().describe("Rotation type")})).describe("Viewport configuration")},permission:"bind_application"},(_=m(function*({app_id:e,viewports:i}){return D(yield W.bindApplication({id:e,bindDevices:i.map(e=>e.device_id),deviceFrames:i.reduce((e,i)=>({...e,[i.device_id]:{x:i.x,y:i.y,width:i.width,height:i.height,rotate:i.rotate,rotateType:i.rotateType}}),{})}))}),function(e){return _.apply(this,arguments)})),N({name:"unbind_application",description:"Unbind application from device",inputSchema:{app_id:b.Yj().describe("Application ID"),device_id:b.Yj().describe("Device ID")},permission:"bind_application"},(g=m(function*({app_id:e,device_id:i}){return D(yield W.bindApplication({id:e,unbindDevices:[i]}))}),function(e){return g.apply(this,arguments)})),F&&N({name:"list_media_workspaces",description:"List all media workspaces",inputSchema:{},permission:"query_media_flow"},m(function*(){return D(yield j.mediaWorkspaces())})),N({name:"get_media_workspace",description:"Get media workspace information and status",inputSchema:q({}),permission:"query_media_flow"},(f=m(function*({workspace_id:e}){return D(yield j.mediaWorkspace({workspaceId:e}))}),function(e){return f.apply(this,arguments)})),N({name:"list_media_boxes",description:"List all media boxes in the workspace",inputSchema:q({}),permission:"query_media_flow"},(y=m(function*({workspace_id:e}){return D(yield j.mediaBoxes({workspaceId:e}))}),function(e){return y.apply(this,arguments)})),N({name:"get_media_box",description:"Get detailed information about a specific media box",inputSchema:{box_id:b.Yj().describe("Media box ID")},permission:"query_media_flow"},($=m(function*({box_id:e}){return D(yield j.mediaBox({boxId:e}))}),function(e){return $.apply(this,arguments)})),N({name:"list_media_files",description:"List media files in a specific box with filtering options",inputSchema:{box_id:b.Yj().describe("Media box ID"),include_types:b.YO(b.Yj()).optional().describe('Filter by file types (e.g., ["image", "video", "audio"])'),user_tags:b.YO(b.Yj()).optional().describe("Filter by user tags"),limit:b.ai().optional().default(50).describe("Maximum number of files to return"),offset:b.ai().optional().default(0).describe("Number of files to skip")},permission:"query_media_flow"},(v=m(function*({box_id:e,include_types:i,user_tags:t,limit:n,offset:a}){return D(yield j.mediaFiles({boxId:e,includeTypes:i,userTags:t,limit:n,offset:a}))}),function(e){return v.apply(this,arguments)})),N({name:"get_media_file_meta",description:"Get detailed information about a specific media file",inputSchema:{file_id:b.Yj().describe("Media file ID")},permission:"query_media_flow"},(h=m(function*({file_id:e}){return D(yield j.mediaFile(V(e)))}),function(e){return h.apply(this,arguments)})),N({name:"media_box_upload",description:"Upload a file to a media box from URL or base64 data",inputSchema:{box_id:b.Yj().describe("Target media box ID"),name:b.Yj().describe("File name"),description:b.Yj().optional().default("").describe("File description"),file_type:b.k5(["image","video","audio","file"]).describe("File type"),source_url:b.Yj().optional().describe("URL to download the file from"),base64_data:b.Yj().optional().describe("Base64 encoded file data"),user_tags:b.YO(b.Yj()).optional().default([]).describe("User-defined tags for the file")},permission:"write_media_flow"},(I=m(function*({box_id:e,name:i,description:t,source_url:n,base64_data:a,file_type:o,user_tags:r}){if(!n&&!a)throw new Error("Either source_url or base64_data must be provided");if(n&&a)throw new Error("Provide either source_url OR base64_data, not both");var s=n?null:"application/octet-stream",d=n?yield(0,A.Ay)(n,{agent:(0,S.fJ)(n)}).then(e=>(s=e.headers.get("content-type")||"application/octet-stream",e.blob())):new Blob([k.Buffer.from(a,"base64")],{type:s}),c=yield j.requestFileUpload({name:i,description:t,boxId:e,fileType:F?o.toUpperCase():o,contentType:s,userTags:r,meta:{}}),l=!1;try{var p=JSON.parse(c?.meta.uploadInfo),u=new FormData;u.append("file",d),u.append("Content-Type",s),u.append("AWSAccessKeyId",p.AWSAccessKeyId),u.append("Signature",p.Signature),u.append("Policy",p.Policy),u.append("acl",p.acl),u.append("key",p.key),l=yield(0,A.Ay)(p.url,{method:"POST",body:u}).then(e=>e.ok).catch(()=>!1)}catch{l=!1}return D({file_id:c.id,upload_success:l,upload_info:{content_type:s,file_type:o,source_type:n?"url":"base64",processing_note:"File will be processed automatically. Use get_media_file to check processing status."}})}),function(e){return I.apply(this,arguments)})),N({name:"update_media_file_meta",description:"Update media file information",inputSchema:{file_id:b.Yj().describe("Media file ID"),name:b.Yj().optional().describe("New file name"),description:b.Yj().optional().describe("New file description"),user_tags:b.YO(b.Yj()).optional().describe("New user tags")},permission:"write_media_flow"},(C=m(function*({file_id:e,name:i,description:t,user_tags:n}){return D(yield j.updateMediaFile({...V(e),name:i,description:t,userTags:n,requestUploadAgain:!1}))}),function(e){return C.apply(this,arguments)})),N({name:"copy_media_files",description:"Copy media files from one box to another",inputSchema:{from_box_id:b.Yj().describe("Source media box ID"),to_box_id:b.Yj().describe("Target media box ID"),file_ids:b.YO(b.Yj()).describe("Array of media file IDs to copy")},permission:"write_media_flow"},(T=m(function*({from_box_id:e,to_box_id:i,file_ids:t}){return D(yield j.copyMediaFiles({fromBoxId:e,toBoxId:i,...G(t)}))}),function(e){return T.apply(this,arguments)})),N({name:"delete_media_files",description:"Delete specific media files from a box",inputSchema:{box_id:b.Yj().describe("Media box ID"),file_ids:b.YO(b.Yj()).describe("Array of media file IDs to delete")},permission:"write_media_flow"},(x=m(function*({box_id:e,file_ids:i}){return D(yield j.deleteMediaFiles({boxId:e,...G(i)}))}),function(e){return x.apply(this,arguments)})),N({name:"cleanup_media_box",description:"Delete all files in a media box, optionally filtered by type",inputSchema:{box_id:b.Yj().describe("Media box ID"),include_types:b.YO(b.Yj()).optional().describe('Only delete files of these types (e.g., ["image", "video"])')},permission:"write_media_flow"},(E=m(function*({box_id:e,include_types:i}){if("deleteMediaBoxFiles"in j)return D(yield j.deleteMediaBoxFiles({boxId:e,includeTypes:i}));var t=yield j.mediaFiles({boxId:e,includeTypes:i});return D(yield j.deleteMediaFiles({boxId:e,list:t.map(e=>e.id)}))}),function(e){return E.apply(this,arguments)})),e.tool("calculate_grid_layout","Calculate grid layout and pixel conversions for different device resolutions",{device_width:b.ai().describe("Device width in pixels"),device_height:b.ai().describe("Device height in pixels"),app_grid_width:b.ai().describe("Application grid width").optional().default(96),app_grid_height:b.ai().describe("Application grid height").optional().default(54)},(B=m(function*({device_width:e,device_height:i,app_grid_width:t,app_grid_height:n}){var a,o,r={deviceBrickWidth:(a=e)/(o=a/t),deviceBrickHeight:i/o,deviceBrickUnit:o},s=function(e,i,t=96){var n=e/t;return i>e&&(n=i/t),{deviceBrickWidth:Math.round(e/n),deviceBrickHeight:Math.round(i/n),deviceBrickUnit:n}}(e,i,t);return D({device_resolution:{width:e,height:i,aspect_ratio:(e/i).toFixed(2)},current_grid:{width:t,height:n,unit_size_px:r.deviceBrickUnit.toFixed(2),total_pixels:{width:r.deviceBrickWidth.toFixed(2),height:r.deviceBrickHeight.toFixed(2)}},recommended_grid:{width:s.deviceBrickWidth,height:s.deviceBrickHeight,unit_size_px:s.deviceBrickUnit.toFixed(2),note:"Optimized for device aspect ratio"}})}),function(e){return B.apply(this,arguments)})),e.tool("create_item","Use this tool to create new item that you can put in application configuration",{type:b.k5(["subspace","canvas","brick","generator","property_bank","property_bank_calc","property_bank_command","animation","state_group","automation_map"]).describe("Item type"),title:b.Yj().describe("Item title"),template_key:b.Yj().optional().describe("Template key for brick or generator")},Nn),e.tool("getting_started","Get documentation content for getting started",{},m(function*(){return D(Y)})),!F){var L=()=>{return e=Pn.activityLog,t=i.token,new Rn(e,t);var e,t};N({name:"activity_log_events",description:"Query activity log events. Returns raw events (general, data, local_sync) with filtering. Max 30-day range.",inputSchema:q({start_time:b.Yj().describe("Start time (ISO 8601)"),end_time:b.Yj().describe("End time (ISO 8601)"),device_id:b.Yj().optional().describe("Filter by device ID"),event_type:b.k5(["general","data","local_sync"]).optional().describe("Filter by event type"),event_name:b.Yj().optional().describe("Filter by event name (e.g. BRICK_xxx_ON_PRESS)"),subspace_id:b.Yj().optional().describe("Filter by subspace ID"),sender:b.Yj().optional().describe("Filter by sender"),limit:b.ai().optional().default(50).describe("Max events to return per page"),offset:b.ai().optional().default(0).describe("Number of events to skip (for pagination)")}),permission:"query_activity_log"},(O=m(function*({start_time:e,end_time:i,device_id:t,event_type:n,event_name:a,subspace_id:o,sender:r,limit:s=50,offset:d=0}){var c=L(),l={start_time:e,end_time:i};t&&(l.device_id=t),n&&(l.event_type=n),a&&(l.event_name=a),o&&(l.subspace_id=o),r&&(l.sender=r);var p=yield c.events(l,{limit:s,offset:d});return D(p)}),function(e){return O.apply(this,arguments)})),N({name:"activity_log_screenshots",description:"List available screenshot timestamps for a device in a time range.",inputSchema:q({device_id:b.Yj().describe("Device ID (required)"),start_time:b.Yj().describe("Start time (ISO 8601)"),end_time:b.Yj().describe("End time (ISO 8601)")}),permission:"query_activity_log"},(R=m(function*({device_id:e,start_time:i,end_time:t}){var n=L(),a=yield n.screenshots({device_id:e,start_time:i,end_time:t});return D(a)}),function(e){return R.apply(this,arguments)})),N({name:"activity_log_screenshot",description:"Download a device screenshot at a specific timestamp. Returns JPEG image as blob.",inputSchema:q({device_id:b.Yj().describe("Device ID"),ts:b.Yj().describe("Screenshot timestamp (ISO 8601 or epoch ms)")}),permission:"query_activity_log"},(U=m(function*({workspace_id:e,device_id:t,ts:n}){var a=e||i.tokenInfo?.w_id;if(!a)throw new Error("Could not determine workspace ID");var o=L(),r=/^\d+$/.test(n)?n:new Date(n).getTime(),s=yield o.downloadScreenshot(a,t,r);return D(s,{mimeType:"image/jpeg"})}),function(e){return U.apply(this,arguments)}))}N({name:"get_device_usage",description:"Get device usage metrics (uptime, memory, disk) for a date range. Data from BRICKS main server.",inputSchema:q({device_id:b.Yj().describe("Device ID"),start_date:b.Yj().optional().describe("Start date/time in ISO 8601 format (default: start of today)"),end_date:b.Yj().optional().describe("End date/time in ISO 8601 format (default: now)")}),permission:"query_device"},(P=m(function*({device_id:e,start_date:i,end_date:t}){var n=new Date,a=new Date(n.getFullYear(),n.getMonth(),n.getDate()).toISOString(),o=yield W.deviceUsage({deviceId:e,startDate:i?new Date(i).toISOString():a,endDate:t?new Date(t).toISOString():n.toISOString()});return D(o)}),function(e){return P.apply(this,arguments)}))}var Wn="2.24.12";function jn(){return Vn.apply(this,arguments)}function Vn(){return Vn=m(function*(e={}){var i=e.token||process.env.BRICKS_API_TOKEN;if(!i)throw console.error("Error: API token is required"),console.error("Please provide a token via options or set BRICKS_API_TOKEN environment variable"),new Error("API token is required");var t=h({queryStringParameters:{token:i}});if(!t.success)throw console.error("Error: Invalid BRICKS_API_TOKEN"),console.error(t.message),new Error("Invalid BRICKS_API_TOKEN");var n,a,o=new _._({name:Mn,version:Wn}),r={...t,client:On(Pn.bricks,t.token,t.tokenType)};(n=o).prompt("getting-started","Getting started with BRICKS",{},m(function*(){return{messages:[{role:"user",content:{type:"text",text:'Welcome to BRICKS — start here.\n\nBefore doing any complex work (application design, deployments, etc.),\nalways consult the official docs rather than guessing.\n\nIMPORTANT: BRICKS users interact through a GUI editor, not raw config files.\nNever show users JSON config details, schema fields, or technical implementation.\nFocus on user-friendly descriptions of what the app will do and how it will look.\n\nGolden rules for working with BRICKS:\n1) Read before you act\n - Open these resources first, then proceed:\n - `getting-started` — overview & architecture\n - `config-schema` — canonical schema for apps, subspaces, bricks, generators, etc.\n - `components-index` — available bricks/generators\n2) Source of truth\n - Rely on the docs above; do not invent fields not present in the schema\n3) No guessing\n - If names, constraints, or device details are missing, ask to fetch them first\n4) Plan then execute\n - Propose a clear step-by-step plan and wait for approval before writing or mutating data\n5) User-friendly communication\n - Describe features in terms of what users see and do, not technical config\n - Use visual/functional language: "text display", "button", "screen transition"\n - Avoid exposing JSON, IDs, or schema details to end users\n\nBRICKS essentials:\n- Applications: interactive digital signage experiences\n- Devices: deployment targets (screens/players)\n- Modules: Reusable module across applications\n- Grid system: default 96×54; 1 unit = device_width/96 (e.g., 20px at 1920×1080)\n- Key primitives: Subspaces, Canvas, Bricks, Generators, Property Banks (Data)\n\nQuick actions:\n- "Create a new application" → use the `create-application` prompt\n- "Deploy an application to a device" → use the `deploy-to-device` prompt\n\nTry asking:\n- "Draft a plan to create an app with a text display and deploy it; ask any missing questions first"'}}]}})),n.prompt("create-application","Create a new BRICKS application with guided setup",{app_name:b.Yj().describe("Name for the new application"),description:b.Yj().describe("Short description for the new application").optional()},(a=m(function*(e){var i=e?.app_name||"New Application",t=e?.description||"";return{messages:[{role:"user",content:{type:"text",text:`Help me create a new BRICKS application called "${i}".\n\n${t?`Goal: ${t}`:""}\n\nIMPORTANT: Users see a visual GUI editor, not raw config. Describe features in user-friendly terms:\n- "text display" not "BRICK_TEXT"\n- "image" not "BRICK_IMAGE"\n- "canvas name" not "CANVAS_xxx"\n- "data storage" not "PROPERTY_BANK"\n- Focus on what users see and do, not technical implementation\n\nHow we'll proceed (no guessing, schema-first):\n1) Confirm intent\n - Restate objectives and success criteria in 1–3 bullets\n2) Consult docs (as needed)\n - getting-started, config-schema, components-index\n - Ensure proposed fields exist in the schema\n3) Ask missing questions before changes\n - Target device(s) and resolution(s)\n - Layout needs (pages/screens), content types, data sources\n - Localization, scheduling, or interaction needs\n4) Propose a minimal viable design (After confirming intent)\n - App structure: screens → visual elements\n - Initial component selection with rationale\n - Grid usage: default 96×54 (≈20px at 1920×1080)\n5) Produce a schema-valid skeleton (no side effects yet)\n - Include only fields defined by config-schema\n - Use clear placeholders for text/assets/URLs/ids\n\nWhat I'll produce first:\n- Short recap of requirements\n- Clarifying questions (only what's necessary)\n- High-level architecture plan\n- Minimal config skeleton that validates against the schema`}}]}}),function(e){return a.apply(this,arguments)})),function(e){e.resource("getting-started-docs","file://docs/getting-started.md",{mimeType:"text/markdown",title:"Getting Started with BRICKS",description:"Comprehensive guide to BRICKS architecture, concepts, and development workflow"},m(function*(){return D(I,{uri:"file://docs/getting-started.md",mimeType:"text/markdown"})}))}(o),qn(o,r);var s=new g.S;try{yield o.connect(s),console.error("BRICKS MCP Server running on STDIO"),console.error(`Server: ${Mn} v${Wn}`),console.error(`Token Type: ${t.tokenType}`),console.error(`Permissions: ${t.tokenInfo.permissions.join(", ")}`),console.error("Ready to accept requests...")}catch(e){throw console.error("Failed to start MCP server:",e),e}}),Vn.apply(this,arguments)}}};
|
|
2452
|
+
`,An={query:"query",mutation:"mutate"},Sn=(e,i,t)=>([n,a])=>{if(e[n])throw new Error(`Overwriting client.${n}`);e[n]=async(o,r={})=>{let s,d;const c={[i]:a,variables:o,...r};if(t&&(c.variables={...t,...c.variables}),r.readQuery)s=e.readQuery(c);else if(r.writeQuery)e.writeQuery({...c,data:r.writeQuery});else{const t=await e[An[i]](c);({data:s,errors:d}=t||{})}if(d)throw new Error(d.map(e=>e.message).join("\n"));return s?s[n]:null}},Cn=e=>({data:i,errors:t})=>{const n=((e,i)=>e?.length?new Error(e.map(e=>e.message).join("\n")):i?new Error(i):null)(t,!i?.mediaBoxChanged&&"Missing mediaBoxChanged payload");return n?e(n):e(null,i.mediaBoxChanged)},Tn=(e={})=>{const i=(({endpoint:e="http://localhost:3002",accessToken:i,boxId:t,passcode:n,enableSubscription:a=!0,enableRetry:o=!0,subscriptionOnConnectionOrError:r,onNetworkError:s}={})=>{const d=t&&n;let c=`${e}/api/graphql`;return d&&(c=`${e}/api/graphql_with_passcode`),Xt({endpointURL:c,subscriptionEndpointURL:c.replace("http:","ws:"),accessToken:i,enableSubscription:!d&&a,enableRetry:o,subscriptionOnConnectionOrError:r,onNetworkError:s})})(e);if(e.boxId&&e.passcode){i.type="passcode",i.queries=p,i.mutations=u;const t={boxId:e.boxId,passcode:e.passcode};Object.entries(p).forEach(Sn(i,"query",t)),Object.entries(u).forEach(Sn(i,"mutation",t)),i.listenBoxChanged=(e,n)=>{const a=i.subscribe({query:wn,variables:{...t,...e}}).subscribe({next:Cn(n),error(e){n(e)}});return a}}else i.accessToken=e.accessToken,i.type="token",i.queries=c,i.mutations=l,Object.entries(c).forEach(Sn(i,"query")),Object.entries(l).forEach(Sn(i,"mutation")),i.listenBoxChanged=(e,t)=>{const n=i.subscribe({query:yn,variables:e}).subscribe({next:Cn(t),error(e){t(e)}});return n};return i};var xn,En,Bn,Un,Rn=G(function e(i,t){L(this,e),this.baseUrl=i,this.token=t,this.graphqlUrl=`${i}/api/graphql`},[{key:"graphql",value:(Un=m(function*(e,i){var t=yield(0,A.Ay)(this.graphqlUrl,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.token}`,Accept:"application/json"},body:JSON.stringify({query:e,variables:i})});if(!t.ok){var n=yield t.text().catch(()=>"");throw new Error(`Activity-log query failed (${t.status}): ${n}`)}var a=yield t.json();if(a.errors?.length)throw new Error(a.errors.map(e=>e.message).join("\n"));return a.data}),function(e,i){return Un.apply(this,arguments)})},{key:"events",value:(Bn=m(function*(e,{limit:i,offset:t}={}){var n={...e};return null!=i&&(n.limit=i),null!=t&&(n.offset=t),(yield this.graphql("\n query AL_events($filter: EventsFilter!) {\n events(filter: $filter) {\n device_id\n event_type\n event_name\n subspace_id\n sender\n payload\n timestamp\n }\n }\n",{filter:n})).events}),function(e){return Bn.apply(this,arguments)})},{key:"screenshots",value:(En=m(function*(e){return(yield this.graphql("\n query AL_screenshots($filter: ScreenshotFilter!) {\n screenshots(filter: $filter) {\n timestamp\n }\n }\n",{filter:e})).screenshots}),function(e){return En.apply(this,arguments)})},{key:"downloadScreenshot",value:(xn=m(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,A.Ay)(n,{headers:{Authorization:`Bearer ${this.token}`}});if(!a.ok){var o=yield a.text().catch(()=>"");throw new Error(`Screenshot fetch failed (${a.status}): ${o}`)}return Buffer.from(yield a.arrayBuffer())}),function(e,i,t){return xn.apply(this,arguments)})}]);function On(e,i,t){switch(t){case"user":return new Li(e,i);case"workspace":return new Rt(e,i);default:throw new Error(`Invalid token type: ${t}.`)}}process.env.STAGE,process.env.URL_BASE;var Mn="bricks-mcp",Pn={bricks:process.env.BRICKS_API_SERVER||"https://display-beta.bricks.tools",media:process.env.MEDIA_API_SERVER||"https://media-beta.bricks.tools",activityLog:process.env.ACTIVITY_LOG_API_SERVER||"https://activity-log-beta.bricks.tools"},Fn=(process.env.AUTH0_DOMAIN,process.env.CACHE_URL,t(17199));const Nn=({type:e,title:i,template_key:t})=>{var n,a,o=(0,Fn.makeId)(e);switch(e){case"subspace":n={title:i,layout:{width:"number",height:"number"},root_canvas_id:"CANVAS_<UUID>",canvas_map:{},brick_map:{},animation_map:{},generator_map:{},property_bank_map:{},property_bank_calc_map:{}},a={"canvas_map.CANVAS_<UUID>.item_list":[{type:"subspace",subspace_id:"SUBSPACE_<UUID>",$note:"If not a root subspace, it can be linked to canvas in other subspace"}]};break;case"canvas":var r=N(F.Ji);n={title:i,item_list:[],property:{$definitions:Object.fromEntries(Object.entries(r.propTypes).map(([e,i])=>[e,{...i,description:r.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(r.eventTypes).map(([e])=>[e,{description:r.brickEventDescriptions[e]}]))}},a={property_bank_map:{[(0,Fn.makeId)("property_bank")]:{title:`Canvas ID: ${i}`,type:"string",value:o,routing:"read-only",kind:"auto-generated-item-id",idType:"canvas"}}};break;case"brick":var s=N(F.dK.Basic),d=N(F.eW[t]);if(!d)throw new Error(`Brick ${t} not found`);var c={...d,propTypes:{...s.propTypes,...d.propTypes},brickPropDescriptions:{...s.brickPropDescriptions,...d.brickPropDescriptions},eventTypes:{...s.eventTypes,...d.eventTypes},brickEventDescriptions:{...s.brickEventDescriptions,...d.brickEventDescriptions}};n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(c.propTypes).map(([e,i])=>[e,{...i,description:c.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(c.eventTypes).map(([e])=>[e,{description:c.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(c.outletTypes??{}).map(([e])=>[e,{description:(c.brickOutletDescriptions??{})[e]}]))},state_group:{"BRICK_STATE_GROUP_<UUID>":{}}},a={canvas_map:{"CANVAS_<UUID WHICH NEED DISPLAY THIS BRICK>":{item_list:[{type:"brick",brick_id:o,frame:{x:"number",y:"number",width:"number",height:"number",standby_mode:"custom|top|left|right|bottom",standby_delay:"number",standby_easing:{default:{method:"ease",duration:"number"}}}}]}}};break;case"state_group":n={title:i,description:"State Group Description",conds:[{type:"property_bank|inner_state",key:"PROPERTY_BANK#<Data Node ID>|[current_canvas|BRICK_<OUTLET NAME>]|",method:"==|!=|>|>=|<|<=",value:"value_to_compare"}],override:{property:!1,event:!1,outlet:!1},commented:!1,break:!1,property:{},outlet:{},animation:{}};break;case"generator":var l=N(F.wj[t]);if(!l)throw new Error(`Generator ${t} not found`);n={title:i,template_key:t,property:{$definitions:Object.fromEntries(Object.entries(l.propTypes).map(([e,i])=>[e,{...i,description:l.brickPropDescriptions[e]}]))},event_map:{$definitions:Object.fromEntries(Object.entries(l.eventTypes).map(([e])=>[e,{description:l.brickEventDescriptions[e]}]))},outlet:{$definitions:Object.fromEntries(Object.entries(l.outletTypes).map(([e])=>[e,{description:l.brickOutletDescriptions[e]}]))}};break;case"animation":n={title:i,type:"timing|decay|spring",property:"opacity|transform.translateX|transform.scale|etc",config:{$note:"Config for the animation"},compose_type:"parallel|sequence",item_list:[{animation_id:"ANIMATION_<SUB ANIMATION UUID>"}]};break;case"property_bank":n={title:i,description:"Property Bank Description",linkedFrom:"SUBSPACE_<UUID WHICH IS CROSS SUBSPACE>",type:"string|number|bool|object|array|any",kind:"color|datetime|id|media-resource-*|lottie-file-uri",unit:"grid|px|ms",routing:"read-only|default",value:"fit-to-type",event_map:{$note:`Available events: ${Object.keys(F.qJ.eventTypes).join(", ")}`},local_sync:{update_mode:"all|main-only|minor-only|dont-sync"},$remote_update_additional:{$note:"Configure remote update behavior",enable_remote_update:!0,bank_type:"create|create-device-specific"}};break;case"property_bank_command":break;case"property_bank_calc":var p=(0,Fn.makeId)("property_bank_command"),u=(0,Fn.makeId)("property_bank_command"),m=(0,Fn.makeId)("property_bank_command"),_="const { arg_name } = inputs;\n\nreturn { arg_name };";n={title:i,map:{$note:"Required, actual implementation","PROPERTY_BANK_DATA_NODE_<UUID>":{type:"data-node",properties:{},in:{change:null},out:{value:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID>",port:"value"}]},$note:"Use this to input data to the sandbox"},"PROPERTY_BANK_COMMAND_NODE_<UUID FIRST>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:null,path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},"PROPERTY_BANK_COMMAND_NODE_<UUID SECOND>":{type:"command-node-object",title:"Command: OBJECT_SET",properties:{command:"OBJECT_SET",args:{path:"arg_name"}},in:{obj:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PREVIOUS>",port:"result"}],path:null,value:[{id:"PROPERTY_BANK_DATA_NODE_<UUID SECOND>",port:"value"}]},out:{result:[{id:`PROPERTY_BANK_COMMAND_NODE_<UUID NEXT> | ${p}`,port:"obj | inputs"}]}},[p]:{type:"command-node-sandbox",title:"Command: SANDBOX_RUN_JAVASCRIPT",properties:{command:"SANDBOX_RUN_JAVASCRIPT",args:{code:_,enable_async:!1}},in:{code:null,inputs:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID FINAL>",port:"result"}]},out:{result:[{id:m,port:"result"},{id:u,port:"result"}]}},[m]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_ERROR",properties:{command:"SANDBOX_GET_ERROR"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR>",port:"change"}],$note:"Set `result` as null if there is no error"}},[u]:{type:"command-node-sandbox",title:"Command: SANDBOX_GET_RETURN_VALUE",properties:{command:"SANDBOX_GET_RETURN_VALUE"},in:{result:[{id:p,port:"result"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT> | null",port:"change"}]}},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT>":{type:"data-node",properties:{},in:{change:[{id:u,port:"result"}]},out:{value:null},$note:"Put full result into data node"},"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>":{type:"command-node-object",title:"Command: OBJECT_GET",properties:{command:"OBJECT_GET",args:{path:"obj_key"}},in:{obj:[{id:u,port:"obj"}]},out:{result:[{id:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>",port:"change"}]},$note:"Parse result object into data node"},"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>":{type:"data-node",properties:{},in:{change:[{id:"PROPERTY_BANK_COMMAND_NODE_<UUID PARSE RESULT>",port:"result"}]},out:{value:null},$note:"Put partial result into data node"}},editor_info:{},type:"script",script_config:{title:i,enable_async:!1,inputs:{"PROPERTY_BANK_DATA_NODE_<UUID>":"arg_name"},disabled_triggers:{},error:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE ERROR> | null",output:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE RESULT> | null",outputs:{obj_key:"PROPERTY_BANK_DATA_NODE_<UUID RECEIVE PARTIAL RESULT>"},code:_,$note:"Required, info for GUI editor"}}}return D({id:o,example:n,extraInfo:a})};function qn(e,i){var t,n,a,o,r,s,d,c,l,p,u,_,g,f,y,$,v,h,I,C,T,x,E,B,U,R,O,P,F="user"===i.tokenType,N=((e,i=null)=>({name:t,description:n,inputSchema:a,permission:o},r)=>{K(i,o)&&e.tool(t,n,a,r)})(e,i),q=e=>({...e,...F?{workspace_id:b.Yj().describe("Workspace ID")}:{}}),W=i.client,j=F?function(e){var i=e.endpoint,t=e.accessToken;if(!i)throw new Error("Media API endpoint is required");if(!t)throw new Error("Access token is required");return Tn({endpoint:i,accessToken:t,enableSubscription:!1,enableRetry:!0})}({endpoint:Pn.media,accessToken:i.token}):W,V=e=>F?{fileId:e}:{id:e},G=e=>F?{list:e}:{fileIds:e};if(F&&e.tool("list_workspaces","List all workspaces",{},m(function*(){return D(yield W.workspaces())})),N({name:"get_workspace_overview",description:"Get comprehensive overview of the BRICKS workspace including stats and summary",inputSchema:q({}),permission:"info"},(t=m(function*({workspace_id:e}){var i=yield Promise.all([W.workspace({id:e}),W.applications({workspaceId:e,paginate:{limit:50,offset:0}}),W.modules({workspaceId:e,paginate:{limit:50,offset:0}}),W.devices({workspaceId:e,paginate:{limit:50,offset:0}}),F?j.mediaWorkspace({workspaceId:e}).catch(()=>null):j.mediaWorkspace().catch(()=>null),F?j.mediaBoxes({workspaceId:e}).catch(()=>[]):j.mediaBoxes().catch(()=>[])]),t=w(i,6),n=t[0],a=t[1],o=t[2],r=t[3],s=t[4],d=t[5];if(!n)throw new Error("Authentication failed, please check your token");return D({workspace:n,stats:{applications:a?.length??"No permission",modules:o?.length??"No permission",devices:r?.length??"No permission",running_apps:a?.filter(e=>e.status?.running).length??"No permission",media_boxes:d?.length??"No permission",media_enabled:!!s,notes:"Note: The stats are based on the first 50 applications, modules, and devices in the workspace."},recent_activity:{latest_apps:a?.slice(0,5).map(e=>({id:e._id,name:e.name,status:e.status?.running?"running":"stopped",last_update:e.last_modify_datetime}))||[]},media_info:s?{workspace_id:s.id,name:s.name,size_used:s.size,size_limit:s.sizeLimit,boxes:d?.slice(0,5).map(e=>({id:e.id,name:e.name,size:e.size,description:e.description}))||[]}:{enabled:!1,note:"Media workspace is not enabled for this workspace"}})}),function(e){return t.apply(this,arguments)})),N({name:"get_applications",description:"List all applications in the workspace",inputSchema:q({limit:b.ai().describe("Maximum number of applications to return").optional().default(50),offset:b.ai().describe("Number of applications to skip").optional().default(0)}),permission:"query_application"},(n=m(function*({workspace_id:e,limit:i=50,offset:t=0}){return D(yield W.applications({workspaceId:e,paginate:{limit:i,offset:t}}))}),function(e){return n.apply(this,arguments)})),N({name:"get_application",description:"Get detailed info and config of a specific application",inputSchema:q({id:b.Yj().describe("Application ID")}),permission:"query_application"},(a=m(function*({workspace_id:e,id:i}){return D(yield W.application({workspaceId:e,id:i}))}),function(e){return a.apply(this,arguments)})),N({name:"get_modules",description:"List all modules in the workspace",inputSchema:q({limit:b.ai().describe("Maximum number of modules to return").optional().default(50),offset:b.ai().describe("Number of modules to skip").optional().default(0)}),permission:"query_module"},(o=m(function*({workspace_id:e,limit:i=50,offset:t=0}){return D(yield W.modules({workspaceId:e,paginate:{limit:i,offset:t}}))}),function(e){return o.apply(this,arguments)})),N({name:"get_module",description:"Get detailed info and config of a specific module",inputSchema:q({id:b.Yj().describe("Module ID")}),permission:"query_module"},(r=m(function*({workspace_id:e,id:i}){return D(yield W.module({workspaceId:e,id:i}))}),function(e){return r.apply(this,arguments)})),N({name:"update_module_info",description:"Update a specific module info",inputSchema:q({id:b.Yj().describe("Module ID"),name:b.Yj().describe("Module name"),description:b.Yj().describe("Module description")}),permission:"update_module"},(s=m(function*({workspace_id:e,id:i,name:t,description:n}){return D(yield W.updateModule({workspaceId:e,id:i,name:t,description:n}))}),function(e){return s.apply(this,arguments)})),N({name:"update_module_config",description:"Update a specific module configuration",inputSchema:q({id:b.Yj().describe("Module ID"),config:b.Ik({}).passthrough().describe("New configuration object, see file://docs/config-schema.md for schema reference")}),permission:"update_module"},(d=m(function*({workspace_id:e,id:i,config:t}){var n=yield M(t);if(!n.valid)throw new Error(`Config validation failed: ${n.errors.join(", ")}`);return D(yield W.updateModule({workspaceId:e,id:i,config:JSON.stringify(t),validateConfig:!0}))}),function(e){return d.apply(this,arguments)})),N({name:"get_devices",description:"List all devices in the workspace",inputSchema:q({limit:b.ai().describe("Maximum number of devices to return").optional().default(50),offset:b.ai().describe("Number of devices to skip").optional().default(0)}),permission:"query_device"},(c=m(function*({workspace_id:e,limit:i=50,offset:t=0}){return D(yield W.devices({workspaceId:e,paginate:{limit:i,offset:t}}))}),function(e){return c.apply(this,arguments)})),N({name:"create_application",description:"Create a new BRICKS application with default grid layout",inputSchema:q({name:b.Yj().describe("Application name"),description:b.Yj().describe("Application description").optional(),grid_width:b.ai().describe("Grid width in units").optional().default(96),grid_height:b.ai().describe("Grid height in units").optional().default(54)}),permission:"create_application"},(l=m(function*({workspace_id:e,name:i,description:t,grid_width:n,grid_height:a}){return D(yield W.createApplication({workspaceId:e,name:i,description:t,gridWidth:n,gridHeight:a}))}),function(e){return l.apply(this,arguments)})),N({name:"update_application_info",description:"Update application info",inputSchema:{id:b.Yj().describe("Application ID"),name:b.Yj().describe("Application name"),description:b.Yj().describe("Application description")},permission:"update_application"},(p=m(function*({id:e,name:i,description:t}){return D(yield W.updateApplication({id:e,name:i,description:t}))}),function(e){return p.apply(this,arguments)})),N({name:"update_application_config",description:"Update application configuration with validation",inputSchema:{id:b.Yj().describe("Application ID"),config:b.Ik({}).passthrough().describe("New application configuration. Please read `getting-started` for BRICKS concepts before changing")},permission:"update_application"},(u=m(function*({id:e,config:i}){var t=yield M(i);if(!t.valid)throw new Error(`Config validation failed: ${t.errors.join(", ")}`);return D(yield W.updateApplication({id:e,config:JSON.stringify(i)}))}),function(e){return u.apply(this,arguments)})),N({name:"bind_application",description:"Bind application to device with viewport configuration",inputSchema:{app_id:b.Yj().describe("Application ID"),viewports:b.YO(b.Ik({device_id:b.Yj().describe("Device ID"),x:b.ai().describe("X coordinate"),y:b.ai().describe("Y coordinate"),width:b.ai().describe("Width"),height:b.ai().describe("Height"),rotate:b.ai().describe("Rotation"),rotateType:b.Yj().describe("Rotation type")})).describe("Viewport configuration")},permission:"bind_application"},(_=m(function*({app_id:e,viewports:i}){return D(yield W.bindApplication({id:e,bindDevices:i.map(e=>e.device_id),deviceFrames:i.reduce((e,i)=>({...e,[i.device_id]:{x:i.x,y:i.y,width:i.width,height:i.height,rotate:i.rotate,rotateType:i.rotateType}}),{})}))}),function(e){return _.apply(this,arguments)})),N({name:"unbind_application",description:"Unbind application from device",inputSchema:{app_id:b.Yj().describe("Application ID"),device_id:b.Yj().describe("Device ID")},permission:"bind_application"},(g=m(function*({app_id:e,device_id:i}){return D(yield W.bindApplication({id:e,unbindDevices:[i]}))}),function(e){return g.apply(this,arguments)})),F&&N({name:"list_media_workspaces",description:"List all media workspaces",inputSchema:{},permission:"query_media_flow"},m(function*(){return D(yield j.mediaWorkspaces())})),N({name:"get_media_workspace",description:"Get media workspace information and status",inputSchema:q({}),permission:"query_media_flow"},(f=m(function*({workspace_id:e}){return D(yield j.mediaWorkspace({workspaceId:e}))}),function(e){return f.apply(this,arguments)})),N({name:"list_media_boxes",description:"List all media boxes in the workspace",inputSchema:q({}),permission:"query_media_flow"},(y=m(function*({workspace_id:e}){return D(yield j.mediaBoxes({workspaceId:e}))}),function(e){return y.apply(this,arguments)})),N({name:"get_media_box",description:"Get detailed information about a specific media box",inputSchema:{box_id:b.Yj().describe("Media box ID")},permission:"query_media_flow"},($=m(function*({box_id:e}){return D(yield j.mediaBox({boxId:e}))}),function(e){return $.apply(this,arguments)})),N({name:"list_media_files",description:"List media files in a specific box with filtering options",inputSchema:{box_id:b.Yj().describe("Media box ID"),include_types:b.YO(b.Yj()).optional().describe('Filter by file types (e.g., ["image", "video", "audio"])'),user_tags:b.YO(b.Yj()).optional().describe("Filter by user tags"),limit:b.ai().optional().default(50).describe("Maximum number of files to return"),offset:b.ai().optional().default(0).describe("Number of files to skip")},permission:"query_media_flow"},(v=m(function*({box_id:e,include_types:i,user_tags:t,limit:n,offset:a}){return D(yield j.mediaFiles({boxId:e,includeTypes:i,userTags:t,limit:n,offset:a}))}),function(e){return v.apply(this,arguments)})),N({name:"get_media_file_meta",description:"Get detailed information about a specific media file",inputSchema:{file_id:b.Yj().describe("Media file ID")},permission:"query_media_flow"},(h=m(function*({file_id:e}){return D(yield j.mediaFile(V(e)))}),function(e){return h.apply(this,arguments)})),N({name:"media_box_upload",description:"Upload a file to a media box from URL or base64 data",inputSchema:{box_id:b.Yj().describe("Target media box ID"),name:b.Yj().describe("File name"),description:b.Yj().optional().default("").describe("File description"),file_type:b.k5(["image","video","audio","file"]).describe("File type"),source_url:b.Yj().optional().describe("URL to download the file from"),base64_data:b.Yj().optional().describe("Base64 encoded file data"),user_tags:b.YO(b.Yj()).optional().default([]).describe("User-defined tags for the file")},permission:"write_media_flow"},(I=m(function*({box_id:e,name:i,description:t,source_url:n,base64_data:a,file_type:o,user_tags:r}){if(!n&&!a)throw new Error("Either source_url or base64_data must be provided");if(n&&a)throw new Error("Provide either source_url OR base64_data, not both");var s=n?null:"application/octet-stream",d=n?yield(0,A.Ay)(n,{agent:(0,S.fJ)(n)}).then(e=>(s=e.headers.get("content-type")||"application/octet-stream",e.blob())):new Blob([k.Buffer.from(a,"base64")],{type:s}),c=yield j.requestFileUpload({name:i,description:t,boxId:e,fileType:F?o.toUpperCase():o,contentType:s,userTags:r,meta:{}}),l=!1;try{var p=JSON.parse(c?.meta.uploadInfo),u=new FormData;u.append("file",d),u.append("Content-Type",s),u.append("AWSAccessKeyId",p.AWSAccessKeyId),u.append("Signature",p.Signature),u.append("Policy",p.Policy),u.append("acl",p.acl),u.append("key",p.key),l=yield(0,A.Ay)(p.url,{method:"POST",body:u}).then(e=>e.ok).catch(()=>!1)}catch{l=!1}return D({file_id:c.id,upload_success:l,upload_info:{content_type:s,file_type:o,source_type:n?"url":"base64",processing_note:"File will be processed automatically. Use get_media_file to check processing status."}})}),function(e){return I.apply(this,arguments)})),N({name:"update_media_file_meta",description:"Update media file information",inputSchema:{file_id:b.Yj().describe("Media file ID"),name:b.Yj().optional().describe("New file name"),description:b.Yj().optional().describe("New file description"),user_tags:b.YO(b.Yj()).optional().describe("New user tags")},permission:"write_media_flow"},(C=m(function*({file_id:e,name:i,description:t,user_tags:n}){return D(yield j.updateMediaFile({...V(e),name:i,description:t,userTags:n,requestUploadAgain:!1}))}),function(e){return C.apply(this,arguments)})),N({name:"copy_media_files",description:"Copy media files from one box to another",inputSchema:{from_box_id:b.Yj().describe("Source media box ID"),to_box_id:b.Yj().describe("Target media box ID"),file_ids:b.YO(b.Yj()).describe("Array of media file IDs to copy")},permission:"write_media_flow"},(T=m(function*({from_box_id:e,to_box_id:i,file_ids:t}){return D(yield j.copyMediaFiles({fromBoxId:e,toBoxId:i,...G(t)}))}),function(e){return T.apply(this,arguments)})),N({name:"delete_media_files",description:"Delete specific media files from a box",inputSchema:{box_id:b.Yj().describe("Media box ID"),file_ids:b.YO(b.Yj()).describe("Array of media file IDs to delete")},permission:"write_media_flow"},(x=m(function*({box_id:e,file_ids:i}){return D(yield j.deleteMediaFiles({boxId:e,...G(i)}))}),function(e){return x.apply(this,arguments)})),N({name:"cleanup_media_box",description:"Delete all files in a media box, optionally filtered by type",inputSchema:{box_id:b.Yj().describe("Media box ID"),include_types:b.YO(b.Yj()).optional().describe('Only delete files of these types (e.g., ["image", "video"])')},permission:"write_media_flow"},(E=m(function*({box_id:e,include_types:i}){if("deleteMediaBoxFiles"in j)return D(yield j.deleteMediaBoxFiles({boxId:e,includeTypes:i}));var t=yield j.mediaFiles({boxId:e,includeTypes:i});return D(yield j.deleteMediaFiles({boxId:e,list:t.map(e=>e.id)}))}),function(e){return E.apply(this,arguments)})),e.tool("calculate_grid_layout","Calculate grid layout and pixel conversions for different device resolutions",{device_width:b.ai().describe("Device width in pixels"),device_height:b.ai().describe("Device height in pixels"),app_grid_width:b.ai().describe("Application grid width").optional().default(96),app_grid_height:b.ai().describe("Application grid height").optional().default(54)},(B=m(function*({device_width:e,device_height:i,app_grid_width:t,app_grid_height:n}){var a,o,r={deviceBrickWidth:(a=e)/(o=a/t),deviceBrickHeight:i/o,deviceBrickUnit:o},s=function(e,i,t=96){var n=e/t;return i>e&&(n=i/t),{deviceBrickWidth:Math.round(e/n),deviceBrickHeight:Math.round(i/n),deviceBrickUnit:n}}(e,i,t);return D({device_resolution:{width:e,height:i,aspect_ratio:(e/i).toFixed(2)},current_grid:{width:t,height:n,unit_size_px:r.deviceBrickUnit.toFixed(2),total_pixels:{width:r.deviceBrickWidth.toFixed(2),height:r.deviceBrickHeight.toFixed(2)}},recommended_grid:{width:s.deviceBrickWidth,height:s.deviceBrickHeight,unit_size_px:s.deviceBrickUnit.toFixed(2),note:"Optimized for device aspect ratio"}})}),function(e){return B.apply(this,arguments)})),e.tool("create_item","Use this tool to create new item that you can put in application configuration",{type:b.k5(["subspace","canvas","brick","generator","property_bank","property_bank_calc","property_bank_command","animation","state_group","automation_map"]).describe("Item type"),title:b.Yj().describe("Item title"),template_key:b.Yj().optional().describe("Template key for brick or generator")},Nn),e.tool("getting_started","Get documentation content for getting started",{},m(function*(){return D(Y)})),!F){var L=()=>{return e=Pn.activityLog,t=i.token,new Rn(e,t);var e,t};N({name:"activity_log_events",description:"Query activity log events. Returns raw events (general, data, local_sync) with filtering. Max 30-day range.",inputSchema:q({start_time:b.Yj().describe("Start time (ISO 8601)"),end_time:b.Yj().describe("End time (ISO 8601)"),device_id:b.Yj().optional().describe("Filter by device ID"),event_type:b.k5(["general","data","local_sync"]).optional().describe("Filter by event type"),event_name:b.Yj().optional().describe("Filter by event name (e.g. BRICK_xxx_ON_PRESS)"),subspace_id:b.Yj().optional().describe("Filter by subspace ID"),sender:b.Yj().optional().describe("Filter by sender"),limit:b.ai().optional().default(50).describe("Max events to return per page"),offset:b.ai().optional().default(0).describe("Number of events to skip (for pagination)")}),permission:"query_activity_log"},(O=m(function*({start_time:e,end_time:i,device_id:t,event_type:n,event_name:a,subspace_id:o,sender:r,limit:s=50,offset:d=0}){var c=L(),l={start_time:e,end_time:i};t&&(l.device_id=t),n&&(l.event_type=n),a&&(l.event_name=a),o&&(l.subspace_id=o),r&&(l.sender=r);var p=yield c.events(l,{limit:s,offset:d});return D(p)}),function(e){return O.apply(this,arguments)})),N({name:"activity_log_screenshots",description:"List available screenshot timestamps for a device in a time range.",inputSchema:q({device_id:b.Yj().describe("Device ID (required)"),start_time:b.Yj().describe("Start time (ISO 8601)"),end_time:b.Yj().describe("End time (ISO 8601)")}),permission:"query_activity_log"},(R=m(function*({device_id:e,start_time:i,end_time:t}){var n=L(),a=yield n.screenshots({device_id:e,start_time:i,end_time:t});return D(a)}),function(e){return R.apply(this,arguments)})),N({name:"activity_log_screenshot",description:"Download a device screenshot at a specific timestamp. Returns JPEG image as blob.",inputSchema:q({device_id:b.Yj().describe("Device ID"),ts:b.Yj().describe("Screenshot timestamp (ISO 8601 or epoch ms)")}),permission:"query_activity_log"},(U=m(function*({workspace_id:e,device_id:t,ts:n}){var a=e||i.tokenInfo?.w_id;if(!a)throw new Error("Could not determine workspace ID");var o=L(),r=/^\d+$/.test(n)?n:new Date(n).getTime(),s=yield o.downloadScreenshot(a,t,r);return D(s,{mimeType:"image/jpeg"})}),function(e){return U.apply(this,arguments)}))}N({name:"get_device_usage",description:"Get device usage metrics (uptime, memory, disk) for a date range. Data from BRICKS main server.",inputSchema:q({device_id:b.Yj().describe("Device ID"),start_date:b.Yj().optional().describe("Start date/time in ISO 8601 format (default: start of today)"),end_date:b.Yj().optional().describe("End date/time in ISO 8601 format (default: now)")}),permission:"query_device"},(P=m(function*({device_id:e,start_date:i,end_date:t}){var n=new Date,a=new Date(n.getFullYear(),n.getMonth(),n.getDate()).toISOString(),o=yield W.deviceUsage({deviceId:e,startDate:i?new Date(i).toISOString():a,endDate:t?new Date(t).toISOString():n.toISOString()});return D(o)}),function(e){return P.apply(this,arguments)}))}var Wn="2.24.13";function jn(){return Vn.apply(this,arguments)}function Vn(){return Vn=m(function*(e={}){var i=e.token||process.env.BRICKS_API_TOKEN;if(!i)throw console.error("Error: API token is required"),console.error("Please provide a token via options or set BRICKS_API_TOKEN environment variable"),new Error("API token is required");var t=h({queryStringParameters:{token:i}});if(!t.success)throw console.error("Error: Invalid BRICKS_API_TOKEN"),console.error(t.message),new Error("Invalid BRICKS_API_TOKEN");var n,a,o=new _._({name:Mn,version:Wn}),r={...t,client:On(Pn.bricks,t.token,t.tokenType)};(n=o).prompt("getting-started","Getting started with BRICKS",{},m(function*(){return{messages:[{role:"user",content:{type:"text",text:'Welcome to BRICKS — start here.\n\nBefore doing any complex work (application design, deployments, etc.),\nalways consult the official docs rather than guessing.\n\nIMPORTANT: BRICKS users interact through a GUI editor, not raw config files.\nNever show users JSON config details, schema fields, or technical implementation.\nFocus on user-friendly descriptions of what the app will do and how it will look.\n\nGolden rules for working with BRICKS:\n1) Read before you act\n - Open these resources first, then proceed:\n - `getting-started` — overview & architecture\n - `config-schema` — canonical schema for apps, subspaces, bricks, generators, etc.\n - `components-index` — available bricks/generators\n2) Source of truth\n - Rely on the docs above; do not invent fields not present in the schema\n3) No guessing\n - If names, constraints, or device details are missing, ask to fetch them first\n4) Plan then execute\n - Propose a clear step-by-step plan and wait for approval before writing or mutating data\n5) User-friendly communication\n - Describe features in terms of what users see and do, not technical config\n - Use visual/functional language: "text display", "button", "screen transition"\n - Avoid exposing JSON, IDs, or schema details to end users\n\nBRICKS essentials:\n- Applications: interactive digital signage experiences\n- Devices: deployment targets (screens/players)\n- Modules: Reusable module across applications\n- Grid system: default 96×54; 1 unit = device_width/96 (e.g., 20px at 1920×1080)\n- Key primitives: Subspaces, Canvas, Bricks, Generators, Property Banks (Data)\n\nQuick actions:\n- "Create a new application" → use the `create-application` prompt\n- "Deploy an application to a device" → use the `deploy-to-device` prompt\n\nTry asking:\n- "Draft a plan to create an app with a text display and deploy it; ask any missing questions first"'}}]}})),n.prompt("create-application","Create a new BRICKS application with guided setup",{app_name:b.Yj().describe("Name for the new application"),description:b.Yj().describe("Short description for the new application").optional()},(a=m(function*(e){var i=e?.app_name||"New Application",t=e?.description||"";return{messages:[{role:"user",content:{type:"text",text:`Help me create a new BRICKS application called "${i}".\n\n${t?`Goal: ${t}`:""}\n\nIMPORTANT: Users see a visual GUI editor, not raw config. Describe features in user-friendly terms:\n- "text display" not "BRICK_TEXT"\n- "image" not "BRICK_IMAGE"\n- "canvas name" not "CANVAS_xxx"\n- "data storage" not "PROPERTY_BANK"\n- Focus on what users see and do, not technical implementation\n\nHow we'll proceed (no guessing, schema-first):\n1) Confirm intent\n - Restate objectives and success criteria in 1–3 bullets\n2) Consult docs (as needed)\n - getting-started, config-schema, components-index\n - Ensure proposed fields exist in the schema\n3) Ask missing questions before changes\n - Target device(s) and resolution(s)\n - Layout needs (pages/screens), content types, data sources\n - Localization, scheduling, or interaction needs\n4) Propose a minimal viable design (After confirming intent)\n - App structure: screens → visual elements\n - Initial component selection with rationale\n - Grid usage: default 96×54 (≈20px at 1920×1080)\n5) Produce a schema-valid skeleton (no side effects yet)\n - Include only fields defined by config-schema\n - Use clear placeholders for text/assets/URLs/ids\n\nWhat I'll produce first:\n- Short recap of requirements\n- Clarifying questions (only what's necessary)\n- High-level architecture plan\n- Minimal config skeleton that validates against the schema`}}]}}),function(e){return a.apply(this,arguments)})),function(e){e.resource("getting-started-docs","file://docs/getting-started.md",{mimeType:"text/markdown",title:"Getting Started with BRICKS",description:"Comprehensive guide to BRICKS architecture, concepts, and development workflow"},m(function*(){return D(I,{uri:"file://docs/getting-started.md",mimeType:"text/markdown"})}))}(o),qn(o,r);var s=new g.S;try{yield o.connect(s),console.error("BRICKS MCP Server running on STDIO"),console.error(`Server: ${Mn} v${Wn}`),console.error(`Token Type: ${t.tokenType}`),console.error(`Permissions: ${t.tokenInfo.permissions.join(", ")}`),console.error("Ready to accept requests...")}catch(e){throw console.error("Failed to start MCP server:",e),e}}),Vn.apply(this,arguments)}}};
|
package/lib/890.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const __webpack_esm_id__=890;export const __webpack_esm_ids__=[890];export const __webpack_esm_modules__={1639:(e,t,r)=>{const{v4:a}=r(79194);t.getIDPattern=e=>`^${e}_[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`,t.autoGeneratorIDPrefix="AUTO_GENERATOR_",t.makeId=e=>{let r="";switch(e){case"animation":r="ANIMATION_";break;case"brick":r="BRICK_";break;case"dynamic-brick":r="DYNAMIC_BRICK_";break;case"subspace":r="SUBSPACE_";break;case"canvas":r="CANVAS_";break;case"generator":r="GENERATOR_";break;case"auto-generator":r=t.autoGeneratorIDPrefix;break;case"data":case"property_bank":r="PROPERTY_BANK_DATA_NODE_";break;case"property_bank_command":r="PROPERTY_BANK_COMMAND_NODE_";break;case"property_bank_calc":r="PROPERTY_BANK_COMMAND_MAP_";break;case"automation_map":r="AUTOMATION_MAP_";break;case"test":r="TEST_";break;case"test_case":r="TEST_CASE_";break;case"test_var":r="TEST_VAR_";break;case"state_group":r="BRICK_STATE_GROUP_"}return`${r}${a()}`};const n=/[$()*+.?[\\\]^{|}]/g;t.replaceMultiple=(e,t)=>{const r=Object.keys(t).sort((e,t)=>t.length-e.length);if(0===r.length)return e;const a=new RegExp(r.map(e=>e.replace(n,"\\$&")).join("|"),"g");return e.replace(a,e=>t[e])}},5982:(e,t,r)=>{const{getIDPattern:a}=r(1639),n=a("BRICK_STATE_GROUP");e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/state_group.schema.json5",title:"State Group",description:"A state group config",type:"object",patternProperties:{[n]:{type:"object",properties:{title:{type:"string",description:"State Group Title"},description:{type:"string",description:"State Group Description"},conds:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["property_bank","property_bank_by_item_key","inner_state"]},key:{type:"string"},method:{type:"string",enum:["==","!=",">",">=","<","<="]}}}},commented:{type:"boolean",description:"If true, this state group will not be used."},override:{type:"object",properties:{property:{type:"boolean"},event:{type:"boolean"},outlet:{type:"boolean"},animation:{type:"boolean"}}},break:{type:"boolean",description:"If true, this state group will stop checking next state groups."},property:{type:"object"},event_map:{$ref:"http://display.bricks.tools/event_map.schema.json5",description:"Use event map describe how event should go."},outlet:{type:"object"},animation:{type:"object"}}}}}},7436:(e,t,r)=>{const{docs:a}=r(5867),n=e=>`^${e}_[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`;t.propertyBank={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/property_bank.schema.json5",title:"Property Bank",description:"A data storage config file.",type:"object",properties:{alias:{type:"string",description:"Optional alias for this data node, used as variable name in code generation."},linkedFrom:{type:["string","null"],description:"ID of linked from another subspace or not",pattern:n("SUBSPACE")},title:{type:"string",description:"This property bank's name."},description:{type:"string",description:"This property bank's description."},type:{type:"string",enum:["string","number","array","object","bool","any"]},routing:{type:["string","null"],enum:["default","read-only"]},preload:{type:["object","null"]},kind:{type:["string","null"]},unit:{type:["string","null"]},value:{},event_map:{$ref:"http://display.bricks.tools/event_map.schema.json5",description:"Use event map describe how event should go."},enable_remote_update:{type:["boolean","null"],description:"Enable remote update on this data node. (If Workspace have enable this feature)"},global_remote_update_prop:{type:["string","null"]},use_remote_id_prefix:{type:["boolean","null"]},local_sync:{type:"object",description:"Define property behavior on Local Sync mode.",properties:{update_mode:{type:"string",enum:["all","main-only","minor-only","dont-sync"]}}}},required:["type"]};const p=n("PROPERTY_BANK_(DATA_NODE|COMMAND_NODE)");t.propertyBankCommand={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/property_bank_command.schema.json5",title:"Property Bank Commands",description:"Property Bank Calculation",type:"object",properties:{type:{type:"string",enum:["data-node",...Object.keys(a).map(e=>`command-node-${e}`)]},title:{type:"string",description:"This property bank command's name."},note:{type:"string",description:"This property bank command's note."},properties:{type:"object",description:"The node properties"},in:{type:"object",description:"The node inputs",patternProperties:{"^.+$":{type:["array","null"],items:{type:"object",properties:{port:{type:"string"},id:{type:"string",pattern:p},disable_trigger_command:{type:"boolean"}},required:["id","port"]}}}},out:{type:"object",description:"The node outputs",patternProperties:{"^.+$":{type:["array","null"],items:{type:"object",properties:{port:{type:"string"},id:{type:"string",pattern:p}},required:["id","port"]}}}}},required:["type","properties","in","out"]},t.propertyBankCalcScriptConfig={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/property_bank_calc_script_config.schema.json5",title:"Property Bank Calulation Script Config",description:"JavaScript Sandbox calculation config",type:"object",properties:{code:{type:["string","null"]},inputs:{type:"object",patternProperties:{[n("PROPERTY_BANK_DATA_NODE")]:{type:"string"}},additionalProperties:!1},output:{type:["string","null"]},error:{type:["string","null"]},outputs:{type:"object",patternProperties:{"^.+$":{type:"array",items:{type:"string",pattern:n("PROPERTY_BANK_DATA_NODE")}}}}},required:["inputs","outputs","code"]}},12062:(e,t)=>{t.checkMethodFinished=e=>{const[t,...r]=e;switch(t){case"brick_press":{const[,e]=r;return!!e}case"wait_until_brick_exists":case"brick_exists":{const[,e]=r;return!!e}case"wait_until_canvas_change":{const[,e]=r;return!!e}case"wait_until_event_trigger":{const[,e,t]=r;return!!e&&!!t}case"keydown":case"keyup":{const[e,t]=r;return!!e||!!t}case"http_request":{const[e]=r;return!!e}case"assert_property":case"wait_until_property_change":{const[,e,t]=r;return!!e&&void 0!==t}case"execute_action":{const[,e,t]=r;return!!e&&!!t}case"match_screenshot":const[e]=r;return!!e;case"delay":case"do_nothing":return!0;default:return!1}}},18501:(e,t,r)=>{const{docs:a}=r(5867);t.isCommand=e=>Boolean(e&&e.type&&e.type.startsWith("command-node-")),t.getPorts=e=>e?Array.isArray(e)?e:[e]:[];t.getCommandCallbackFromPort=(e,r)=>{const n=e[r];if(!t.isCommand(n))return null;const p=(e=>a[e.type.replace("command-node-","")]?.commands?.[e.properties?.command])(n);return p?.iterateeFrom||p?.invocationFrom||null},t.checkDisableTriggerCommand=(e,r)=>t.getPorts(e[r.id]?.in?.[r.port]).some(e=>e?.disable_trigger_command);const n=(e,r,a)=>!(!r||!e[r.id])&&(r.port!==((e,r,a)=>(a.has(r)||a.set(r,t.getCommandCallbackFromPort(e,r)),a.get(r)))(e,r.id,a)&&!t.checkDisableTriggerCommand(e,r));t.findCircularReferenceIds=e=>{const r=(e=>{const r=new Map;return Object.keys(e).reduce((a,p)=>{const o=[];return Object.values(e[p]?.out||{}).forEach(a=>{t.getPorts(a).forEach(t=>{n(e,t,r)&&o.push(t.id)})}),a[p]=o,a},{})})(e),a=new Map;return Object.keys(e).filter(t=>"data-node"===e[t]?.type).filter(e=>((e,t,r)=>{if(r.has(e))return r.get(e);const a=[{id:e,edgeIndex:0,reachesCycle:!1}],n=new Set([e]);for(;a.length>0;){const e=a[a.length-1],p=t[e.id]||[];if(e.reachesCycle||e.edgeIndex>=p.length){n.delete(e.id),r.set(e.id,e.reachesCycle),a.pop(),e.reachesCycle&&a.length>0&&(a[a.length-1].reachesCycle=!0);continue}const o=p[e.edgeIndex];e.edgeIndex+=1,r.has(o)?r.get(o)&&(e.reachesCycle=!0):n.has(o)?e.reachesCycle=!0:(n.add(o),a.push({id:o,edgeIndex:0,reachesCycle:!1}))}return r.get(e)||!1})(e,r,a))},t.hasCircularReference=e=>t.findCircularReferenceIds(e).length>0;const p=(e={})=>Object.entries(e).reduce((e,[t,r])=>(e[t]=(e=>Array.isArray(e)?e.slice():e)(r),e),{}),o=new WeakSet,i=(e,t,r)=>{if(!r)return;const a=((e,t)=>{const r=e[t];if(!r)return e[t]=[],e[t];if(!Array.isArray(r))return e[t]=[r],e[t];if(!o.has(r)){let e=0;for(const t of r)t&&(r[e]=t,e+=1);r.length=e,o.add(r)}return r})(e,t);(Array.isArray(r)?r:[r]).forEach(e=>{e&&a.push(e)})};t.composeMap=e=>Object.values(e).reduce((e,r)=>Object.entries(r?.map||{}).reduce((e,[r,a])=>{if(e[r]){if(t.isCommand(a))throw new Error(`Doesn't allow same command id in another map, ${r}`);const n=e[r];Object.keys(a?.in||{}).forEach(e=>{i(n.in,e,a.in[e])}),Object.keys(a?.out||{}).forEach(e=>{i(n.out,e,a.out[e])})}else e[r]={...a,in:p(a?.in),out:p(a?.out)};return e},e),{})},24090:e=>{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/animation.schema.json5",title:"Animtation",description:"A brick animation config",type:"object",oneOf:[{properties:{alias:{type:"string"},title:{type:"string"},description:{type:"string"},animationRunType:{type:"string",enum:["once","loop"]},type:{type:"string",enum:["timing","decay","spring"]},property:{type:"string",enum:["opacity","transform.translateX","transform.translateY","transform.scale","transform.scaleX","transform.scaleY","transform.rotate","transform.rotateX","transform.rotateY"]},config:{type:"object"}},required:["type","property","config"]},{properties:{alias:{type:"string"},title:{type:"string"},compose_type:{type:"string",enum:["parallel","sequence"]},item_list:{type:"array",items:{type:"object",properties:{animation_id:{type:"string"}}}}},required:["compose_type","item_list"]}]}},27449:(e,t,r)=>{const{getIDPattern:a}=r(1639);e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/brick.schema.json5",title:"Brick",description:"A brick config",type:"object",properties:{alias:{type:"string",description:"Optional alias for this brick, used as variable name in code generation."},title:{type:"string",description:"This brick's name."},description:{type:"string",description:"This brick's description."},template_key:{type:"string"},property:{type:"object"},event_map:{$ref:"http://display.bricks.tools/event_map.schema.json5",description:"Use event map describe how event should go."},outlet:{type:"object",patternProperties:{"^BRICK_(.)+$":{type:"string",pattern:a("PROPERTY_BANK_DATA_NODE")}},additionalProperties:!1},state_group:{$ref:"http://display.bricks.tools/state_group.schema.json5",description:"Use state group to describe how to transform property, event and outlet."},primary_component:{type:"boolean",default:!1,description:"Mark this brick as a primary component for easier discovery in Runtime Editor."}},required:["template_key"]}},37517:(e,t,r)=>{const{composeMap:a,findCircularReferenceIds:n}=r(18501);e.exports=function(e){const t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{if(r.module?.link)return;const p=r.property_bank_calc_map;if(!p||0===Object.keys(p).length)return;const o=`subspace_map.${e}.property_bank_calc_map`;try{const e=a(p),r=n(e);if(r.length>0){const a=r.slice(0,5).map(t=>e[t].title||t),n=r.length>5?` and ${r.length-5} more`:"";t.push({field:o,message:`Circular reference detected in data calculation. Affected nodes: ${a.join(", ")}${n}. Please check the data connections for loops.`})}}catch(e){t.push({field:o,message:e.message})}}),t}},38890:(e,t,r)=>{const{getDocByTemplateKey:a}=r(63981),n=r(80211),p=r(45907),o=r(37517),i=r(78078),{getBrickName:s}=r(86343);t.checkConfigDeprecatedFeatures=e=>{const t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{Object.entries(r.brick_map||{}).forEach(([n,p])=>{void 0===p.property?.borderLeftWidth&&void 0===p.property?.borderRightWidth&&void 0===p.property?.borderTopWidth&&void 0===p.property?.borderBottomWidth||t.push({id:n,name:"Used Deprecated Feature",data:`In v2.16, we have been changed \`Border Width\` to \`Border Size\` (Unit \`px\` to \`grid\`). The \`${s("brick",p,n)}\` brick still used the border width. Please re-edit it to transfer to the new unit.`});const o=a(p.template_key);o?.brickMeta?.deprecated&&t.push({id:n,name:"Used Deprecated Feature",data:`The \`${s("brick",p,n)}\` brick in \`${s("subspace",r,e)}\` have been deprecated, it may not work in the future, please consider to remove it. If you can't see the item, please enable \`Show Deprecated Features\` in setting.`})}),Object.entries(r.generator_map||{}).forEach(([n,p])=>{const o=a(p.template_key);o?.brickMeta?.deprecated&&t.push({id:n,name:"Used Deprecated Feature",data:`The \`${s("brick",p,n)}\` brick in \`${s("subspace",r,e)}\` have been deprecated, it may not work in the future, please consider to remove it. If you can't see the item, please enable \`Show Deprecated Features\` in setting.`})})}),t},t.checkConfig=(e,t={})=>{const r={schema:n(e),ref:p(e,t),calc:t.checkCalc?o(e):[],expression:t.checkExpressions?i(e):[]};return r.valid=0===r.schema.length&&0===r.ref.length&&0===r.calc.length&&0===r.expression.length,r.message=r.schema.concat(r.ref).concat(r.calc).concat(r.expression).map(({instancePath:e,field:t,message:r})=>{const a=e||t;return a?`${a}: ${r}`:r}).join("\n"),r}},41900:e=>{e.exports={expressionFoldAcornOptions:{ecmaVersion:2022,allowReturnOutsideFunction:!0,allowAwaitOutsideFunction:!0},getUnfoldableStatementDescription:(e,t=null)=>{for(let t=0;t<e.length;t+=1){const r=e[t];if("ExpressionStatement"!==r.type){if("VariableDeclaration"===r.type){if(r.declarations.some(e=>"Identifier"!==e.id.type||!e.init))return"a variable declaration with destructuring or no initializer";continue}if(t!==e.length-1||"ReturnStatement"!==r.type)return`an unsupported ${r.type}`}}return t}}},45907:(e,t,r)=>{const{getDocByTemplateKey:a}=r(63981),{systemActions:n}=r(49741),{checkMethodFinished:p}=r(12062),o=(e,t,r)=>{const a=e[t];return a?r?!r[a]&&`The entry of \`${t}\` is not defined in the map.`:"The map is not defined":`\`${t}\` is not defined.`},i=(e,t=[])=>{t.forEach(t=>{e.push(t)})},s="PROPERTY_BANK#",c=[],d=["BRICK_GRID","BRICK_STICKER","BRICK_CHART_LINE","BRICK_CHART_BAR","BRICK_CHART_PIE","BRICK_CHART_PROGRESS","BRICK_3D_VIEWER","GENERATOR_PROMPT","GENERATOR_MEDIA_RESOURCE","GENERATOR_TEXT_INPUT_CONTROLLER","GENERATOR_CAMERA_CONTROLLER","GENERATOR_WEBVIEW_CONTROLLER","GENERATOR_FILE_READER","GENERATOR_URL_FILE_SYNC","GENERATOR_TENSORFLOW_INFERENCE","GENERATOR_TAPPAY_T2P_IOS"],y=(e,t,r,p,o,i,s)=>{const y=[];if(!r)return y.push({field:`${t}.template_key`,message:"`template_key` is not defined."}),y;if(c.includes(r)||d.includes(r))return y;return a(r)?Object.entries(p||{}).reduce((e,[r,p])=>Array.isArray(p)?(p.forEach((p,c)=>{if(!p||"object"!=typeof p)return void e.push({field:`${t}.event_map.${r}.${c}`,message:"The event handler must be an object."});const{handler:d,action:y,parameter_list:l}=p;if("SYSTEM"===d){n[y]||e.push({field:`${t}.event_map.${r}.${c}.action`,message:`SYSTEM action ${y} is not found in the definition.`});const a=n[y];return!a?.canProvideProperty&&l&&l.length>0&&e.push({field:`${t}.event_map.${r}.${c}.parameter_list`,message:`SYSTEM action ${y} is not allowed to provide property.`}),void("PROPERTY_BANK"!==y&&"PROPERTY_BANK_COMMAND"!==y||(l||[]).forEach((a,n)=>{const p=a?.input_to_receiver;"string"==typeof p&&p.startsWith("PROPERTY_BANK_")||e.push({field:`${t}.event_map.${r}.${c}.parameter_list.${n}.input_to_receiver`,message:`SYSTEM action ${y} requires \`input_to_receiver\` to start with \`PROPERTY_BANK_\`.`})}))}const m=i[d]||s[d]||o[d];if(!m)return void e.push({field:`${t}.event_map.${r}.${c}.handler`,message:`The handler ${d} is not found in the brick map, generator map, or subspace map.`});const _=a(m.template_key);if(!_)return;if(!_.actionTypes||!_.actionTypes[y])return void e.push({field:`${t}.event_map.${r}.${c}.action`,message:`The event action ${y} is not defined in the handler ${m.template_key}.`});!_.actionTypes[y].canProvideProperty&&l&&l.length>0&&e.push({field:`${t}.event_map.${r}.${c}.parameter_list`,message:`The event action ${y} in the handler ${m.template_key} is not allowed to provide property.`})}),e):(e.push({field:`${t}.event_map.${r}`,message:"The event content must be an array."}),e),y):(y.push({field:`${t}.template_key`,message:`Template ${r} is not found.`}),y)},l=e=>"string"==typeof e&&e.startsWith("VARIABLE#"),m={brick_press:{subspaceScopedMaps:{0:"subspace",1:"brick_map"}},brick_exists:{subspaceScopedMaps:{0:"subspace",1:"brick_map"}},wait_until_brick_exists:{subspaceScopedMaps:{0:"subspace",1:"brick_map"}},wait_until_canvas_change:{subspaceScopedMaps:{0:"subspace",1:"canvas_map"}},wait_until_event_trigger:{subspaceScopedMaps:{0:"subspace"},dynamicArgs:{1:{name:"sender"}}},assert_property:{subspaceScopedMaps:{0:"subspace",1:"property_bank_map"}},wait_until_property_change:{subspaceScopedMaps:{0:"subspace",1:"property_bank_map"}},execute_action:{subspaceScopedMaps:{0:"subspace"},dynamicArgs:{1:{name:"handler",allowedLiterals:["SYSTEM"]}}}},_=[{prefix:"BRICK_",map:"brick_map"},{prefix:"GENERATOR_",map:"generator_map"},{prefix:"CANVAS_",map:"canvas_map"},{prefix:"PROPERTY_BANK_",map:"property_bank_map"},{prefix:"SUBSPACE_",map:"subspace_map"}],u=(e,t,r,a,n)=>!r||l(r)||n&&n[r]?null:{field:`${e}.run.${t+1}`,message:`The entry \`${r}\` is not defined in \`${a}\`.`},b=(e,t,r,a)=>{const n=[],[p,...o]=t||[],i=m[p];if(!i)return n;const s=Object.entries(i.subspaceScopedMaps||{}).find(([,e])=>"subspace"===e)?.[0],c=(null!=s?o[Number(s)]:void 0)||a,d=c&&!l(c)?r[c]:null;return Object.entries(i.subspaceScopedMaps||{}).forEach(([t,a])=>{const p=Number(t),i=o[p];if("subspace"===a){const t=u(e,p,i,"subspace_map",r);return void(t&&n.push(t))}if(!d)return;const s=u(e,p,i,a,d[a]);s&&n.push(s)}),Object.entries(i.dynamicArgs||{}).forEach(([t,a])=>{const p=Number(t),i=o[p];if(!i||l(i))return;if(a.allowedLiterals?.includes(i))return;const s=(e=>"string"!=typeof e?null:_.find(({prefix:t})=>e.startsWith(t))||null)(i);if(!s)return void n.push({field:`${e}.run.${p+1}`,message:`\`${i}\` has no recognizable ID prefix.`});const c="subspace_map"===s.map?r:d?.[s.map];if("subspace_map"!==s.map&&!d)return;const y=u(e,p,i,s.map,c);y&&n.push(y)}),n},E=(e,t,r,a)=>{const n=[];return Object.entries(t?.case_map||{}).forEach(([t,o])=>{o?.commented||p(o?.run||[])&&i(n,b(`${e}.case_map.${t}`,o.run,r,a))}),n};e.exports=function(e,t={}){const r=[],a=o(e,"root_subspace_id",e.subspace_map);return a&&r.push({field:"root_subspace_id",message:a}),Object.entries(e.subspace_map||{}).forEach(([t,a])=>{if(a.module?.link)return;const n=o(a,"root_canvas_id",a.canvas_map);n&&r.push({field:`subspace_map.${t}.root_canvas_id`,message:n}),Object.entries(a.canvas_map||{}).forEach(([n,p])=>{i(r,((e,t=[],r={},a={},n)=>t.reduce((t,p,o)=>{const i={};switch(p.type){case"brick":i.field=`${e}.${o}.brick_id`,p.brick_id?r[p.brick_id]||(i.message="The entry of `brick_id` is not defined in the map."):i.message="`brick_id` is not defined.";break;case"subspace":i.field=`${e}.${o}.subspace_id`,p.subspace_id?a[p.subspace_id]?n===p.subspace_id&&(i.message="Root Subspace can't be referenced as a Canvas item"):i.message="The entry of `subspace_id` is not defined in the map.":i.message="`subspace_id` is not defined."}return i.message&&t.push(i),t},[]))(`subspace_map.${t}.canvas_map.${n}.item_list`,p.item_list,a.brick_map,e.subspace_map,e.root_subspace_id))}),Object.entries(a.brick_map||{}).forEach(([n,p])=>{i(r,((e,t={},r={})=>Object.entries(t).reduce((t,[a,n])=>{const p={field:`${e}.key`};return"string"==typeof n&&n.startsWith(s)&&!r[n.replace(s,"")]&&(p.message=`Property \`${a}\` (content: \`${n}\`) is not defined in the map.`),p.message&&t.push(p),t},[]))(`subspace_map.${t}.brick_map.${n}.property`,p.property,a.property_bank_map)),i(r,y(0,`subspace_map.${t}.brick_map.${n}`,p.template_key,p.event_map,e.subspace_map||{},a.generator_map||{},a.brick_map||{}))}),Object.entries(a.generator_map||{}).forEach(([n,p])=>{i(r,y(0,`subspace_map.${t}.generator_map.${n}`,p.template_key,p.event_map,e.subspace_map||{},a.generator_map||{},a.brick_map||{}))}),Object.entries(a.property_bank_map||{}).forEach(([n,p])=>{i(r,y(0,`subspace_map.${t}.property_bank_map.${n}`,"PROPERTY_BANK",p.event_map,e.subspace_map||{},a.generator_map||{},a.brick_map||{}))})}),t.checkAutomation&&i(r,(e=>{const t=[],r=e.subspace_map||{},a=e.root_subspace_id,n=e.automation_map||{},p=Object.keys(n).length>0;return Object.entries(n).forEach(([e,n])=>{Object.entries(n?.map||{}).forEach(([n,p])=>{i(t,E(`automation_map.${e}.map.${n}`,p,r,a))})}),p||Object.entries(e.test_map||{}).forEach(([e,n])=>{i(t,E(`test_map.${e}`,n,r,a))}),t})(e)),r}},49741:(e,t,r)=>{const a=r(95479),{animationRunTypes:n,autoGeneratedItemIdKind:p}=r(99470);t.systemActionDescriptions={PROPERTY_BANK_EXPRESSION:{default:"","en-us":"Change Data value with script expression. One expression of return value","zh-tw":"使用腳本表達式改變 Data 值。 一個表達式回傳值","ja-jp":"スクリプト式を使用して Data の値を変更する。1つの式で値を返す"},PROPERTY_BANK:{default:"","en-us":"Change Data value","zh-tw":"改變 Data 值","ja-jp":"Data の値を変更する"},PROPERTY_BANK_COMMAND:{default:"","en-us":"Trigger Data calculation flow without value change","zh-tw":"不需改變值,觸發 Data 計算流程","ja-jp":"値を変更せずに Data の計算フローをトリガーする"},DYNAMIC_BRICK:{default:"","en-us":"[Unstable] Dynamically generate bricks","zh-tw":"[Unstable] 動態地産生 Bricks","ja-jp":"動的に生成されたブリック"},DYNAMIC_BRICK_RESET:{default:"","en-us":"[Unstable] Reset Dynamic Bricks","zh-tw":"[Unstable] 重設 Dynamic Bricks","ja-jp":"動的に生成されたブリックをリセットする"},DYNAMIC_ANIMATION:{default:"","en-us":"Run specific Animation on specific Brick","zh-tw":"在指定的 Brick 上運行指定的 Animation","ja-jp":"指定されたブリックで指定されたアニメーションを実行する"},DYNAMIC_ANIMATION_RESET:{default:"","en-us":"Reset Dynamic Animation","zh-tw":"重設 Dynamic Animation","ja-jp":"動的なアニメーションをリセットする"},DYNAMIC_ANIMATION_STOP:{default:"","en-us":"Stop Dynamic Animation","zh-tw":"停止 Dynamic Animation","ja-jp":"動的なアニメーションを停止する"},CHANGE_CANVAS:{default:"","en-us":"Change canvas on the current Subspace","zh-tw":"在當前的 Subspace 中切換 Canvas","ja-jp":"現在の Subspace の Canvas を変更する"},MESSAGE:{default:"","en-us":"Log System message","zh-tw":"Log System message","ja-jp":"システムメッセージをログに記録する"},ALERT:{default:"","en-us":"Show system alert popup with custom message","zh-tw":"顯示自定義訊息的系統警告彈窗","ja-jp":"カスタムメッセージを使用してシステム警告ポップアップを表示する"},POPUP_RESET:{default:"","en-us":"Close current showing popups with type or id.","zh-tw":"關閉目前顯示的 Popup,可以指定 Popup 類型或 id。","ja-jp":"現在表示されているポップアップを閉じる、または ID で指定されたポップアップを閉じる。"},TAKE_SCREENSHOT:{default:"","en-us":"Take screenshot for current subspace or the full viewport (including portal subspaces)","zh-tw":"為當前的 Subspace 截圖,或截取整個顯示畫面(包含 Portal Subspace)","ja-jp":"現在の Subspace またはビューポート全体(Portal Subspace を含む)のスクリーンショットを撮る"},STORAGE_SET:{default:"","en-us":"Store a value in application-specific storage","zh-tw":"在應用程式特定的儲存空間中儲存值","ja-jp":"アプリケーション固有のストレージに値を保存する"},STORAGE_RETRIEVE:{default:"","en-us":"Retrieve a value from application-specific storage","zh-tw":"從應用程式特定的儲存空間中取得值","ja-jp":"アプリケーション固有のストレージから値を取得する"},STORAGE_DELETE:{default:"","en-us":"Delete a value from application-specific storage or clear all values","zh-tw":"從應用程式特定的儲存空間中刪除值或清除所有值","ja-jp":"アプリケーション固有のストレージから値を削除するか、すべての値をクリアする"},CHANNEL_SUBSCRIBE:{default:"","en-us":"Subscribe to a channel for data update","zh-tw":"訂閱一個 Channel 以接收資料更新","ja-jp":"チャンネルを購読してデータ更新を受け取る"},CHANNEL_UNSUBSCRIBE:{default:"","en-us":"Unsubscribe from a channel","zh-tw":"取消訂閱一個 Channel","ja-jp":"チャンネルから購読を解除する"},CHANNEL_PUBLISH:{default:"","en-us":"Publish data to a channel","zh-tw":"發布資料到一個 Channel","ja-jp":"チャンネルにデータを発行する"},DELAY:{default:"","en-us":"Delay for a certain time between actions","zh-tw":"延遲一段時間,用於兩個動作之間","ja-jp":"一定時間遅延する、2つのアクションの間"},USE_SHARE_APPLICATION:{default:"","en-us":"[Internal] Use a shared application","zh-tw":"[Internal] 切換到分享的應用程式","ja-jp":"[Internal] 共有アプリケーションを使用する"},AUTH_IN_DEVICE:{default:"","en-us":"[Internal] Auth in device","zh-tw":"[Internal] 在裝置上進行帳號登入","ja-jp":"[Internal] デバイスで認証する"},REFRESH_BINDCODE:{default:"","en-us":"[Internal] Refresh passcode for bind device","zh-tw":"[Internal] 更新裝置綁定碼","ja-jp":"[Internal] デバイスのバインドコードを更新する"},OPEN_URL:{default:"","en-us":"Open URL","zh-tw":"開啟 URL","ja-jp":"URL を開く"},OPEN_FILE:{default:"","en-us":"Open File or Directory","zh-tw":"開啟檔案或目錄","ja-jp":"ファイルまたはディレクトリを開く"},THROW_EXCEPTION:{default:"","en-us":"Throw exception","zh-tw":"拋出例外","ja-jp":"例外を投げる"},RESTART_FOUNDATION:{default:"","en-us":"Restart the foundation (React Native bundle)","zh-tw":"重新啟動基礎設施 (React Native bundle)","ja-jp":"基盤を再起動する (React Native bundle)"},DISMISS_KEYBOARD:{default:"","en-us":"Dismiss keyboard","zh-tw":"關閉鍵盤","ja-jp":"キーボードを閉じる"},TRIGGER_APPLICATION_FILTER:{default:"","en-us":"Trigger application AI filter","zh-tw":"觸發應用程式 AI 過濾器","ja-jp":"アプリケーション AI フィルターをトリガーする"},STOP_APPLICATION_FILTER:{default:"","en-us":"Stop running application AI filter","zh-tw":"停止運行中的應用程式 AI 過濾器","ja-jp":"実行中のアプリケーション AI フィルターを停止する"},SAVE_UPDATE_SNAPSHOT:{default:"","en-us":"Save update snapshot (from Application Filter or DevTools MCP Server) to media system","zh-tw":"儲存更新快照 (來自 Application Filter 或 DevTools MCP Server) 到媒體系統","ja-jp":"メディアシステムに更新スナップショット (Application Filter または DevTools MCP サーバーから) を保存する"}},t.systemActions={PROPERTY_BANK_EXPRESSION:{displayName:"CHANGE DATA WITH EXPRESSION",canProvideProperty:!0,filterKind:[p],propertyNameType:"defined_properties",property:{EXPRESSION:{type:"string",displayName:"Expression",normalizeDisplayName:!1},VARIABLES:{type:"nested",schema:{type:"object",properties:{id:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Data ID",normalizeDisplayName:!1},key:{type:"string"}},allowNewItem:!0},popover:!0,defaultValue:[]},RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},RESULT_ASSIGN_PATH:{type:"string"},ERROR_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1}},previewIcon:{type:"font-awesome-6pro",name:"bolt",size:14}},PROPERTY_BANK:{displayName:"CHANGE DATA",canProvideProperty:!0,filterKind:[p],propertyNameType:"property_bank",previewIcon:{type:"font-awesome-6pro",name:"bolt",size:14}},PROPERTY_BANK_COMMAND:{displayName:"TRIGGER DATA COMMAND",disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"property_bank",type:"bool",previewIcon:{type:"font-awesome-6pro",name:"bolt",size:16}},DYNAMIC_BRICK:{hidden:"unstable",disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{DYNAMIC_BRICK_ADD_LIST:{type:"string"},DYNAMIC_BRICK_PREFER_AFTER_ITEM_ID:{type:"string"},DYNAMIC_BRICK_RESET:{type:"bool"},DYNAMIC_BRICK_REMOVE_ITEM_ID:{type:"string"},DYNAMIC_BRICK_REMOVE_ITEMS:{type:"string"}},previewIcon:{type:"font-awesome-6pro",name:"grid-2"}},DYNAMIC_BRICK_RESET:{hidden:"unstable",disallowMultiple:!0,canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"rotate-right"}},DYNAMIC_ANIMATION:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{DYNAMIC_ANIMATION_BRICK_ID:{type:"string",kind:"id",idType:"brick"},DYNAMIC_ANIMATION_ANIMATION_ID:{type:"string",kind:"id",idType:"animation"},DYNAMIC_ANIMATION_RUN_TYPE:{type:"oneOf",oneOf:n},DYNAMIC_ANIMATION_RESET_INITIAL_VALUE:{type:"bool"}},previewIcon:{type:"font-awesome-6pro",name:"bars-staggered",size:16}},DYNAMIC_ANIMATION_RESET:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{DYNAMIC_ANIMATION_BRICK_ID:{type:"string",kind:"id",idType:"brick"}},previewIcon:{type:"font-awesome-6pro",name:"rotate-right"}},DYNAMIC_ANIMATION_STOP:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{DYNAMIC_ANIMATION_BRICK_ID:{type:"string",kind:"id",idType:"brick"}},previewIcon:{type:"font-awesome-6pro",name:"stop"}},CHANGE_CANVAS:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{CANVAS_ID:{type:"string",kind:"id",idType:"canvas"},CANVAS_TITLE_LIKE:{type:"string"},CANVAS_KEY_MAP_LIST:{type:"nested",schema:{type:"object",properties:{key:{displayName:"Key",type:"string"},value:{displayName:"Canvas ID",type:"string",kind:"id",idType:"canvas"}},allowNewItem:!0},popover:!0,defaultValue:[]},CANVAS_KEY:{type:"string"}},previewIcon:{type:"font-awesome-6pro",name:"diamond-turn-right",size:16}},MESSAGE:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{SYSTEM_MESSAGE_TYPE:{type:"oneOf",oneOf:["SYSTEM_MESSAGE_TYPE_INFO","SYSTEM_MESSAGE_TYPE_SUCCESS","SYSTEM_MESSAGE_TYPE_WARNING","SYSTEM_MESSAGE_TYPE_ERROR"]},SYSTEM_MESSAGE_TITLE:{type:"string"},SYSTEM_MESSAGE_MESSAGE:{type:"string"}},previewIcon:{type:"font-awesome-6pro",name:"note"}},ALERT:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{ALERT_ID:{type:"string"},ALERT_TYPE:{type:"oneOf",oneOf:["info","success","warning","error"]},ALERT_TITLE:{type:"string"},ALERT_MESSAGE:{type:"string"},ALERT_SELECTIONS:{type:"nested",schema:{type:"object",properties:{label:{type:"string"},color:{type:"string"},value:{type:"string"},disableResult:{type:"bool"}},allowNewItem:!0},popover:!0,defaultValue:[]},ALERT_SELECTION_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},ALERT_TIMEOUT:{type:"number",defaultValue:1e4},ALERT_HIDE_SELECTIONS:{type:"bool"}},previewIcon:{type:"font-awesome-6pro",name:"bell"}},POPUP_RESET:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{POPUP_CLEAR_TYPE:{type:"oneOf",oneOf:["all","alert","generator"]},POPUP_ID:{type:"string"}},previewIcon:{type:"font-awesome-6pro",name:"rotate-right"}},TAKE_SCREENSHOT:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{TAKE_SCREENSHOT_CURRENT_SUBSPACE:{type:"bool"},TAKE_SCREENSHOT_BRICK_ID:{type:"string",kind:"id",idType:"brick",displayName:"Brick ID",normalizeDisplayName:!1},TAKE_SCREENSHOT_FORMAT:{type:"oneOf",oneOf:["jpg","png"]},TAKE_SCREENSHOT_QUALITY:{type:"number",max:1,min:0,step:.1},TAKE_SCREENSHOT_WIDTH:{type:"number"},TAKE_SCREENSHOT_HEIGHT:{type:"number"},TAKE_SCREENSHOT_SAVE_PROPERTY:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1}},previewIcon:{type:"font-awesome-6pro",name:"camera",size:16}},STORAGE_SET:{displayName:"STORAGE SET",canProvideProperty:!0,propertyNameType:"defined_properties",property:{STORAGE_TYPE:{type:"oneOf",oneOf:["persist","in-memory"],displayName:"Storage Type",defaultValue:"persist"},STORAGE_SCOPE:{type:"oneOf",oneOf:["global","subspace"],displayName:"Storage Scope",defaultValue:"global"},STORAGE_KEY:{type:"string",displayName:"Key",normalizeDisplayName:!1},STORAGE_VALUE:{type:"any",displayName:"Value",normalizeDisplayName:!1}},previewIcon:{type:"font-awesome-6pro",name:"database",size:14}},STORAGE_RETRIEVE:{displayName:"STORAGE RETRIEVE",canProvideProperty:!0,propertyNameType:"defined_properties",property:{STORAGE_TYPE:{type:"oneOf",oneOf:["persist","in-memory"],displayName:"Storage Type",defaultValue:"persist"},STORAGE_SCOPE:{type:"oneOf",oneOf:["global","subspace"],displayName:"Storage Scope",defaultValue:"global"},STORAGE_KEY:{type:"string",displayName:"Key",normalizeDisplayName:!1},STORAGE_RETRIEVE_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Result Target"},STORAGE_RETRIEVE_DEFAULT_VALUE:{type:"string",displayName:"Default Value",normalizeDisplayName:!1},STORAGE_RETRIEVE_SKIP_IF_NOT_FOUND:{type:"bool",displayName:"Skip if Not Found",defaultValue:!1}},previewIcon:{type:"font-awesome-6pro",name:"database",size:14}},STORAGE_DELETE:{displayName:"STORAGE DELETE",canProvideProperty:!0,propertyNameType:"defined_properties",property:{STORAGE_TYPE:{type:"oneOf",oneOf:["persist","in-memory"],displayName:"Storage Type",defaultValue:"persist"},STORAGE_SCOPE:{type:"oneOf",oneOf:["global","subspace"],displayName:"Storage Scope",defaultValue:"global"},STORAGE_KEY:{type:"string",displayName:"Key",normalizeDisplayName:!1},STORAGE_DELETE_ALL:{type:"bool",displayName:"Delete All Values",defaultValue:!1}},previewIcon:{type:"font-awesome-6pro",name:"trash",size:14}},CHANNEL_SUBSCRIBE:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{CHANNEL_SUBSCRIBE_KEY:{type:"string"},CHANNEL_SUBSCRIBE_TYPE:{type:"oneOf",oneOf:["on","once"]},CHANNEL_SUBSCRIBE_LIVETIME:{type:"number",kind:"unit",unit:"ms"},CHANNEL_SUBSCRIBE_DATA_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Result"},CHANNEL_SUBSCRIBE_DATA_ASSIGN_LIST:{type:"nested",schema:{type:"object",properties:{path:{displayName:"Object Path",type:"string"},type:{type:"oneOf",oneOf:["any","string","number","bool","array","object"],oneOfEmptyOption:!1,defaultValue:"any"},id:{displayName:"Data ID",type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},required:{type:"bool",defaultValue:!1}},allowNewItem:!0},popover:!0,defaultValue:[]},CHANNEL_SUBSCRIBE_PROGRESS_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Progress"},CHANNEL_SUBSCRIBE_PROGRESS_ASSIGN_LIST:{type:"nested",schema:{type:"object",properties:{path:{displayName:"Object Path",type:"string"},type:{type:"oneOf",oneOf:["any","string","number","bool","array","object"],oneOfEmptyOption:!1,defaultValue:"any"},id:{displayName:"Data ID",type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},required:{type:"bool",defaultValue:!1}},allowNewItem:!0},popover:!0,defaultValue:[]},CHANNEL_SUBSCRIBE_ERROR_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Error"}},previewIcon:{type:"font-awesome-6pro",name:"display",size:16}},CHANNEL_UNSUBSCRIBE:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{CHANNEL_UNSUBSCRIBE_KEY_MATCH:{type:"string"}}},CHANNEL_PUBLISH:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{CHANNEL_PUBLISH_KEY_MATCH:{type:"string"},CHANNEL_PUBLISH_PAYLOAD_TYPE:{type:"oneOf",oneOf:["result","progress","error"]},CHANNEL_PUBLISH_PAYLOAD:{type:"string"}}},DELAY:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{DELAY_TIME:{type:"number",kind:"unit",unit:"ms"}}},USE_SHARE_APPLICATION:{hidden:"internal",canProvideProperty:!0,propertyNameType:"defined_properties",property:{APPLICATION_ID:{type:"string"},RELEASE_VERSION:{type:"string"},USE_TYPE:{type:"oneOf",oneOf:["run","use-after-bind","cancel-use"]},VIEWPORT_PRESET_NAME_LIKE:{type:"string"},VIEWPORT_PRESET_DEVICE_TARGET:{type:"string"},ENABLE_LOCAL_SYNC:{type:"bool"}},previewIcon:{type:"font-awesome-6pro",name:"display",size:16}},AUTH_IN_DEVICE:{hidden:"internal",canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"user",size:16}},REFRESH_BINDCODE:{hidden:"internal",canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"arrows-rotate",size:16}},OPEN_URL:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{URL:{type:"string",normalizeDisplayName:!1,displayName:"URL"},BEHAVIOR:{type:"oneOf",oneOf:["in-app","new-window"]},IN_APP_TINT_COLOR:{type:"string",kind:"color",popover:!0}},previewIcon:{type:"font-awesome-6pro",name:"external-link",size:16}},OPEN_FILE:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{PICK_TYPE:{type:"oneOf",oneOf:["file","multiple","directory"],oneOfEmptyOption:!1},FILE_TYPE:{type:"any"},COPY_TO:{type:"oneOf",oneOf:["cache","document"]},MODE:{type:"oneOf",oneOf:["import","open"]},SAVE_PROPERTY:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},SAVE_DETAIL_PROPERTY:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},ERROR_SAVE_PROPERTY:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1}},previewIcon:{type:"font-awesome-6pro",name:"folder-open",size:16}},THROW_EXCEPTION:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{BEHAVIOR:{type:"oneOf",oneOf:["application","native"]},EXCEPTION_MESSAGE:{type:"string",displayName:"Exception Message"}},previewIcon:{type:"font-awesome-6pro",name:"bomb",size:16}},RESTART_FOUNDATION:{canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"arrows-rotate",size:16}},DISMISS_KEYBOARD:{canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"keyboard-down",size:16}},TRIGGER_APPLICATION_FILTER:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{NAME:{type:"string",displayName:"Filter Name",normalizeDisplayName:!1},VARIABLES:{type:"any",displayName:"Variables",normalizeDisplayName:!1},RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Result Target"},ERROR:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Error Target"}},previewIcon:{type:"font-awesome-6pro",name:"robot",size:16}},STOP_APPLICATION_FILTER:{canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"stop",size:16}},SAVE_UPDATE_SNAPSHOT:{displayName:"SAVE UPDATE SNAPSHOT",canProvideProperty:!0,propertyNameType:"defined_properties",property:{SNAPSHOT_FILE_INDENTIFIER:{type:"string",displayName:"Filename Identifier",defaultValue:"default",normalizeDisplayName:!1},SNAPSHOT_SAVE_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Result Target"},SNAPSHOT_ERROR_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Error Target"}},previewIcon:{type:"font-awesome-6pro",name:"camera-retro",size:16}}},t.getSubspaceActionTypes=e=>Object.entries(e.action_map||{}).reduce((e,[t,r])=>(e[`SUBSPACE_ACTION_${t}`]={canProvideProperty:Object.keys(r.event_property_map||{}).length>0,property:Object.entries(r.event_property_map||{}).reduce((e,[t,r])=>(e[`SUBSPACE_${t}`]={type:r.type,name:a(t)},e),{}),propertyNameType:"defined_properties"},e),{})},54369:(e,t,r)=>{const{getIDPattern:a}=r(1639);e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/generator.schema.json5",title:"Generator",description:"A generator config",type:"object",properties:{alias:{type:"string",description:"Optional alias for this generator, used as variable name in code generation."},title:{type:"string",description:"This generator's name."},description:{type:"string",description:"This generator's description."},local_sync:{type:"object",description:"Define generator behavior on Local Sync mode.",properties:{run_mode:{type:"string",enum:["all","main-only","minor-only"]}}},template_key:{type:"string"},property:{type:"object"},outlet:{type:"object",patternProperties:{"^GENERATOR_(.)+$":{type:"string",pattern:a("PROPERTY_BANK_DATA_NODE")}},additionalProperties:!1},event_map:{$ref:"http://display.bricks.tools/event_map.schema.json5",description:"Use event map describe how event should go."}},required:["template_key"]}},62701:e=>{e.exports=JSON.parse('["easeInSine","easeOutSine","easeInOutSine","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInBack","easeOutBack","easeInOutBack","easeInElastic","easeOutElastic","easeInOutElastic","easeInBounce","easeOutBounce","easeInOutBounce"]')},66354:(e,t,r)=>{const{getIDPattern:a}=r(1639),n=a("CANVAS");e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/subspace.schema.json5",title:"Subspace",description:"A brick subspace config",type:"object",properties:{routing:{type:"object",patternProperties:{[a("PROPERTY_BANK_DATA_NODE")]:{type:"object",properties:{enabled_routing:{type:["boolean","null"]}}}},additionalProperties:!1},title:{type:"string",description:"Subspace Title"},description:{type:"string",description:"Subspace Description"},module:{type:"object"},layout:{type:"object",properties:{width:{type:"number"},height:{type:"number"}}},root_canvas_id:{type:"string",description:"Canvas ID point to this stage entry subspace.",pattern:n},property_bank_map:{type:"object",patternProperties:{[a("PROPERTY_BANK_DATA_NODE")]:{$ref:"http://display.bricks.tools/property_bank.schema.json5",description:"One subspace can have many property bank."}},additionalProperties:!1},property_bank_calc_map:{type:"object",patternProperties:{[a("PROPERTY_BANK_COMMAND_MAP")]:{type:"object",properties:{type:{type:"string",enum:["general","script"]},map:{type:"object",patternProperties:{[a("PROPERTY_BANK_(DATA_NODE|COMMAND_NODE)")]:{$ref:"http://display.bricks.tools/property_bank_command.schema.json5",description:"One command map can have many property bank data node."}}},editor_info:{type:"object",patternProperties:{[a("PROPERTY_BANK_(DATA_NODE|COMMAND_NODE)")]:{type:"object",properties:{position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}},points:{type:"object"}},description:"One command map can have many property bank data node."}}},script_config:{$ref:"http://display.bricks.tools/property_bank_calc_script_config.schema.json5",description:"JavaScript Sandbox calculation config"},note:{type:"string",description:"Note of this calc map."}},description:"One command map can have many property bank commands"}},additionalProperties:!1},brick_map:{type:"object",patternProperties:{[a("BRICK")]:{$ref:"http://display.bricks.tools/brick.schema.json5",description:"One subspace can have many brick."}},additionalProperties:!1},generator_map:{type:"object",patternProperties:{[a("(GENERATOR|AUTO_GENERATOR)")]:{$ref:"http://display.bricks.tools/generator.schema.json5",description:"One subspace can have many generator."}},additionalProperties:!1},animation_map:{type:"object",patternProperties:{[a("ANIMATION")]:{$ref:"http://display.bricks.tools/animation.schema.json5",description:"One subspace can have many animation."}},additionalProperties:!1},canvas_map:{type:"object",patternProperties:{[n]:{$ref:"http://display.bricks.tools/canvas.schema.json5",description:"One subspace can have many canvas."}},additionalProperties:!1},local_sync:{type:"object",description:"Define subspace behavior on Local Sync mode.",properties:{change_canvas:{type:"string",enum:["all","main-only","minor-only"]}}}},if:{properties:{module:{type:"object",properties:{link:{const:!0}},required:["link"]}},required:["module"]},then:{required:["module"]},else:{required:["root_canvas_id","property_bank_map","brick_map","generator_map","animation_map","canvas_map"]}}},78078:(e,t,r)=>{const{parse:a}=r(89236),{expressionFoldAcornOptions:n}=r(41900),p=(e,t,r)=>{e&&"object"==typeof e&&(Array.isArray(e)?e.forEach((e,a)=>p(e,`${t}[${a}]`,r)):Object.entries(e).forEach(([e,o])=>{"event_map"!==e&&"eventMap"!==e||!o||"object"!=typeof o?o&&"object"==typeof o&&p(o,`${t}.${e}`,r):Object.entries(o).forEach(([p,o])=>{Array.isArray(o)&&o.forEach((o,i)=>{if("PROPERTY_BANK_EXPRESSION"!==o?.action)return;const s=(e=>{const t=e.parameter_list||e.parameterList||[];if(!Array.isArray(t))return;const r=t.find(e=>"EXPRESSION"===(e?.input_to_receiver||e?.inputToReceiver));return r?r.result_from_sender??r.resultFromSender:void 0})(o);if("string"!=typeof s||s.startsWith("PROPERTY_BANK#"))return;const c=(e=>{if(!e.trim())return"Expression is empty";try{a(e,n)}catch(e){return`Expression does not parse: ${e.message}`}return null})(s);c&&r.push({field:`${t}.${e}.${p}[${i}]`,message:c})})})}))};e.exports=function(e){const t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{r.module?.link||p(r,`subspace_map.${e}`,t)}),t}},79458:(e,t,r)=>{const{getIDPattern:a}=r(1639),n=a("SUBSPACE"),p=a("TEST");e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/root.schema.json5",title:"Root",description:"A brick root config",type:"object",properties:{title:{type:"string",description:"The root config name."},root_subspace_id:{type:"string",description:"The root subspace id.",pattern:n},subspace_map:{type:"object",patternProperties:{[n]:{$ref:"http://display.bricks.tools/subspace.schema.json5",description:"Root config can have many subspace."}},additionalProperties:!1},test_map:{type:"object",patternProperties:{[p]:{$ref:"http://display.bricks.tw/test.schema.json5",description:"Root config can have many test."}},additionalProperties:!1,deprecated:!0,description:"Deprecated in favor of automation_map.AUTOMATION_MAP_DEFAULT"},automation_map:{$ref:"http://display.bricks.tools/automation_map.schema.json5",description:"Maps of automation tests organized by collection"},show_viewports:{type:"boolean",description:"Show device viewport reference on editor"},enable_unstable_bricks:{type:"boolean",description:"Enable unstable bricks / generators"},hide_short_refs:{type:"boolean",description:"Hide all instances in Short Edit mode"},warnings:{type:"array",description:"Config validation warnings from server"}},required:["title","subspace_map","root_subspace_id"]}},80211:(e,t,r)=>{const a=r(11601),{propertyBank:n,propertyBankCommand:p,propertyBankCalcScriptConfig:o}=r(7436),i=new a({strict:!1,schemas:[r(85912),n,p,o,r(5982),r(54369),r(24090),r(27449),r(85190),r(66354),r(92514),r(97256),r(79458)]});function s(e){const t=i.getSchema("http://display.bricks.tools/root.schema.json5");return t(e),t.errors||[]}s.ajv=i,e.exports=s},85190:(e,t,r)=>{const a=r(62701),{getIDPattern:n}=r(1639),p={type:"object",properties:{method:{type:"string",anyOf:[{enum:[""].concat(a)},{pattern:"^cubic-bezier\\([\\d.-]+,\\s*[\\d.-]+,\\s*[\\d.-]+,\\s*[\\d.-]+\\)$"}]},duration:{type:"number",min:0}}},o={type:"object",properties:{x:{type:"number"},y:{type:"number"},width:{type:"number"},height:{type:"number"}}},i={type:"object",properties:{default:p,x:p,y:p,width:p,height:p,opacity:p}},s={type:"object",properties:{x:{type:"number"},y:{type:"number"},width:{type:"number"},height:{type:"number"},standby_mode:{type:"string",enum:["custom","top","left","right","bottom"]},standby_frame:o,standby_opacity:{type:"number"},standby_delay:{type:"number"},standby_delay_random:{type:"number"},standby_easing:i,showing_delay:{type:"number"},render_out_of_viewport:{type:"boolean"}}};e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/canvas.schema.json5",title:"Canvas",description:"A brick canvas config",type:"object",properties:{alias:{type:"string",description:"Optional alias for this canvas, used as variable name in code generation."},title:{type:"string",description:"Canvas Title"},description:{type:"string",description:"Canvas Description"},property:{type:"object"},event_map:{$ref:"http://display.bricks.tools/event_map.schema.json5",description:"Use event map describe how event should go."},state_group:{$ref:"http://display.bricks.tools/state_group.schema.json5",description:"Use state group to describe how to transform property, event and outlet."},item_list:{type:"array",items:{type:"object",oneOf:[{properties:{type:{type:"string",enum:["subspace"]},subspace_id:{type:"string",description:"The subspace id",pattern:n("SUBSPACE")},frame:{...s,properties:{...s.properties,exceed_boundary:{type:"boolean"}}}}},{properties:{type:{type:"string",enum:["brick"]},brick_id:{type:"string",description:"The brick id",pattern:n("BRICK")},frame:s}}]}}}},e.exports.standbyFrame=o,e.exports.standbyEasing=i},85912:e=>{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/event_map.schema.json5",title:"Event Map",description:"A event map config",type:"object",patternProperties:{"^.+$":{type:"array",description:"List all handler response to this event.",items:{type:"object",description:"A handle trigger action and parameter.",properties:{action:{type:"string",description:"Which action will be execute."},handler:{type:"string",description:"Which generator are handler."},wait_async:{type:"boolean",description:"Wait for async action finish."},parameter_list:{type:"array",description:"Describe how which data will as parameter and send to where.",items:{type:"object",properties:{result_from_sender:{description:"Describe which data will be the input."},input_to_receiver:{description:"Describe where the input data will go."}},required:["input_to_receiver"]}}},required:["action","handler","parameter_list"]}}},additionalProperties:!1}},86343:(e,t,r)=>{const{v4:a}=r(79194),n=r(95479),{nameMap:p,brickMapping:o,generatorMapping:i}=r(63981);t.idByItem=(e={})=>e.canvas_id||e.subspace_id||e.brick_id||e.generator_id||e.property_bank_id||e.property_bank_calc_id||e.bank_id||e.scene_id,t.getAnimationType=e=>e.type||e.compose_type||e.composeType,t.cleanUpAnimationMap=e=>Object.entries(e).reduce((e,[t,r])=>((r.type||r.compose_type)&&(e[t]=r),e),{}),t.matchItemByItem=(e,t)=>{if(!e)return!1;let r;switch("string"==typeof t&&(r=t),e.type){case"brick":return e.brick_id===(r||t.brick_id);case"subspace":return e.subspace_id===(r||t.subspace_id);case"canvas":return e.canvas_id===(r||t.canvas_id);case"generator":return e.generator_id===(r||t.generator_id);case"property_bank":return e.property_bank_id===(r||t.property_bank_id);default:return!1}},t.makePasscode=()=>a(),t.kindOneOfTypes={string:["color","datetime","id","graphql","rich-text-content","sandbox-script","llm-prompt","media-resource-image","media-resource-video","media-resource-audio","media-resource-file","lottie-file-uri","rive-file-uri","ggml-model-asset","gguf-model-asset","binary-asset"],number:["unit"],object:["tts-speaker-config"],"array-object":["llm-tools","llm-messages","mcp-server-resources","mcp-server-tools","mcp-server-prompts"]},t.getKindOneOfTypes=(e,r)=>"array"===e?"object"===r?t.kindOneOfTypes[`${e}-${r}`]:void 0:t.kindOneOfTypes[e],t.unitOneOfTypes=["grid","px","ms"],t.idOneOfTypes=["canvas","brick","generator","animation","property_bank"],t.typeToName={brick:"Brick",generator:"Generator",subspace:"Subspace",canvas:"Canvas",animation:"Animation",property_bank:"Data",property_bank_calc:"Calculation"},t.getBrickName=(e,r,a)=>{if(!r)return e.toUpperCase();if(r.title)return r.title;let o;switch(e){case"bank":o="BANK";break;case"subspace":o="SUBSPACE";break;case"canvas":o="CANVAS";break;case"animation":o=`<${n(t.getAnimationType(r))}>`;break;case"property_bank":o="<Data>";break;case"property_bank_calc":o="<Map>";break;case"state_group":o="<Switch Case>";break;default:o=`<${p[r.template_key||r.templateKey]||"Unknown"}>`}return a&&a.length>10?o+=` (${a.replace(/[A-Z_]+/g,"").substr(0,6)}...)`:a&&(o+=` (${a})`),o},t.getCallInternalActions=e=>{const t=o[e]||i[e];if(t)return t.callInternalActions},t.mapToList=(e,r)=>Object.entries(r).reduce((r,[a,n])=>(r.push({id:a,...n,title:t.getBrickName(e,n,a)}),r),[]);const s={subspaceMap:"subspace",brickMap:"brick",generatorMap:"generator",propertyBankMap:"property_bank",propertyAvailableToAdd:"property_bank",canvasMap:"canvas",animationMap:"animation"},c={};t.mapToListForDerivedState=(e,r,a,n)=>{const p=a[e]||c;return p!==n[e]?{[e]:p,[r]:t.mapToList(s[e],p)}:{}},t.arrayTypePrefix="array of ",t.propertyBankTypes=["string","number","bool","object","any",`${t.arrayTypePrefix}string`,`${t.arrayTypePrefix}number`,`${t.arrayTypePrefix}bool`,`${t.arrayTypePrefix}object`],t.animationRunTypes=["once","loop"],t.stopPropagationOnKeyBackspace=e=>{8===e.keyCode&&e.stopPropagation()},t.nestedTypes=["object","array","any"],t.isPropertyBankTypeNested=e=>t.nestedTypes.includes(e),t.propertyTypeToSchema=e=>{const r=e.indexOf(t.arrayTypePrefix)>-1,a=e.replace(t.arrayTypePrefix,"");return{type:a,properties:"object"===a?{}:void 0,allowNewItem:r,allowCustomProperty:"object"===a}}},92514:(e,t,r)=>{const{getIDPattern:a}=r(1639);e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tw/test.schema.json5",title:"Test",description:"A brick test config",type:"object",properties:{title:{type:"string",description:"Test Title"},description:{type:"string",description:"Test Description"},meta:{type:"object",properties:{}},open_report_on_failed:{type:"boolean",description:"Open Automation report on failed"},use_media_flow_screenshots:{type:"boolean",description:"Save screeshots to SYSTEM media box if enabled"},trigger_type:{type:"string",enum:["launch","anytime","cron"],description:"Trigger type (launch: restart the application, anytime: trigger directly)"},cron:{type:"string",description:"Cron Expression"},timeout:{type:"number",description:"Test runtime timeout"},case_map:{type:"object",patternProperties:{[a("TEST_CASE")]:{type:"object",properties:{id:{type:"string"},name:{type:"string"},run:{type:"array"},commented:{type:"boolean"},exit_on_failed:{type:"boolean"},pre_delay:{type:"number"},post_delay:{type:"number"}}}},additionalProperties:!1},var_map:{type:"object",patternProperties:{[a("TEST_VAR")]:{type:"object",properties:{title:{type:"string",description:"This var's name."},type:{type:"string",enum:["string","number","array","object","bool","any"]},value:{}}}},additionalProperties:!1}},required:["case_map","var_map"]}},97256:(e,t,r)=>{const{getIDPattern:a}=r(1639),n=a("TEST");e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/automation_map.schema.json5",title:"Automation Map",description:"A map of automation test collections",type:"object",patternProperties:{"AUTOMATION_MAP_.*":{type:"object",properties:{title:{type:"string",description:"The name of the test map"},createdAt:{type:"number",description:"The creation timestamp of the test map"},map:{type:"object",patternProperties:{[n]:{$ref:"http://display.bricks.tw/test.schema.json5",description:"A test configuration"}},additionalProperties:!1}}}},additionalProperties:!1}},99470:(e,t)=>{t.animationRunTypes=["once","loop"],t.autoGeneratedItemIdKind="auto-generated-item-id";const r=/^([^.](?![\w!#$%&'*+/=?^`{|}~\-]+\.\.)([\w!#$%&'*+./=?^`{|}~\-]+[^.])|([\dA-Za-z]{1,2}))@([\dA-Za-z-]{1,64}\.){1,10}[A-Za-z]{2,64}$/;t.isEmail=e=>"string"==typeof e&&r.test(e)&&e.indexOf("@")<65&&e.length<255;const a=/^(data:)([\w+/]+);(charset=[\w-]+|base64).*,(.*)/i,n=e=>new RegExp(`^(${e.join("|")}):\\/\\/(www\\.)?([\\w#%+.:=@~-]{1,256}\\.[\\d()a-z]{1,6}\\b|localhost|[\\d]{1,3}\\.[\\d]{1,3}\\.[\\d]{1,3}\\.[\\d]{1,3})([\\w#%&()+./:=?@~-]*)`,"i"),p=["https?"],o=n(p);t.isURI=(e,t=p)=>{const r=t.includes("data");if(r&&a.test(e))return!0;return(e=>e===p||1===e.length&&"https?"===e[0]?o:n(e))(r?t.filter(e=>"data"!==e):t).test(e)}}};
|
|
1
|
+
export const __webpack_esm_id__=890;export const __webpack_esm_ids__=[890];export const __webpack_esm_modules__={1639:(e,t,r)=>{const{v4:a}=r(79194);t.getIDPattern=e=>`^${e}_[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`,t.autoGeneratorIDPrefix="AUTO_GENERATOR_",t.makeId=e=>{let r="";switch(e){case"animation":r="ANIMATION_";break;case"brick":r="BRICK_";break;case"dynamic-brick":r="DYNAMIC_BRICK_";break;case"subspace":r="SUBSPACE_";break;case"canvas":r="CANVAS_";break;case"generator":r="GENERATOR_";break;case"auto-generator":r=t.autoGeneratorIDPrefix;break;case"data":case"property_bank":r="PROPERTY_BANK_DATA_NODE_";break;case"property_bank_command":r="PROPERTY_BANK_COMMAND_NODE_";break;case"property_bank_calc":r="PROPERTY_BANK_COMMAND_MAP_";break;case"automation_map":r="AUTOMATION_MAP_";break;case"test":r="TEST_";break;case"test_case":r="TEST_CASE_";break;case"test_var":r="TEST_VAR_";break;case"state_group":r="BRICK_STATE_GROUP_"}return`${r}${a()}`};const n=/[$()*+.?[\\\]^{|}]/g;t.replaceMultiple=(e,t)=>{const r=Object.keys(t).sort((e,t)=>t.length-e.length);if(0===r.length)return e;const a=new RegExp(r.map(e=>e.replace(n,"\\$&")).join("|"),"g");return e.replace(a,e=>t[e])}},5982:(e,t,r)=>{const{getIDPattern:a}=r(1639),n=a("BRICK_STATE_GROUP");e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/state_group.schema.json5",title:"State Group",description:"A state group config",type:"object",patternProperties:{[n]:{type:"object",properties:{title:{type:"string",description:"State Group Title"},description:{type:"string",description:"State Group Description"},conds:{type:"array",items:{type:"object",properties:{type:{type:"string",enum:["property_bank","property_bank_by_item_key","inner_state"]},key:{type:"string"},method:{type:"string",enum:["==","!=",">",">=","<","<="]}}}},commented:{type:"boolean",description:"If true, this state group will not be used."},override:{type:"object",properties:{property:{type:"boolean"},event:{type:"boolean"},outlet:{type:"boolean"},animation:{type:"boolean"}}},break:{type:"boolean",description:"If true, this state group will stop checking next state groups."},property:{type:"object"},event_map:{$ref:"http://display.bricks.tools/event_map.schema.json5",description:"Use event map describe how event should go."},outlet:{type:"object"},animation:{type:"object"}}}}}},7436:(e,t,r)=>{const{docs:a}=r(5867),n=e=>`^${e}_[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$`;t.propertyBank={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/property_bank.schema.json5",title:"Property Bank",description:"A data storage config file.",type:"object",properties:{alias:{type:"string",description:"Optional alias for this data node, used as variable name in code generation."},linkedFrom:{type:["string","null"],description:"ID of linked from another subspace or not",pattern:n("SUBSPACE")},title:{type:"string",description:"This property bank's name."},description:{type:"string",description:"This property bank's description."},type:{type:"string",enum:["string","number","array","object","bool","any"]},routing:{type:["string","null"],enum:["default","read-only"]},preload:{type:["object","null"]},kind:{type:["string","null"]},unit:{type:["string","null"]},value:{},event_map:{$ref:"http://display.bricks.tools/event_map.schema.json5",description:"Use event map describe how event should go."},enable_remote_update:{type:["boolean","null"],description:"Enable remote update on this data node. (If Workspace have enable this feature)"},global_remote_update_prop:{type:["string","null"]},use_remote_id_prefix:{type:["boolean","null"]},local_sync:{type:"object",description:"Define property behavior on Local Sync mode.",properties:{update_mode:{type:"string",enum:["all","main-only","minor-only","dont-sync"]}}}},required:["type"]};const p=n("PROPERTY_BANK_(DATA_NODE|COMMAND_NODE)");t.propertyBankCommand={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/property_bank_command.schema.json5",title:"Property Bank Commands",description:"Property Bank Calculation",type:"object",properties:{type:{type:"string",enum:["data-node",...Object.keys(a).map(e=>`command-node-${e}`)]},title:{type:"string",description:"This property bank command's name."},note:{type:"string",description:"This property bank command's note."},properties:{type:"object",description:"The node properties"},in:{type:"object",description:"The node inputs",patternProperties:{"^.+$":{type:["array","null"],items:{type:"object",properties:{port:{type:"string"},id:{type:"string",pattern:p},disable_trigger_command:{type:"boolean"}},required:["id","port"]}}}},out:{type:"object",description:"The node outputs",patternProperties:{"^.+$":{type:["array","null"],items:{type:"object",properties:{port:{type:"string"},id:{type:"string",pattern:p}},required:["id","port"]}}}}},required:["type","properties","in","out"]},t.propertyBankCalcScriptConfig={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/property_bank_calc_script_config.schema.json5",title:"Property Bank Calulation Script Config",description:"JavaScript Sandbox calculation config",type:"object",properties:{code:{type:["string","null"]},inputs:{type:"object",patternProperties:{[n("PROPERTY_BANK_DATA_NODE")]:{type:"string"}},additionalProperties:!1},output:{type:["string","null"]},error:{type:["string","null"]},outputs:{type:"object",patternProperties:{"^.+$":{type:"array",items:{type:"string",pattern:n("PROPERTY_BANK_DATA_NODE")}}}}},required:["inputs","outputs","code"]}},12062:(e,t)=>{t.checkMethodFinished=e=>{const[t,...r]=e;switch(t){case"brick_press":{const[,e]=r;return!!e}case"wait_until_brick_exists":case"brick_exists":{const[,e]=r;return!!e}case"wait_until_canvas_change":{const[,e]=r;return!!e}case"wait_until_event_trigger":{const[,e,t]=r;return!!e&&!!t}case"keydown":case"keyup":{const[e,t]=r;return!!e||!!t}case"http_request":{const[e]=r;return!!e}case"assert_property":case"wait_until_property_change":{const[,e,t]=r;return!!e&&void 0!==t}case"execute_action":{const[,e,t]=r;return!!e&&!!t}case"match_screenshot":const[e]=r;return!!e;case"delay":case"do_nothing":return!0;default:return!1}}},18501:(e,t,r)=>{const{docs:a}=r(5867);t.isCommand=e=>Boolean(e&&e.type&&e.type.startsWith("command-node-")),t.getPorts=e=>e?Array.isArray(e)?e:[e]:[];t.getCommandCallbackFromPort=(e,r)=>{const n=e[r];if(!t.isCommand(n))return null;const p=(e=>a[e.type.replace("command-node-","")]?.commands?.[e.properties?.command])(n);return p?.iterateeFrom||p?.invocationFrom||null},t.checkDisableTriggerCommand=(e,r)=>t.getPorts(e[r.id]?.in?.[r.port]).some(e=>e?.disable_trigger_command);const n=(e,r,a)=>!(!r||!e[r.id])&&(r.port!==((e,r,a)=>(a.has(r)||a.set(r,t.getCommandCallbackFromPort(e,r)),a.get(r)))(e,r.id,a)&&!t.checkDisableTriggerCommand(e,r));t.findCircularReferenceIds=e=>{const r=(e=>{const r=new Map;return Object.keys(e).reduce((a,p)=>{const o=[];return Object.values(e[p]?.out||{}).forEach(a=>{t.getPorts(a).forEach(t=>{n(e,t,r)&&o.push(t.id)})}),a[p]=o,a},{})})(e),a=new Map;return Object.keys(e).filter(t=>"data-node"===e[t]?.type).filter(e=>((e,t,r)=>{if(r.has(e))return r.get(e);const a=[{id:e,edgeIndex:0,reachesCycle:!1}],n=new Set([e]);for(;a.length>0;){const e=a[a.length-1],p=t[e.id]||[];if(e.reachesCycle||e.edgeIndex>=p.length){n.delete(e.id),r.set(e.id,e.reachesCycle),a.pop(),e.reachesCycle&&a.length>0&&(a[a.length-1].reachesCycle=!0);continue}const o=p[e.edgeIndex];e.edgeIndex+=1,r.has(o)?r.get(o)&&(e.reachesCycle=!0):n.has(o)?e.reachesCycle=!0:(n.add(o),a.push({id:o,edgeIndex:0,reachesCycle:!1}))}return r.get(e)||!1})(e,r,a))},t.hasCircularReference=e=>t.findCircularReferenceIds(e).length>0;const p=(e={})=>Object.entries(e).reduce((e,[t,r])=>(e[t]=(e=>Array.isArray(e)?e.slice():e)(r),e),{}),o=new WeakSet,i=(e,t,r)=>{if(!r)return;const a=((e,t)=>{const r=e[t];if(!r)return e[t]=[],e[t];if(!Array.isArray(r))return e[t]=[r],e[t];if(!o.has(r)){let e=0;for(const t of r)t&&(r[e]=t,e+=1);r.length=e,o.add(r)}return r})(e,t);(Array.isArray(r)?r:[r]).forEach(e=>{e&&a.push(e)})};t.composeMap=e=>Object.values(e).reduce((e,r)=>Object.entries(r?.map||{}).reduce((e,[r,a])=>{if(e[r]){if(t.isCommand(a))throw new Error(`Doesn't allow same command id in another map, ${r}`);const n=e[r];Object.keys(a?.in||{}).forEach(e=>{i(n.in,e,a.in[e])}),Object.keys(a?.out||{}).forEach(e=>{i(n.out,e,a.out[e])})}else e[r]={...a,in:p(a?.in),out:p(a?.out)};return e},e),{})},24090:e=>{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/animation.schema.json5",title:"Animtation",description:"A brick animation config",type:"object",oneOf:[{properties:{alias:{type:"string"},title:{type:"string"},description:{type:"string"},animationRunType:{type:"string",enum:["once","loop"]},type:{type:"string",enum:["timing","decay","spring"]},property:{type:"string",enum:["opacity","transform.translateX","transform.translateY","transform.scale","transform.scaleX","transform.scaleY","transform.rotate","transform.rotateX","transform.rotateY"]},config:{type:"object"}},required:["type","property","config"]},{properties:{alias:{type:"string"},title:{type:"string"},compose_type:{type:"string",enum:["parallel","sequence"]},item_list:{type:"array",items:{type:"object",properties:{animation_id:{type:"string"}}}}},required:["compose_type","item_list"]}]}},27449:(e,t,r)=>{const{getIDPattern:a}=r(1639);e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/brick.schema.json5",title:"Brick",description:"A brick config",type:"object",properties:{alias:{type:"string",description:"Optional alias for this brick, used as variable name in code generation."},title:{type:"string",description:"This brick's name."},description:{type:"string",description:"This brick's description."},template_key:{type:"string"},property:{type:"object"},event_map:{$ref:"http://display.bricks.tools/event_map.schema.json5",description:"Use event map describe how event should go."},outlet:{type:"object",patternProperties:{"^BRICK_(.)+$":{type:"string",pattern:a("PROPERTY_BANK_DATA_NODE")}},additionalProperties:!1},state_group:{$ref:"http://display.bricks.tools/state_group.schema.json5",description:"Use state group to describe how to transform property, event and outlet."},primary_component:{type:"boolean",default:!1,description:"Mark this brick as a primary component for easier discovery in Runtime Editor."}},required:["template_key"]}},37517:(e,t,r)=>{const{composeMap:a,findCircularReferenceIds:n}=r(18501);e.exports=function(e){const t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{if(r.module?.link)return;const p=r.property_bank_calc_map;if(!p||0===Object.keys(p).length)return;const o=`subspace_map.${e}.property_bank_calc_map`;try{const e=a(p),r=n(e);if(r.length>0){const a=r.slice(0,5).map(t=>e[t].title||t),n=r.length>5?` and ${r.length-5} more`:"";t.push({field:o,message:`Circular reference detected in data calculation. Affected nodes: ${a.join(", ")}${n}. Please check the data connections for loops.`})}}catch(e){t.push({field:o,message:e.message})}}),t}},38890:(e,t,r)=>{const{getDocByTemplateKey:a}=r(63981),n=r(80211),p=r(45907),o=r(37517),i=r(78078),{getBrickName:s}=r(86343);t.checkConfigDeprecatedFeatures=e=>{const t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{Object.entries(r.brick_map||{}).forEach(([n,p])=>{void 0===p.property?.borderLeftWidth&&void 0===p.property?.borderRightWidth&&void 0===p.property?.borderTopWidth&&void 0===p.property?.borderBottomWidth||t.push({id:n,name:"Used Deprecated Feature",data:`In v2.16, we have been changed \`Border Width\` to \`Border Size\` (Unit \`px\` to \`grid\`). The \`${s("brick",p,n)}\` brick still used the border width. Please re-edit it to transfer to the new unit.`});const o=a(p.template_key);o?.brickMeta?.deprecated&&t.push({id:n,name:"Used Deprecated Feature",data:`The \`${s("brick",p,n)}\` brick in \`${s("subspace",r,e)}\` have been deprecated, it may not work in the future, please consider to remove it. If you can't see the item, please enable \`Show Deprecated Features\` in setting.`})}),Object.entries(r.generator_map||{}).forEach(([n,p])=>{const o=a(p.template_key);o?.brickMeta?.deprecated&&t.push({id:n,name:"Used Deprecated Feature",data:`The \`${s("brick",p,n)}\` brick in \`${s("subspace",r,e)}\` have been deprecated, it may not work in the future, please consider to remove it. If you can't see the item, please enable \`Show Deprecated Features\` in setting.`})})}),t},t.checkConfig=(e,t={})=>{const r={schema:n(e),ref:p(e,t),calc:t.checkCalc?o(e):[],expression:t.checkExpressions?i(e):[]};return r.valid=0===r.schema.length&&0===r.ref.length&&0===r.calc.length&&0===r.expression.length,r.message=r.schema.concat(r.ref).concat(r.calc).concat(r.expression).map(({instancePath:e,field:t,message:r})=>{const a=e||t;return a?`${a}: ${r}`:r}).join("\n"),r}},41900:e=>{e.exports={expressionFoldAcornOptions:{ecmaVersion:2022,allowReturnOutsideFunction:!0,allowAwaitOutsideFunction:!0},getUnfoldableStatementDescription:(e,t=null)=>{for(let t=0;t<e.length;t+=1){const r=e[t];if("ExpressionStatement"!==r.type){if("VariableDeclaration"===r.type){if(r.declarations.some(e=>"Identifier"!==e.id.type||!e.init))return"a variable declaration with destructuring or no initializer";continue}if(t!==e.length-1||"ReturnStatement"!==r.type)return`an unsupported ${r.type}`}}return t}}},45907:(e,t,r)=>{const{getDocByTemplateKey:a}=r(63981),{systemActions:n}=r(49741),{checkMethodFinished:p}=r(12062),o=(e,t,r)=>{const a=e[t];return a?r?!r[a]&&`The entry of \`${t}\` is not defined in the map.`:"The map is not defined":`\`${t}\` is not defined.`},i=(e,t=[])=>{t.forEach(t=>{e.push(t)})},s="PROPERTY_BANK#",c=[],d=["BRICK_GRID","BRICK_STICKER","BRICK_CHART_LINE","BRICK_CHART_BAR","BRICK_CHART_PIE","BRICK_CHART_PROGRESS","BRICK_3D_VIEWER","GENERATOR_PROMPT","GENERATOR_MEDIA_RESOURCE","GENERATOR_TEXT_INPUT_CONTROLLER","GENERATOR_CAMERA_CONTROLLER","GENERATOR_WEBVIEW_CONTROLLER","GENERATOR_FILE_READER","GENERATOR_URL_FILE_SYNC","GENERATOR_TENSORFLOW_INFERENCE","GENERATOR_TAPPAY_T2P_IOS"],y=(e,t,r,p,o,i,s)=>{const y=[];if(!r)return y.push({field:`${t}.template_key`,message:"`template_key` is not defined."}),y;if(c.includes(r)||d.includes(r))return y;return a(r)?Object.entries(p||{}).reduce((e,[r,p])=>Array.isArray(p)?(p.forEach((p,c)=>{if(!p||"object"!=typeof p)return void e.push({field:`${t}.event_map.${r}.${c}`,message:"The event handler must be an object."});const{handler:d,action:y,parameter_list:l}=p;if("SYSTEM"===d){n[y]||e.push({field:`${t}.event_map.${r}.${c}.action`,message:`SYSTEM action ${y} is not found in the definition.`});const a=n[y];return!a?.canProvideProperty&&l&&l.length>0&&e.push({field:`${t}.event_map.${r}.${c}.parameter_list`,message:`SYSTEM action ${y} is not allowed to provide property.`}),void("PROPERTY_BANK"!==y&&"PROPERTY_BANK_COMMAND"!==y||(l||[]).forEach((a,n)=>{const p=a?.input_to_receiver;"string"==typeof p&&p.startsWith("PROPERTY_BANK_")||e.push({field:`${t}.event_map.${r}.${c}.parameter_list.${n}.input_to_receiver`,message:`SYSTEM action ${y} requires \`input_to_receiver\` to start with \`PROPERTY_BANK_\`.`})}))}const m=i[d]||s[d]||o[d];if(!m)return void e.push({field:`${t}.event_map.${r}.${c}.handler`,message:`The handler ${d} is not found in the brick map, generator map, or subspace map.`});const _=a(m.template_key);if(!_)return;if(!_.actionTypes||!_.actionTypes[y])return void e.push({field:`${t}.event_map.${r}.${c}.action`,message:`The event action ${y} is not defined in the handler ${m.template_key}.`});!_.actionTypes[y].canProvideProperty&&l&&l.length>0&&e.push({field:`${t}.event_map.${r}.${c}.parameter_list`,message:`The event action ${y} in the handler ${m.template_key} is not allowed to provide property.`})}),e):(e.push({field:`${t}.event_map.${r}`,message:"The event content must be an array."}),e),y):(y.push({field:`${t}.template_key`,message:`Template ${r} is not found.`}),y)},l=e=>"string"==typeof e&&e.startsWith("VARIABLE#"),m={brick_press:{subspaceScopedMaps:{0:"subspace",1:"brick_map"}},brick_exists:{subspaceScopedMaps:{0:"subspace",1:"brick_map"}},wait_until_brick_exists:{subspaceScopedMaps:{0:"subspace",1:"brick_map"}},wait_until_canvas_change:{subspaceScopedMaps:{0:"subspace",1:"canvas_map"}},wait_until_event_trigger:{subspaceScopedMaps:{0:"subspace"},dynamicArgs:{1:{name:"sender"}}},assert_property:{subspaceScopedMaps:{0:"subspace",1:"property_bank_map"}},wait_until_property_change:{subspaceScopedMaps:{0:"subspace",1:"property_bank_map"}},execute_action:{subspaceScopedMaps:{0:"subspace"},dynamicArgs:{1:{name:"handler",allowedLiterals:["SYSTEM"]}}}},_=[{prefix:"BRICK_",map:"brick_map"},{prefix:"GENERATOR_",map:"generator_map"},{prefix:"CANVAS_",map:"canvas_map"},{prefix:"PROPERTY_BANK_",map:"property_bank_map"},{prefix:"SUBSPACE_",map:"subspace_map"}],u=(e,t,r,a,n)=>!r||l(r)||n&&n[r]?null:{field:`${e}.run.${t+1}`,message:`The entry \`${r}\` is not defined in \`${a}\`.`},b=(e,t,r,a)=>{const n=[],[p,...o]=t||[],i=m[p];if(!i)return n;const s=Object.entries(i.subspaceScopedMaps||{}).find(([,e])=>"subspace"===e)?.[0],c=(null!=s?o[Number(s)]:void 0)||a,d=c&&!l(c)?r[c]:null;return Object.entries(i.subspaceScopedMaps||{}).forEach(([t,a])=>{const p=Number(t),i=o[p];if("subspace"===a){const t=u(e,p,i,"subspace_map",r);return void(t&&n.push(t))}if(!d)return;const s=u(e,p,i,a,d[a]);s&&n.push(s)}),Object.entries(i.dynamicArgs||{}).forEach(([t,a])=>{const p=Number(t),i=o[p];if(!i||l(i))return;if(a.allowedLiterals?.includes(i))return;const s=(e=>"string"!=typeof e?null:_.find(({prefix:t})=>e.startsWith(t))||null)(i);if(!s)return void n.push({field:`${e}.run.${p+1}`,message:`\`${i}\` has no recognizable ID prefix.`});const c="subspace_map"===s.map?r:d?.[s.map];if("subspace_map"!==s.map&&!d)return;const y=u(e,p,i,s.map,c);y&&n.push(y)}),n},E=(e,t,r,a)=>{const n=[];return Object.entries(t?.case_map||{}).forEach(([t,o])=>{o?.commented||p(o?.run||[])&&i(n,b(`${e}.case_map.${t}`,o.run,r,a))}),n};e.exports=function(e,t={}){const r=[],a=o(e,"root_subspace_id",e.subspace_map);return a&&r.push({field:"root_subspace_id",message:a}),Object.entries(e.subspace_map||{}).forEach(([t,a])=>{if(a.module?.link)return;const n=o(a,"root_canvas_id",a.canvas_map);n&&r.push({field:`subspace_map.${t}.root_canvas_id`,message:n}),Object.entries(a.canvas_map||{}).forEach(([n,p])=>{i(r,((e,t=[],r={},a={},n)=>t.reduce((t,p,o)=>{const i={};switch(p.type){case"brick":i.field=`${e}.${o}.brick_id`,p.brick_id?r[p.brick_id]||(i.message="The entry of `brick_id` is not defined in the map."):i.message="`brick_id` is not defined.";break;case"subspace":i.field=`${e}.${o}.subspace_id`,p.subspace_id?a[p.subspace_id]?n===p.subspace_id&&(i.message="Root Subspace can't be referenced as a Canvas item"):i.message="The entry of `subspace_id` is not defined in the map.":i.message="`subspace_id` is not defined."}return i.message&&t.push(i),t},[]))(`subspace_map.${t}.canvas_map.${n}.item_list`,p.item_list,a.brick_map,e.subspace_map,e.root_subspace_id))}),Object.entries(a.brick_map||{}).forEach(([n,p])=>{i(r,((e,t={},r={})=>Object.entries(t).reduce((t,[a,n])=>{const p={field:`${e}.key`};return"string"==typeof n&&n.startsWith(s)&&!r[n.replace(s,"")]&&(p.message=`Property \`${a}\` (content: \`${n}\`) is not defined in the map.`),p.message&&t.push(p),t},[]))(`subspace_map.${t}.brick_map.${n}.property`,p.property,a.property_bank_map)),i(r,y(0,`subspace_map.${t}.brick_map.${n}`,p.template_key,p.event_map,e.subspace_map||{},a.generator_map||{},a.brick_map||{}))}),Object.entries(a.generator_map||{}).forEach(([n,p])=>{i(r,y(0,`subspace_map.${t}.generator_map.${n}`,p.template_key,p.event_map,e.subspace_map||{},a.generator_map||{},a.brick_map||{}))}),Object.entries(a.property_bank_map||{}).forEach(([n,p])=>{i(r,y(0,`subspace_map.${t}.property_bank_map.${n}`,"PROPERTY_BANK",p.event_map,e.subspace_map||{},a.generator_map||{},a.brick_map||{}))})}),t.checkAutomation&&i(r,(e=>{const t=[],r=e.subspace_map||{},a=e.root_subspace_id,n=e.automation_map||{},p=Object.keys(n).length>0;return Object.entries(n).forEach(([e,n])=>{Object.entries(n?.map||{}).forEach(([n,p])=>{i(t,E(`automation_map.${e}.map.${n}`,p,r,a))})}),p||Object.entries(e.test_map||{}).forEach(([e,n])=>{i(t,E(`test_map.${e}`,n,r,a))}),t})(e)),r}},49741:(e,t,r)=>{const a=r(95479),{animationRunTypes:n,autoGeneratedItemIdKind:p}=r(99470);t.systemActionDescriptions={PROPERTY_BANK_EXPRESSION:{default:"","en-us":"Change Data value with script expression. One expression of return value","zh-tw":"使用腳本表達式改變 Data 值。 一個表達式回傳值","ja-jp":"スクリプト式を使用して Data の値を変更する。1つの式で値を返す"},PROPERTY_BANK:{default:"","en-us":"Change Data value","zh-tw":"改變 Data 值","ja-jp":"Data の値を変更する"},PROPERTY_BANK_COMMAND:{default:"","en-us":"Trigger Data calculation flow without value change","zh-tw":"不需改變值,觸發 Data 計算流程","ja-jp":"値を変更せずに Data の計算フローをトリガーする"},DYNAMIC_BRICK:{default:"","en-us":"[Unstable] Dynamically generate bricks","zh-tw":"[Unstable] 動態地産生 Bricks","ja-jp":"動的に生成されたブリック"},DYNAMIC_BRICK_RESET:{default:"","en-us":"[Unstable] Reset Dynamic Bricks","zh-tw":"[Unstable] 重設 Dynamic Bricks","ja-jp":"動的に生成されたブリックをリセットする"},DYNAMIC_ANIMATION:{default:"","en-us":"Run specific Animation on specific Brick","zh-tw":"在指定的 Brick 上運行指定的 Animation","ja-jp":"指定されたブリックで指定されたアニメーションを実行する"},DYNAMIC_ANIMATION_RESET:{default:"","en-us":"Reset Dynamic Animation","zh-tw":"重設 Dynamic Animation","ja-jp":"動的なアニメーションをリセットする"},DYNAMIC_ANIMATION_STOP:{default:"","en-us":"Stop Dynamic Animation","zh-tw":"停止 Dynamic Animation","ja-jp":"動的なアニメーションを停止する"},CHANGE_CANVAS:{default:"","en-us":"Change canvas on the current Subspace","zh-tw":"在當前的 Subspace 中切換 Canvas","ja-jp":"現在の Subspace の Canvas を変更する"},MESSAGE:{default:"","en-us":"Log System message","zh-tw":"Log System message","ja-jp":"システムメッセージをログに記録する"},ALERT:{default:"","en-us":"Show system alert popup with custom message","zh-tw":"顯示自定義訊息的系統警告彈窗","ja-jp":"カスタムメッセージを使用してシステム警告ポップアップを表示する"},POPUP_RESET:{default:"","en-us":"Close current showing popups with type or id.","zh-tw":"關閉目前顯示的 Popup,可以指定 Popup 類型或 id。","ja-jp":"現在表示されているポップアップを閉じる、または ID で指定されたポップアップを閉じる。"},TAKE_SCREENSHOT:{default:"","en-us":"Take screenshot for current subspace or the full viewport (including portal subspaces)","zh-tw":"為當前的 Subspace 截圖,或截取整個顯示畫面(包含 Portal Subspace)","ja-jp":"現在の Subspace またはビューポート全体(Portal Subspace を含む)のスクリーンショットを撮る"},STORAGE_SET:{default:"","en-us":"Store a value in application-specific storage","zh-tw":"在應用程式特定的儲存空間中儲存值","ja-jp":"アプリケーション固有のストレージに値を保存する"},STORAGE_RETRIEVE:{default:"","en-us":"Retrieve a value from application-specific storage","zh-tw":"從應用程式特定的儲存空間中取得值","ja-jp":"アプリケーション固有のストレージから値を取得する"},STORAGE_DELETE:{default:"","en-us":"Delete a value from application-specific storage or clear all values","zh-tw":"從應用程式特定的儲存空間中刪除值或清除所有值","ja-jp":"アプリケーション固有のストレージから値を削除するか、すべての値をクリアする"},CHANNEL_SUBSCRIBE:{default:"","en-us":"Subscribe to a channel for data update","zh-tw":"訂閱一個 Channel 以接收資料更新","ja-jp":"チャンネルを購読してデータ更新を受け取る"},CHANNEL_UNSUBSCRIBE:{default:"","en-us":"Unsubscribe from a channel","zh-tw":"取消訂閱一個 Channel","ja-jp":"チャンネルから購読を解除する"},CHANNEL_PUBLISH:{default:"","en-us":"Publish data to a channel","zh-tw":"發布資料到一個 Channel","ja-jp":"チャンネルにデータを発行する"},DELAY:{default:"","en-us":"Delay for a certain time between actions","zh-tw":"延遲一段時間,用於兩個動作之間","ja-jp":"一定時間遅延する、2つのアクションの間"},USE_SHARE_APPLICATION:{default:"","en-us":"[Internal] Use a shared application","zh-tw":"[Internal] 切換到分享的應用程式","ja-jp":"[Internal] 共有アプリケーションを使用する"},AUTH_IN_DEVICE:{default:"","en-us":"[Internal] Auth in device","zh-tw":"[Internal] 在裝置上進行帳號登入","ja-jp":"[Internal] デバイスで認証する"},REFRESH_BINDCODE:{default:"","en-us":"[Internal] Refresh passcode for bind device","zh-tw":"[Internal] 更新裝置綁定碼","ja-jp":"[Internal] デバイスのバインドコードを更新する"},OPEN_URL:{default:"","en-us":"Open URL","zh-tw":"開啟 URL","ja-jp":"URL を開く"},OPEN_FILE:{default:"","en-us":"Open File or Directory","zh-tw":"開啟檔案或目錄","ja-jp":"ファイルまたはディレクトリを開く"},THROW_EXCEPTION:{default:"","en-us":"Throw exception","zh-tw":"拋出例外","ja-jp":"例外を投げる"},RESTART_FOUNDATION:{default:"","en-us":"Restart the foundation (React Native bundle)","zh-tw":"重新啟動基礎設施 (React Native bundle)","ja-jp":"基盤を再起動する (React Native bundle)"},DISMISS_KEYBOARD:{default:"","en-us":"Dismiss keyboard","zh-tw":"關閉鍵盤","ja-jp":"キーボードを閉じる"},TRIGGER_APPLICATION_FILTER:{default:"","en-us":"Trigger application AI filter","zh-tw":"觸發應用程式 AI 過濾器","ja-jp":"アプリケーション AI フィルターをトリガーする"},STOP_APPLICATION_FILTER:{default:"","en-us":"Stop running application AI filter","zh-tw":"停止運行中的應用程式 AI 過濾器","ja-jp":"実行中のアプリケーション AI フィルターを停止する"},SAVE_UPDATE_SNAPSHOT:{default:"","en-us":"Save update snapshot (from Application Filter or DevTools MCP Server) to media system","zh-tw":"儲存更新快照 (來自 Application Filter 或 DevTools MCP Server) 到媒體系統","ja-jp":"メディアシステムに更新スナップショット (Application Filter または DevTools MCP サーバーから) を保存する"}},t.systemActions={PROPERTY_BANK_EXPRESSION:{displayName:"CHANGE DATA WITH EXPRESSION",canProvideProperty:!0,filterKind:[p],propertyNameType:"defined_properties",property:{EXPRESSION:{type:"string",displayName:"Expression",normalizeDisplayName:!1},VARIABLES:{type:"nested",schema:{type:"object",properties:{id:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Data ID",normalizeDisplayName:!1},key:{type:"string"}},allowNewItem:!0},popover:!0,defaultValue:[]},RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},RESULT_ASSIGN_PATH:{type:"string"},ERROR_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1}},previewIcon:{type:"font-awesome-6pro",name:"bolt",size:14}},PROPERTY_BANK:{displayName:"CHANGE DATA",canProvideProperty:!0,filterKind:[p],propertyNameType:"property_bank",previewIcon:{type:"font-awesome-6pro",name:"bolt",size:14}},PROPERTY_BANK_COMMAND:{displayName:"TRIGGER DATA COMMAND",disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"property_bank",type:"bool",previewIcon:{type:"font-awesome-6pro",name:"bolt",size:16}},DYNAMIC_BRICK:{hidden:"unstable",disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{DYNAMIC_BRICK_ADD_LIST:{type:"string"},DYNAMIC_BRICK_PREFER_AFTER_ITEM_ID:{type:"string"},DYNAMIC_BRICK_RESET:{type:"bool"},DYNAMIC_BRICK_REMOVE_ITEM_ID:{type:"string"},DYNAMIC_BRICK_REMOVE_ITEMS:{type:"string"}},previewIcon:{type:"font-awesome-6pro",name:"grid-2"}},DYNAMIC_BRICK_RESET:{hidden:"unstable",disallowMultiple:!0,canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"rotate-right"}},DYNAMIC_ANIMATION:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{DYNAMIC_ANIMATION_BRICK_ID:{type:"string",kind:"id",idType:"brick"},DYNAMIC_ANIMATION_ANIMATION_ID:{type:"string",kind:"id",idType:"animation"},DYNAMIC_ANIMATION_RUN_TYPE:{type:"oneOf",oneOf:n},DYNAMIC_ANIMATION_RESET_INITIAL_VALUE:{type:"bool"}},previewIcon:{type:"font-awesome-6pro",name:"bars-staggered",size:16}},DYNAMIC_ANIMATION_RESET:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{DYNAMIC_ANIMATION_BRICK_ID:{type:"string",kind:"id",idType:"brick"}},previewIcon:{type:"font-awesome-6pro",name:"rotate-right"}},DYNAMIC_ANIMATION_STOP:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{DYNAMIC_ANIMATION_BRICK_ID:{type:"string",kind:"id",idType:"brick"}},previewIcon:{type:"font-awesome-6pro",name:"stop"}},CHANGE_CANVAS:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{CANVAS_ID:{type:"string",kind:"id",idType:"canvas"},CANVAS_TITLE_LIKE:{type:"string"},CANVAS_KEY_MAP_LIST:{type:"nested",schema:{type:"object",properties:{key:{displayName:"Key",type:"string"},value:{displayName:"Canvas ID",type:"string",kind:"id",idType:"canvas"}},allowNewItem:!0},popover:!0,defaultValue:[]},CANVAS_KEY:{type:"string"}},previewIcon:{type:"font-awesome-6pro",name:"diamond-turn-right",size:16}},MESSAGE:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{SYSTEM_MESSAGE_TYPE:{type:"oneOf",oneOf:["SYSTEM_MESSAGE_TYPE_INFO","SYSTEM_MESSAGE_TYPE_SUCCESS","SYSTEM_MESSAGE_TYPE_WARNING","SYSTEM_MESSAGE_TYPE_ERROR"]},SYSTEM_MESSAGE_TITLE:{type:"string"},SYSTEM_MESSAGE_MESSAGE:{type:"string"}},previewIcon:{type:"font-awesome-6pro",name:"note"}},ALERT:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{ALERT_ID:{type:"string"},ALERT_TYPE:{type:"oneOf",oneOf:["info","success","warning","error"]},ALERT_TITLE:{type:"string"},ALERT_MESSAGE:{type:"string"},ALERT_SELECTIONS:{type:"nested",schema:{type:"object",properties:{label:{type:"string"},color:{type:"string"},value:{type:"string"},disableResult:{type:"bool"}},allowNewItem:!0},popover:!0,defaultValue:[]},ALERT_SELECTION_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},ALERT_TIMEOUT:{type:"number",defaultValue:1e4},ALERT_HIDE_SELECTIONS:{type:"bool"}},previewIcon:{type:"font-awesome-6pro",name:"bell"}},POPUP_RESET:{disallowMultiple:!0,canProvideProperty:!0,propertyNameType:"defined_properties",property:{POPUP_CLEAR_TYPE:{type:"oneOf",oneOf:["all","alert","generator"]},POPUP_ID:{type:"string"}},previewIcon:{type:"font-awesome-6pro",name:"rotate-right"}},TAKE_SCREENSHOT:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{TAKE_SCREENSHOT_CURRENT_SUBSPACE:{type:"bool"},TAKE_SCREENSHOT_BRICK_ID:{type:"string",kind:"id",idType:"brick",displayName:"Brick ID",normalizeDisplayName:!1},TAKE_SCREENSHOT_FORMAT:{type:"oneOf",oneOf:["jpg","png"]},TAKE_SCREENSHOT_QUALITY:{type:"number",max:1,min:0,step:.1},TAKE_SCREENSHOT_WIDTH:{type:"number"},TAKE_SCREENSHOT_HEIGHT:{type:"number"},TAKE_SCREENSHOT_SAVE_PROPERTY:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1}},previewIcon:{type:"font-awesome-6pro",name:"camera",size:16}},STORAGE_SET:{displayName:"STORAGE SET",canProvideProperty:!0,propertyNameType:"defined_properties",property:{STORAGE_TYPE:{type:"oneOf",oneOf:["persist","in-memory"],displayName:"Storage Type",defaultValue:"persist"},STORAGE_SCOPE:{type:"oneOf",oneOf:["global","subspace"],displayName:"Storage Scope",defaultValue:"global"},STORAGE_KEY:{type:"string",displayName:"Key",normalizeDisplayName:!1},STORAGE_VALUE:{type:"any",displayName:"Value",normalizeDisplayName:!1}},previewIcon:{type:"font-awesome-6pro",name:"database",size:14}},STORAGE_RETRIEVE:{displayName:"STORAGE RETRIEVE",canProvideProperty:!0,propertyNameType:"defined_properties",property:{STORAGE_TYPE:{type:"oneOf",oneOf:["persist","in-memory"],displayName:"Storage Type",defaultValue:"persist"},STORAGE_SCOPE:{type:"oneOf",oneOf:["global","subspace"],displayName:"Storage Scope",defaultValue:"global"},STORAGE_KEY:{type:"string",displayName:"Key",normalizeDisplayName:!1},STORAGE_RETRIEVE_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Result Target"},STORAGE_RETRIEVE_DEFAULT_VALUE:{type:"string",displayName:"Default Value",normalizeDisplayName:!1},STORAGE_RETRIEVE_SKIP_IF_NOT_FOUND:{type:"bool",displayName:"Skip if Not Found",defaultValue:!1}},previewIcon:{type:"font-awesome-6pro",name:"database",size:14}},STORAGE_DELETE:{displayName:"STORAGE DELETE",canProvideProperty:!0,propertyNameType:"defined_properties",property:{STORAGE_TYPE:{type:"oneOf",oneOf:["persist","in-memory"],displayName:"Storage Type",defaultValue:"persist"},STORAGE_SCOPE:{type:"oneOf",oneOf:["global","subspace"],displayName:"Storage Scope",defaultValue:"global"},STORAGE_KEY:{type:"string",displayName:"Key",normalizeDisplayName:!1},STORAGE_DELETE_ALL:{type:"bool",displayName:"Delete All Values",defaultValue:!1}},previewIcon:{type:"font-awesome-6pro",name:"trash",size:14}},CHANNEL_SUBSCRIBE:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{CHANNEL_SUBSCRIBE_KEY:{type:"string"},CHANNEL_SUBSCRIBE_TYPE:{type:"oneOf",oneOf:["on","once"]},CHANNEL_SUBSCRIBE_LIVETIME:{type:"number",kind:"unit",unit:"ms"},CHANNEL_SUBSCRIBE_DATA_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Result"},CHANNEL_SUBSCRIBE_DATA_ASSIGN_LIST:{type:"nested",schema:{type:"object",properties:{path:{displayName:"Object Path",type:"string"},type:{type:"oneOf",oneOf:["any","string","number","bool","array","object"],oneOfEmptyOption:!1,defaultValue:"any"},id:{displayName:"Data ID",type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},required:{type:"bool",defaultValue:!1}},allowNewItem:!0},popover:!0,defaultValue:[]},CHANNEL_SUBSCRIBE_PROGRESS_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Progress"},CHANNEL_SUBSCRIBE_PROGRESS_ASSIGN_LIST:{type:"nested",schema:{type:"object",properties:{path:{displayName:"Object Path",type:"string"},type:{type:"oneOf",oneOf:["any","string","number","bool","array","object"],oneOfEmptyOption:!1,defaultValue:"any"},id:{displayName:"Data ID",type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},required:{type:"bool",defaultValue:!1}},allowNewItem:!0},popover:!0,defaultValue:[]},CHANNEL_SUBSCRIBE_ERROR_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Error"}},previewIcon:{type:"font-awesome-6pro",name:"display",size:16}},CHANNEL_UNSUBSCRIBE:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{CHANNEL_UNSUBSCRIBE_KEY_MATCH:{type:"string"}}},CHANNEL_PUBLISH:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{CHANNEL_PUBLISH_KEY_MATCH:{type:"string"},CHANNEL_PUBLISH_PAYLOAD_TYPE:{type:"oneOf",oneOf:["result","progress","error"]},CHANNEL_PUBLISH_PAYLOAD:{type:"string"}}},DELAY:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{DELAY_TIME:{type:"number",kind:"unit",unit:"ms"}}},USE_SHARE_APPLICATION:{hidden:"internal",canProvideProperty:!0,propertyNameType:"defined_properties",property:{APPLICATION_ID:{type:"string"},RELEASE_VERSION:{type:"string"},USE_TYPE:{type:"oneOf",oneOf:["run","use-after-bind","cancel-use"]},VIEWPORT_PRESET_NAME_LIKE:{type:"string"},VIEWPORT_PRESET_DEVICE_TARGET:{type:"string"},ENABLE_LOCAL_SYNC:{type:"bool"}},previewIcon:{type:"font-awesome-6pro",name:"display",size:16}},AUTH_IN_DEVICE:{hidden:"internal",canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"user",size:16}},REFRESH_BINDCODE:{hidden:"internal",canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"arrows-rotate",size:16}},OPEN_URL:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{URL:{type:"string",normalizeDisplayName:!1,displayName:"URL"},BEHAVIOR:{type:"oneOf",oneOf:["in-app","new-window"]},IN_APP_TINT_COLOR:{type:"string",kind:"color",popover:!0}},previewIcon:{type:"font-awesome-6pro",name:"external-link",size:16}},OPEN_FILE:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{PICK_TYPE:{type:"oneOf",oneOf:["file","multiple","directory"],oneOfEmptyOption:!1},FILE_TYPE:{type:"any"},COPY_TO:{type:"oneOf",oneOf:["cache","document"]},MODE:{type:"oneOf",oneOf:["import","open"]},SAVE_PROPERTY:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},SAVE_DETAIL_PROPERTY:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1},ERROR_SAVE_PROPERTY:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1}},previewIcon:{type:"font-awesome-6pro",name:"folder-open",size:16}},THROW_EXCEPTION:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{BEHAVIOR:{type:"oneOf",oneOf:["application","native"]},EXCEPTION_MESSAGE:{type:"string",displayName:"Exception Message"}},previewIcon:{type:"font-awesome-6pro",name:"bomb",size:16}},RESTART_FOUNDATION:{canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"arrows-rotate",size:16}},DISMISS_KEYBOARD:{canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"keyboard-down",size:16}},TRIGGER_APPLICATION_FILTER:{canProvideProperty:!0,propertyNameType:"defined_properties",property:{NAME:{type:"string",displayName:"Filter Name",normalizeDisplayName:!1},VARIABLES:{type:"any",displayName:"Variables",normalizeDisplayName:!1},RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Result Target"},ERROR:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Error Target"}},previewIcon:{type:"font-awesome-6pro",name:"robot",size:16}},STOP_APPLICATION_FILTER:{canProvideProperty:!1,previewIcon:{type:"font-awesome-6pro",name:"stop",size:16}},SAVE_UPDATE_SNAPSHOT:{displayName:"SAVE UPDATE SNAPSHOT",canProvideProperty:!0,propertyNameType:"defined_properties",property:{SNAPSHOT_FILE_INDENTIFIER:{type:"string",displayName:"Filename Identifier",defaultValue:"default",normalizeDisplayName:!1},SNAPSHOT_SAVE_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Result Target"},SNAPSHOT_ERROR_RESULT:{type:"string",kind:"id",idType:"property_bank",showPropertyBankLink:!1,displayName:"Error Target"}},previewIcon:{type:"font-awesome-6pro",name:"camera-retro",size:16}}},t.getSubspaceActionTypes=e=>Object.entries(e?.action_map||{}).reduce((e,[t,r])=>(e[`SUBSPACE_ACTION_${t}`]={canProvideProperty:Object.keys(r.event_property_map||{}).length>0,property:Object.entries(r.event_property_map||{}).reduce((e,[t,r])=>(e[`SUBSPACE_${t}`]={type:r.type,name:a(t)},e),{}),propertyNameType:"defined_properties"},e),{})},54369:(e,t,r)=>{const{getIDPattern:a}=r(1639);e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/generator.schema.json5",title:"Generator",description:"A generator config",type:"object",properties:{alias:{type:"string",description:"Optional alias for this generator, used as variable name in code generation."},title:{type:"string",description:"This generator's name."},description:{type:"string",description:"This generator's description."},local_sync:{type:"object",description:"Define generator behavior on Local Sync mode.",properties:{run_mode:{type:"string",enum:["all","main-only","minor-only"]}}},template_key:{type:"string"},property:{type:"object"},outlet:{type:"object",patternProperties:{"^GENERATOR_(.)+$":{type:"string",pattern:a("PROPERTY_BANK_DATA_NODE")}},additionalProperties:!1},event_map:{$ref:"http://display.bricks.tools/event_map.schema.json5",description:"Use event map describe how event should go."}},required:["template_key"]}},62701:e=>{e.exports=JSON.parse('["easeInSine","easeOutSine","easeInOutSine","easeInQuad","easeOutQuad","easeInOutQuad","easeInCubic","easeOutCubic","easeInOutCubic","easeInQuart","easeOutQuart","easeInOutQuart","easeInQuint","easeOutQuint","easeInOutQuint","easeInExpo","easeOutExpo","easeInOutExpo","easeInCirc","easeOutCirc","easeInOutCirc","easeInBack","easeOutBack","easeInOutBack","easeInElastic","easeOutElastic","easeInOutElastic","easeInBounce","easeOutBounce","easeInOutBounce"]')},66354:(e,t,r)=>{const{getIDPattern:a}=r(1639),n=a("CANVAS");e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/subspace.schema.json5",title:"Subspace",description:"A brick subspace config",type:"object",properties:{routing:{type:"object",patternProperties:{[a("PROPERTY_BANK_DATA_NODE")]:{type:"object",properties:{enabled_routing:{type:["boolean","null"]}}}},additionalProperties:!1},title:{type:"string",description:"Subspace Title"},description:{type:"string",description:"Subspace Description"},module:{type:"object"},layout:{type:"object",properties:{width:{type:"number"},height:{type:"number"}}},root_canvas_id:{type:"string",description:"Canvas ID point to this stage entry subspace.",pattern:n},property_bank_map:{type:"object",patternProperties:{[a("PROPERTY_BANK_DATA_NODE")]:{$ref:"http://display.bricks.tools/property_bank.schema.json5",description:"One subspace can have many property bank."}},additionalProperties:!1},property_bank_calc_map:{type:"object",patternProperties:{[a("PROPERTY_BANK_COMMAND_MAP")]:{type:"object",properties:{type:{type:"string",enum:["general","script"]},map:{type:"object",patternProperties:{[a("PROPERTY_BANK_(DATA_NODE|COMMAND_NODE)")]:{$ref:"http://display.bricks.tools/property_bank_command.schema.json5",description:"One command map can have many property bank data node."}}},editor_info:{type:"object",patternProperties:{[a("PROPERTY_BANK_(DATA_NODE|COMMAND_NODE)")]:{type:"object",properties:{position:{type:"object",properties:{x:{type:"number"},y:{type:"number"}}},points:{type:"object"}},description:"One command map can have many property bank data node."}}},script_config:{$ref:"http://display.bricks.tools/property_bank_calc_script_config.schema.json5",description:"JavaScript Sandbox calculation config"},note:{type:"string",description:"Note of this calc map."}},description:"One command map can have many property bank commands"}},additionalProperties:!1},brick_map:{type:"object",patternProperties:{[a("BRICK")]:{$ref:"http://display.bricks.tools/brick.schema.json5",description:"One subspace can have many brick."}},additionalProperties:!1},generator_map:{type:"object",patternProperties:{[a("(GENERATOR|AUTO_GENERATOR)")]:{$ref:"http://display.bricks.tools/generator.schema.json5",description:"One subspace can have many generator."}},additionalProperties:!1},animation_map:{type:"object",patternProperties:{[a("ANIMATION")]:{$ref:"http://display.bricks.tools/animation.schema.json5",description:"One subspace can have many animation."}},additionalProperties:!1},canvas_map:{type:"object",patternProperties:{[n]:{$ref:"http://display.bricks.tools/canvas.schema.json5",description:"One subspace can have many canvas."}},additionalProperties:!1},local_sync:{type:"object",description:"Define subspace behavior on Local Sync mode.",properties:{change_canvas:{type:"string",enum:["all","main-only","minor-only"]}}}},if:{properties:{module:{type:"object",properties:{link:{const:!0}},required:["link"]}},required:["module"]},then:{required:["module"]},else:{required:["root_canvas_id","property_bank_map","brick_map","generator_map","animation_map","canvas_map"]}}},78078:(e,t,r)=>{const{parse:a}=r(89236),{expressionFoldAcornOptions:n}=r(41900),p=(e,t,r)=>{e&&"object"==typeof e&&(Array.isArray(e)?e.forEach((e,a)=>p(e,`${t}[${a}]`,r)):Object.entries(e).forEach(([e,o])=>{"event_map"!==e&&"eventMap"!==e||!o||"object"!=typeof o?o&&"object"==typeof o&&p(o,`${t}.${e}`,r):Object.entries(o).forEach(([p,o])=>{Array.isArray(o)&&o.forEach((o,i)=>{if("PROPERTY_BANK_EXPRESSION"!==o?.action)return;const s=(e=>{const t=e.parameter_list||e.parameterList||[];if(!Array.isArray(t))return;const r=t.find(e=>"EXPRESSION"===(e?.input_to_receiver||e?.inputToReceiver));return r?r.result_from_sender??r.resultFromSender:void 0})(o);if("string"!=typeof s||s.startsWith("PROPERTY_BANK#"))return;const c=(e=>{if(!e.trim())return"Expression is empty";try{a(e,n)}catch(e){return`Expression does not parse: ${e.message}`}return null})(s);c&&r.push({field:`${t}.${e}.${p}[${i}]`,message:c})})})}))};e.exports=function(e){const t=[];return Object.entries(e.subspace_map||{}).forEach(([e,r])=>{r.module?.link||p(r,`subspace_map.${e}`,t)}),t}},79458:(e,t,r)=>{const{getIDPattern:a}=r(1639),n=a("SUBSPACE"),p=a("TEST");e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/root.schema.json5",title:"Root",description:"A brick root config",type:"object",properties:{title:{type:"string",description:"The root config name."},root_subspace_id:{type:"string",description:"The root subspace id.",pattern:n},subspace_map:{type:"object",patternProperties:{[n]:{$ref:"http://display.bricks.tools/subspace.schema.json5",description:"Root config can have many subspace."}},additionalProperties:!1},test_map:{type:"object",patternProperties:{[p]:{$ref:"http://display.bricks.tw/test.schema.json5",description:"Root config can have many test."}},additionalProperties:!1,deprecated:!0,description:"Deprecated in favor of automation_map.AUTOMATION_MAP_DEFAULT"},automation_map:{$ref:"http://display.bricks.tools/automation_map.schema.json5",description:"Maps of automation tests organized by collection"},show_viewports:{type:"boolean",description:"Show device viewport reference on editor"},enable_unstable_bricks:{type:"boolean",description:"Enable unstable bricks / generators"},hide_short_refs:{type:"boolean",description:"Hide all instances in Short Edit mode"},warnings:{type:"array",description:"Config validation warnings from server"}},required:["title","subspace_map","root_subspace_id"]}},80211:(e,t,r)=>{const a=r(11601),{propertyBank:n,propertyBankCommand:p,propertyBankCalcScriptConfig:o}=r(7436),i=new a({strict:!1,schemas:[r(85912),n,p,o,r(5982),r(54369),r(24090),r(27449),r(85190),r(66354),r(92514),r(97256),r(79458)]});function s(e){const t=i.getSchema("http://display.bricks.tools/root.schema.json5");return t(e),t.errors||[]}s.ajv=i,e.exports=s},85190:(e,t,r)=>{const a=r(62701),{getIDPattern:n}=r(1639),p={type:"object",properties:{method:{type:"string",anyOf:[{enum:[""].concat(a)},{pattern:"^cubic-bezier\\([\\d.-]+,\\s*[\\d.-]+,\\s*[\\d.-]+,\\s*[\\d.-]+\\)$"}]},duration:{type:"number",min:0}}},o={type:"object",properties:{x:{type:"number"},y:{type:"number"},width:{type:"number"},height:{type:"number"}}},i={type:"object",properties:{default:p,x:p,y:p,width:p,height:p,opacity:p}},s={type:"object",properties:{x:{type:"number"},y:{type:"number"},width:{type:"number"},height:{type:"number"},standby_mode:{type:"string",enum:["custom","top","left","right","bottom"]},standby_frame:o,standby_opacity:{type:"number"},standby_delay:{type:"number"},standby_delay_random:{type:"number"},standby_easing:i,showing_delay:{type:"number"},render_out_of_viewport:{type:"boolean"}}};e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/canvas.schema.json5",title:"Canvas",description:"A brick canvas config",type:"object",properties:{alias:{type:"string",description:"Optional alias for this canvas, used as variable name in code generation."},title:{type:"string",description:"Canvas Title"},description:{type:"string",description:"Canvas Description"},property:{type:"object"},event_map:{$ref:"http://display.bricks.tools/event_map.schema.json5",description:"Use event map describe how event should go."},state_group:{$ref:"http://display.bricks.tools/state_group.schema.json5",description:"Use state group to describe how to transform property, event and outlet."},item_list:{type:"array",items:{type:"object",oneOf:[{properties:{type:{type:"string",enum:["subspace"]},subspace_id:{type:"string",description:"The subspace id",pattern:n("SUBSPACE")},frame:{...s,properties:{...s.properties,exceed_boundary:{type:"boolean"}}}}},{properties:{type:{type:"string",enum:["brick"]},brick_id:{type:"string",description:"The brick id",pattern:n("BRICK")},frame:s}}]}}}},e.exports.standbyFrame=o,e.exports.standbyEasing=i},85912:e=>{e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/event_map.schema.json5",title:"Event Map",description:"A event map config",type:"object",patternProperties:{"^.+$":{type:"array",description:"List all handler response to this event.",items:{type:"object",description:"A handle trigger action and parameter.",properties:{action:{type:"string",description:"Which action will be execute."},handler:{type:"string",description:"Which generator are handler."},wait_async:{type:"boolean",description:"Wait for async action finish."},parameter_list:{type:"array",description:"Describe how which data will as parameter and send to where.",items:{type:"object",properties:{result_from_sender:{description:"Describe which data will be the input."},input_to_receiver:{description:"Describe where the input data will go."}},required:["input_to_receiver"]}}},required:["action","handler","parameter_list"]}}},additionalProperties:!1}},86343:(e,t,r)=>{const{v4:a}=r(79194),n=r(95479),{nameMap:p,brickMapping:o,generatorMapping:i}=r(63981);t.idByItem=(e={})=>e.canvas_id||e.subspace_id||e.brick_id||e.generator_id||e.property_bank_id||e.property_bank_calc_id||e.bank_id||e.scene_id,t.getAnimationType=e=>e.type||e.compose_type||e.composeType,t.cleanUpAnimationMap=e=>Object.entries(e).reduce((e,[t,r])=>((r.type||r.compose_type)&&(e[t]=r),e),{}),t.matchItemByItem=(e,t)=>{if(!e)return!1;let r;switch("string"==typeof t&&(r=t),e.type){case"brick":return e.brick_id===(r||t.brick_id);case"subspace":return e.subspace_id===(r||t.subspace_id);case"canvas":return e.canvas_id===(r||t.canvas_id);case"generator":return e.generator_id===(r||t.generator_id);case"property_bank":return e.property_bank_id===(r||t.property_bank_id);default:return!1}},t.makePasscode=()=>a(),t.kindOneOfTypes={string:["color","datetime","id","graphql","rich-text-content","sandbox-script","llm-prompt","media-resource-image","media-resource-video","media-resource-audio","media-resource-file","lottie-file-uri","rive-file-uri","ggml-model-asset","gguf-model-asset","binary-asset"],number:["unit"],object:["tts-speaker-config"],"array-object":["llm-tools","llm-messages","mcp-server-resources","mcp-server-tools","mcp-server-prompts"]},t.getKindOneOfTypes=(e,r)=>"array"===e?"object"===r?t.kindOneOfTypes[`${e}-${r}`]:void 0:t.kindOneOfTypes[e],t.unitOneOfTypes=["grid","px","ms"],t.idOneOfTypes=["canvas","brick","generator","animation","property_bank"],t.typeToName={brick:"Brick",generator:"Generator",subspace:"Subspace",canvas:"Canvas",animation:"Animation",property_bank:"Data",property_bank_calc:"Calculation"},t.getBrickName=(e,r,a)=>{if(!r)return e.toUpperCase();if(r.title)return r.title;let o;switch(e){case"bank":o="BANK";break;case"subspace":o="SUBSPACE";break;case"canvas":o="CANVAS";break;case"animation":o=`<${n(t.getAnimationType(r))}>`;break;case"property_bank":o="<Data>";break;case"property_bank_calc":o="<Map>";break;case"state_group":o="<Switch Case>";break;default:o=`<${p[r.template_key||r.templateKey]||"Unknown"}>`}return a&&a.length>10?o+=` (${a.replace(/[A-Z_]+/g,"").substr(0,6)}...)`:a&&(o+=` (${a})`),o},t.getCallInternalActions=e=>{const t=o[e]||i[e];if(t)return t.callInternalActions},t.mapToList=(e,r)=>Object.entries(r).reduce((r,[a,n])=>(r.push({id:a,...n,title:t.getBrickName(e,n,a)}),r),[]);const s={subspaceMap:"subspace",brickMap:"brick",generatorMap:"generator",propertyBankMap:"property_bank",propertyAvailableToAdd:"property_bank",canvasMap:"canvas",animationMap:"animation"},c={};t.mapToListForDerivedState=(e,r,a,n)=>{const p=a[e]||c;return p!==n[e]?{[e]:p,[r]:t.mapToList(s[e],p)}:{}},t.arrayTypePrefix="array of ",t.propertyBankTypes=["string","number","bool","object","any",`${t.arrayTypePrefix}string`,`${t.arrayTypePrefix}number`,`${t.arrayTypePrefix}bool`,`${t.arrayTypePrefix}object`],t.animationRunTypes=["once","loop"],t.stopPropagationOnKeyBackspace=e=>{8===e.keyCode&&e.stopPropagation()},t.nestedTypes=["object","array","any"],t.isPropertyBankTypeNested=e=>t.nestedTypes.includes(e),t.propertyTypeToSchema=e=>{const r=e.indexOf(t.arrayTypePrefix)>-1,a=e.replace(t.arrayTypePrefix,"");return{type:a,properties:"object"===a?{}:void 0,allowNewItem:r,allowCustomProperty:"object"===a}}},92514:(e,t,r)=>{const{getIDPattern:a}=r(1639);e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tw/test.schema.json5",title:"Test",description:"A brick test config",type:"object",properties:{title:{type:"string",description:"Test Title"},description:{type:"string",description:"Test Description"},meta:{type:"object",properties:{}},open_report_on_failed:{type:"boolean",description:"Open Automation report on failed"},use_media_flow_screenshots:{type:"boolean",description:"Save screeshots to SYSTEM media box if enabled"},trigger_type:{type:"string",enum:["launch","anytime","cron"],description:"Trigger type (launch: restart the application, anytime: trigger directly)"},cron:{type:"string",description:"Cron Expression"},timeout:{type:"number",description:"Test runtime timeout"},case_map:{type:"object",patternProperties:{[a("TEST_CASE")]:{type:"object",properties:{id:{type:"string"},name:{type:"string"},run:{type:"array"},commented:{type:"boolean"},exit_on_failed:{type:"boolean"},pre_delay:{type:"number"},post_delay:{type:"number"}}}},additionalProperties:!1},var_map:{type:"object",patternProperties:{[a("TEST_VAR")]:{type:"object",properties:{title:{type:"string",description:"This var's name."},type:{type:"string",enum:["string","number","array","object","bool","any"]},value:{}}}},additionalProperties:!1}},required:["case_map","var_map"]}},97256:(e,t,r)=>{const{getIDPattern:a}=r(1639),n=a("TEST");e.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://display.bricks.tools/automation_map.schema.json5",title:"Automation Map",description:"A map of automation test collections",type:"object",patternProperties:{"AUTOMATION_MAP_.*":{type:"object",properties:{title:{type:"string",description:"The name of the test map"},createdAt:{type:"number",description:"The creation timestamp of the test map"},map:{type:"object",patternProperties:{[n]:{$ref:"http://display.bricks.tw/test.schema.json5",description:"A test configuration"}},additionalProperties:!1}}}},additionalProperties:!1}},99470:(e,t)=>{t.animationRunTypes=["once","loop"],t.autoGeneratedItemIdKind="auto-generated-item-id";const r=/^([^.](?![\w!#$%&'*+/=?^`{|}~\-]+\.\.)([\w!#$%&'*+./=?^`{|}~\-]+[^.])|([\dA-Za-z]{1,2}))@([\dA-Za-z-]{1,64}\.){1,10}[A-Za-z]{2,64}$/;t.isEmail=e=>"string"==typeof e&&r.test(e)&&e.indexOf("@")<65&&e.length<255;const a=/^(data:)([\w+/]+);(charset=[\w-]+|base64).*,(.*)/i,n=e=>new RegExp(`^(${e.join("|")}):\\/\\/(www\\.)?([\\w#%+.:=@~-]{1,256}\\.[\\d()a-z]{1,6}\\b|localhost|[\\d]{1,3}\\.[\\d]{1,3}\\.[\\d]{1,3}\\.[\\d]{1,3})([\\w#%&()+./:=?@~-]*)`,"i"),p=["https?"],o=n(p);t.isURI=(e,t=p)=>{const r=t.includes("data");if(r&&a.test(e))return!0;return(e=>e===p||1===e.length&&"https?"===e[0]?o:n(e))(r?t.filter(e=>"data"!==e):t).test(e)}}};
|