@fugood/bricks-cli 2.25.0-beta.4 → 2.25.0-beta.6

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/779.js DELETED
@@ -1 +0,0 @@
1
- export const __webpack_esm_id__=779;export const __webpack_esm_ids__=[779];export const __webpack_esm_modules__={18779:(e,l,r)=>{r.d(l,{App:()=>se,AppDetail:()=>L,AppList:()=>C,CONTROL_ACTIONS:()=>u,DeviceControl:()=>A,DeviceDetail:()=>I,DeviceList:()=>S,DeviceScreenshot:()=>B,DeviceStatus:()=>_,Footer:()=>p,GroupDetail:()=>M,GroupList:()=>P,Header:()=>f,Loading:()=>v,MainMenu:()=>b,MediaBoxDetail:()=>N,MediaBoxList:()=>R,MediaFileDetail:()=>G,MediaFileList:()=>U,ModuleDetail:()=>w,ModuleList:()=>k,ONLINE_THRESHOLD_MS:()=>h,ProjectInitView:()=>ae,ShortEditEditor:()=>X,VIEWS:()=>x,runInteractiveMode:()=>de}),r.r(l);var t,n=r(99436),i=r(51649),o=r(8498),a=r(68832),s=r(50700),c=r(74752),d=r(47336),x={MAIN:"main",DEVICES:"devices",DEVICE_DETAIL:"device_detail",DEVICE_CONTROL:"device_control",DEVICE_SCREENSHOT:"device_screenshot",APPS:"apps",APP_DETAIL:"app_detail",APP_SHORT_EDIT:"app_short_edit",APP_PROJECT_INIT:"app_project_init",MODULES:"modules",MODULE_DETAIL:"module_detail",MODULE_SHORT_EDIT:"module_short_edit",MODULE_PROJECT_INIT:"module_project_init",GROUPS:"groups",GROUP_DETAIL:"group_detail",MEDIA_BOXES:"media_boxes",MEDIA_BOX_DETAIL:"media_box_detail",MEDIA_FILES:"media_files",MEDIA_FILE_DETAIL:"media_file_detail",ACTIVITY_LOG:"activity_log"},u=[{label:"Refresh Application",value:"refresh"},{label:"Clear Cache",value:"clear-cache"},{label:"Take Screenshot",value:"take-screenshot"},{label:"Open System Menu",value:"system-menu-open"},{label:"Close System Menu",value:"system-menu-close"},{label:"Open Debug Panel",value:"debug-panel-open"},{label:"Close Debug Panel",value:"debug-panel-close"},{label:"Enable Logging",value:"logging-on"},{label:"Disable Logging",value:"logging-off"},{label:"← Back",value:"back"}],h=3e5,g=r(47882),m=r(71178),j=(e,l=!0)=>{var r=Math.floor(60),t=(0,i.useState)(r),n=a(t,2),o=n[0],s=n[1],c=(0,i.useState)(null),d=a(c,2),x=d[0],u=d[1],h=(0,i.useRef)(e);(0,i.useEffect)(()=>{h.current=e},[e]);var g=(0,i.useCallback)(()=>{s(r),u(Date.now())},[r]);return(0,i.useEffect)(()=>{if(l){var e=setInterval(()=>{s(e=>e<=1?(h.current?.(),u(Date.now()),r):e-1)},1e3);return()=>clearInterval(e)}},[l,r]),(0,i.useEffect)(()=>{l&&(s(r),u(Date.now()))},[l,r]),{countdown:o,lastRefreshTime:x,resetCountdown:g}},T=({countdown:e,lastRefreshTime:l})=>(0,m.jsx)(o.Box,{children:(0,m.jsxs)(o.Text,{color:"gray",children:["Next refresh in ",(0,m.jsxs)(o.Text,{color:"cyan",children:[e,"s"]}),l&&(0,m.jsxs)(o.Text,{color:"gray",children:[" (last: ",l?new Date(l).toLocaleTimeString():null,")"]})]})}),f=({workspace:e,view:l})=>(0,m.jsxs)(o.Box,{flexDirection:"column",marginBottom:1,children:[(0,m.jsxs)(o.Box,{children:[(0,m.jsx)(o.Text,{bold:!0,color:"cyan",children:"BRICKS CLI"}),(0,m.jsx)(o.Text,{color:"gray",children:" - Interactive Mode"})]}),(0,m.jsxs)(o.Box,{children:[(0,m.jsx)(o.Text,{color:"gray",children:"Workspace: "}),(0,m.jsx)(o.Text,{color:"green",children:e?.name||"Not connected"}),(0,m.jsx)(o.Text,{color:"gray",children:" | View: "}),(0,m.jsx)(o.Text,{color:"yellow",children:l})]}),(0,m.jsx)(o.Text,{color:"gray",children:"─".repeat(60)})]}),p=()=>(0,m.jsxs)(o.Box,{marginTop:1,flexDirection:"column",children:[(0,m.jsx)(o.Text,{color:"gray",children:"─".repeat(60)}),(0,m.jsxs)(o.Text,{color:"gray",children:["Press ",(0,m.jsx)(o.Text,{color:"cyan",children:"q"})," to quit, ",(0,m.jsx)(o.Text,{color:"cyan",children:"Esc"})," to go back"]})]}),v=({text:e})=>(0,m.jsxs)(o.Box,{children:[(0,m.jsx)(o.Text,{color:"green",children:(0,m.jsx)(g.A,{type:"dots"})}),(0,m.jsxs)(o.Text,{children:[" ",e||"Loading..."]})]}),_=({lastAliveTime:e})=>{if(!e)return(0,m.jsx)(o.Text,{color:"gray",children:"○ Unknown"});var l=Date.now()-new Date(e).getTime();if(l<=h)return(0,m.jsx)(o.Text,{color:"green",children:"● Online"});var r=Math.floor(l/6e4);if(r<60)return(0,m.jsxs)(o.Text,{color:"yellow",children:["○ Offline (",r,"m ago)"]});var t=Math.floor(r/60);if(t<24)return(0,m.jsxs)(o.Text,{color:"red",children:["○ Offline (",t,"h ago)"]});var n=Math.floor(t/24);return(0,m.jsxs)(o.Text,{color:"red",children:["○ Offline (",n,"d ago)"]})},y=r(25291),b=({onSelect:e,mediaEnabled:l,activityLogEnabled:r})=>{var t=[{label:"Devices",value:x.DEVICES},{label:"Applications",value:x.APPS},{label:"Modules",value:x.MODULES},{label:"Device Groups",value:x.GROUPS},...l?[{label:"Media Flow",value:x.MEDIA_BOXES}]:[],...r?[{label:"Activity Log",value:x.ACTIVITY_LOG}]:[],{label:"Exit",value:"exit"}];return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(o.Text,{bold:!0,marginBottom:1,children:"Main Menu"}),(0,m.jsx)(y.Ay,{items:t,onSelect:e})]})},D="1"===process.env.BRICKS_CLI_DISTRIBUTION,E=e=>{var l=(0,i.useState)(null),t=a(l,2),n=t[0],s=t[1];return(0,i.useEffect)(()=>{if(!D){var e=!0;return Promise.resolve().then(r.bind(r,29557)).then(l=>{e&&s(()=>l.default)}).catch(()=>{e&&s(!1)}),()=>{e=!1}}},[]),D||!1===n?(0,m.jsx)(o.Text,{color:"gray",children:"Image preview is not available in this CLI build."}):n?(0,m.jsx)(n,{...e}):(0,m.jsx)(v,{text:"Preparing image preview..."})},S=({devices:e,loading:l,onSelect:r,countdown:t,lastRefreshTime:n})=>{if(l)return(0,m.jsx)(v,{text:"Loading devices..."});if(!e?.length)return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(o.Text,{color:"yellow",children:"No devices found"}),(0,m.jsx)(T,{countdown:t,lastRefreshTime:n})]});var i=[...e.map(e=>({label:`${(e=>{if(!e)return"○ Unknown";var l=Date.now()-new Date(e).getTime();if(l<=h)return"● Online";var r=Math.floor(l/6e4);if(r<60)return`○ ${r}m ago`;var t=Math.floor(r/60);return t<24?`○ ${t}h ago`:`○ ${Math.floor(t/24)}d ago`})(e.entry_detail?.watch_dog_timer?.last_alive_time)} - ${e.name||e.device_name}`,value:e._id,device:e})),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Box,{marginBottom:1,children:[(0,m.jsxs)(o.Text,{bold:!0,children:["Devices (",e.length,")"]}),(0,m.jsx)(o.Text,{color:"gray",children:" - "}),(0,m.jsx)(T,{countdown:t,lastRefreshTime:n})]}),(0,m.jsx)(y.Ay,{items:i,onSelect:r})]})},I=({device:e,loading:l,error:r,onSelect:t,mediaEnabled:n,countdown:i,lastRefreshTime:a})=>{if(l)return(0,m.jsx)(v,{text:"Loading device..."});if(r)return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Text,{color:"red",children:["Error: ",r]}),(0,m.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:t})]});if(!e)return(0,m.jsx)(o.Text,{color:"red",children:"Device not found"});var s=[{label:"Control Device",value:"control"},...n?[{label:"View Screenshot",value:"screenshot"}]:[],{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],c=e.entry_detail,d=c?.screen,x=c?.update,u=c?.local_sync;return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Box,{children:[(0,m.jsx)(o.Text,{bold:!0,color:"cyan",children:e.name||e.device_name}),(0,m.jsx)(o.Text,{color:"gray",children:" - "}),(0,m.jsx)(T,{countdown:i,lastRefreshTime:a})]}),e.description&&(0,m.jsx)(o.Text,{color:"gray",children:e.description}),(0,m.jsxs)(o.Box,{marginY:1,flexDirection:"column",children:[(0,m.jsxs)(o.Box,{children:[(0,m.jsx)(o.Text,{color:"gray",children:"Status: "}),(0,m.jsx)(_,{lastAliveTime:c?.watch_dog_timer?.last_alive_time})]}),(0,m.jsxs)(o.Text,{color:"gray",children:["ID: ",e._id]}),e.tags?.length>0&&(0,m.jsxs)(o.Text,{color:"gray",children:["Tags: ",e.tags.join(", ")]}),c?.application&&(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Application"}),(0,m.jsxs)(o.Text,{color:"gray",children:[" Name: ",c.application.name]}),(0,m.jsxs)(o.Text,{color:"gray",children:[" Mode: ",c.operation_mode||"N/A"]})]}),d&&(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Screen"}),d.resolution&&(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Resolution: ",d.resolution.width,"x",d.resolution.height,d.resolution.scale&&` @${d.resolution.scale}x`]}),d.orientation&&(0,m.jsxs)(o.Text,{color:"gray",children:[" Orientation: ",d.orientation]}),d.touch&&(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Touch:"," ",d.touch.available?`Yes (${d.touch.touch_point} points)`:"No"]})]}),(c?.memory_usage||c?.disk_usage)&&(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"System"}),c.memory_usage&&(0,m.jsxs)(o.Text,{color:"gray",children:[" Memory: ",Math.round(100*c.memory_usage),"%"]}),c.disk_usage&&(0,m.jsxs)(o.Text,{color:"gray",children:[" Disk: ",Math.round(100*c.disk_usage),"%"]})]}),(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Capabilities"}),(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Sound: ",c?.sound?.available?"✓":"✗"," | ","Camera: ",c?.camera?.available?"✓":"✗"," | ","Audio In: ",c?.audio_in?.available?"✓":"✗"]})]}),u&&(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Local Sync"}),(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Role: ",u.is_main?"Main":"Peer",u.peer_count>0&&` | Peers: ${u.peer_count}`,u.mean_latency&&` | Latency: ${u.mean_latency}ms`]})]}),x&&(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Update"}),(0,m.jsxs)(o.Text,{color:x.need_update?"yellow":"gray",children:[" ","Status: ",x.need_update?"⚠ Update available":"✓ Up to date"]}),x.current_version&&(0,m.jsxs)(o.Text,{color:"gray",children:[" Version: ",x.current_version]})]})]}),(0,m.jsx)(y.Ay,{items:s,onSelect:t})]})},A=({device:e,onSelect:l,controlling:r,controlResult:t})=>(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Text,{bold:!0,color:"cyan",children:["Control: ",e?.name||e?.device_name]}),r&&(0,m.jsx)(v,{text:"Sending command..."}),t&&(0,m.jsx)(o.Text,{color:t.success?"green":"red",children:t.message}),(0,m.jsx)(o.Box,{marginTop:1,children:(0,m.jsx)(y.Ay,{items:u,onSelect:l})})]}),B=({device:e,screenshot:l,loading:r,error:t,onSelect:n})=>{var i=l?.file?.meta,a=null!=i?.originalWidth&&null!=i?.originalHeight,s=null!=i?.originalFileSize;return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Text,{bold:!0,color:"cyan",children:["Screenshot: ",e?.name||e?.device_name||"Unknown"]}),r&&(0,m.jsx)(v,{text:"Loading screenshot..."}),t&&(0,m.jsx)(o.Box,{marginY:1,children:(0,m.jsx)(o.Text,{color:"red",children:String(t)})}),!r&&!t&&l&&(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(o.Box,{height:30,children:(0,m.jsx)(E,{src:l.path,width:80,alt:"Device screenshot"})}),(0,m.jsxs)(o.Box,{marginY:1,flexDirection:"column",children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Screenshot Details"}),(0,m.jsxs)(o.Box,{marginY:1,children:[(0,m.jsx)(o.Text,{color:"green",children:"Screenshot saved to: "}),(0,m.jsx)(o.Text,{color:"cyan",children:String(l.path||"")})]}),a&&(0,m.jsxs)(o.Text,{color:"gray",children:["Size: ",String(i.originalWidth),"x",String(i.originalHeight)]}),s&&(0,m.jsxs)(o.Text,{color:"gray",children:["File: ",(Number(i.originalFileSize)/1024).toFixed(1)," KB"]}),l.file?.updatedAt&&(0,m.jsxs)(o.Text,{color:"gray",children:["Updated: ",new Date(l.file.updatedAt).toLocaleString()]})]})]}),!r&&!t&&!l&&(0,m.jsx)(o.Box,{marginY:1,children:(0,m.jsx)(o.Text,{color:"yellow",children:"No screenshot available. Try taking a new one."})}),(0,m.jsx)(o.Box,{marginTop:1,children:(0,m.jsx)(y.Ay,{items:[{label:"Take New Screenshot",value:"take"},{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],onSelect:n})})]})},C=({apps:e,loading:l,onSelect:r})=>{if(l)return(0,m.jsx)(v,{text:"Loading applications..."});if(!e?.length)return(0,m.jsx)(o.Text,{color:"yellow",children:"No applications found"});var t=[...e.map(e=>({label:`${e.has_unreleased_changes?"●":"○"} ${e.name}`,value:e._id,app:e})),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Text,{bold:!0,marginBottom:1,children:["Applications (",e.length,")"]}),(0,m.jsx)(y.Ay,{items:t,onSelect:r})]})},L=({app:e,loading:l,error:r,onSelect:t})=>{if(l)return(0,m.jsx)(v,{text:"Loading application..."});if(r)return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Text,{color:"red",children:["Error: ",r]}),(0,m.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:t})]});if(!e)return(0,m.jsx)(o.Text,{color:"red",children:"Application not found"});var n=[{label:"⚡ Initialize Project",value:"project_init"},...e.short_edit?.enabled&&e.short_edit.ref_map?[{label:"Short Edit",value:"short_edit"}]:[],{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],i=e.devices?.length||0,a=e.devices?.filter(e=>"online"===e.status)?.length||0;return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(o.Text,{bold:!0,color:"cyan",children:e.name}),e.description&&(0,m.jsx)(o.Text,{color:"gray",children:e.description}),(0,m.jsxs)(o.Box,{marginY:1,flexDirection:"column",children:[(0,m.jsxs)(o.Text,{color:"gray",children:["ID: ",e._id]}),e.tags?.length>0&&(0,m.jsxs)(o.Text,{color:"gray",children:["Tags: ",e.tags.join(", ")]}),(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Version"}),(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Current: ",e.current_version?`v${e.current_version}`:"N/A"]}),(0,m.jsxs)(o.Text,{color:e.has_unreleased_changes?"yellow":"gray",children:[" ","Changes:"," ",e.has_unreleased_changes?"● Unreleased changes":"○ No pending changes"]}),e.current_version_details&&(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Released: v",e.current_version_details.version||"N/A"]})]}),(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Devices"}),(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Total: ",i,i>0&&` (${a} online)`]})]}),(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Features"}),(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Short Edit: ",e.short_edit?.enabled?"✓ Enabled":"✗ Disabled"]}),(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Canvas Control: ",e.canvas_control?.enabled?"✓ Enabled":"✗ Disabled"]}),(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Device Control: ",e.device_control?.enabled?"✓ Enabled":"✗ Disabled"]}),(0,m.jsxs)(o.Text,{color:e.lock?.enabled?"yellow":"gray",children:[" ","Lock: ",e.lock?.enabled?"🔒 Locked":"🔓 Unlocked"]})]}),(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Timestamps"}),e.create_datetime&&(0,m.jsxs)(o.Text,{color:"gray",children:[" Created: ",new Date(e.create_datetime).toLocaleString()]}),e.last_modify_datetime&&(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Modified: ",new Date(e.last_modify_datetime).toLocaleString()]})]})]}),(0,m.jsx)(y.Ay,{items:n,onSelect:t})]})},k=({modules:e,loading:l,onSelect:r})=>{if(l)return(0,m.jsx)(v,{text:"Loading modules..."});var t=[...(e||[]).map(e=>({label:`${e.current_version?"●":"○"} ${e.name}`,value:e._id,module:e})),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Text,{bold:!0,marginBottom:1,children:["Modules (",e?.length||0,")"]}),!e?.length&&(0,m.jsx)(o.Text,{color:"yellow",children:"No modules found"}),(0,m.jsx)(y.Ay,{items:t,onSelect:r})]})},w=({module:e,loading:l,error:r,onSelect:t})=>{if(l)return(0,m.jsx)(v,{text:"Loading module..."});if(r)return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Text,{color:"red",children:["Error: ",r]}),(0,m.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:t})]});if(!e)return(0,m.jsx)(o.Text,{color:"red",children:"Module not found"});var n=[{label:"⚡ Initialize Project",value:"project_init"},...e.short_edit?.enabled&&e.short_edit.ref_map?[{label:"Short Edit",value:"short_edit"}]:[],{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(o.Text,{bold:!0,color:"cyan",children:e.name}),e.description&&(0,m.jsx)(o.Text,{color:"gray",children:e.description}),(0,m.jsxs)(o.Box,{marginY:1,flexDirection:"column",children:[(0,m.jsxs)(o.Text,{color:"gray",children:["ID: ",e._id]}),e.tags?.length>0&&(0,m.jsxs)(o.Text,{color:"gray",children:["Tags: ",e.tags.join(", ")]}),(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Version"}),(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Current: ",e.current_version?`v${e.current_version}`:"N/A"]}),(0,m.jsxs)(o.Text,{color:e.has_unreleased_changes?"yellow":"gray",children:[" ","Changes:"," ",e.has_unreleased_changes?"● Unreleased changes":"○ No pending changes"]})]}),(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Usage"}),(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Used in: ",e.use_count?.total_count||0," application(s)"]})]}),(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Settings"}),(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Public: ",e.is_public?"✓ Yes":"✗ No"]}),(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Modifiable: ",e.is_allow_modify?"✓ Yes":"✗ No"]}),(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Short Edit: ",e.short_edit?.enabled?"✓ Enabled":"✗ Disabled"]})]}),e.expose_properties?.length>0&&(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Exposed Properties"}),(0,m.jsxs)(o.Text,{color:"gray",children:[" ",e.expose_properties.length," properties exposed"]})]}),(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Timestamps"}),e.create_datetime&&(0,m.jsxs)(o.Text,{color:"gray",children:[" Created: ",new Date(e.create_datetime).toLocaleString()]}),e.last_modify_datetime&&(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Modified: ",new Date(e.last_modify_datetime).toLocaleString()]})]})]}),(0,m.jsx)(y.Ay,{items:n,onSelect:t})]})},P=({groups:e,loading:l,onSelect:r,countdown:t,lastRefreshTime:n})=>{if(l)return(0,m.jsx)(v,{text:"Loading device groups..."});var i=[...(e||[]).map(e=>({label:`📁 ${e.name} (${e.devices?.length||0} devices)`,value:e._id,group:e})),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Box,{marginBottom:1,children:[(0,m.jsxs)(o.Text,{bold:!0,children:["Device Groups (",e?.length||0,")"]}),(0,m.jsx)(o.Text,{color:"gray",children:" - "}),(0,m.jsx)(T,{countdown:t,lastRefreshTime:n})]}),!e?.length&&(0,m.jsx)(o.Text,{color:"yellow",children:"No device groups found"}),(0,m.jsx)(y.Ay,{items:i,onSelect:r})]})},O=({loading:e,groupDevices:l})=>e?(0,m.jsx)(v,{text:"Loading devices..."}):l?.length?(0,m.jsxs)(m.Fragment,{children:[l.slice(0,10).map(e=>(0,m.jsxs)(o.Box,{children:[(0,m.jsx)(o.Text,{color:"gray",children:" "}),(0,m.jsx)(_,{lastAliveTime:e.entry_detail?.watch_dog_timer?.last_alive_time}),(0,m.jsxs)(o.Text,{color:"gray",children:[" ",e.name||e.device_name]}),e.device_target_name&&(0,m.jsxs)(o.Text,{color:"gray",dimColor:!0,children:[" ","(",e.device_target_name,")"]})]},e._id)),l.length>10&&(0,m.jsxs)(o.Text,{color:"gray",dimColor:!0,children:[" ","... and ",l.length-10," more"]})]}):(0,m.jsx)(o.Text,{color:"gray",children:" No devices in this group"}),M=({group:e,groupDevices:l,loading:r,error:t,onSelect:n,countdown:i,lastRefreshTime:a})=>{if(r&&!e)return(0,m.jsx)(v,{text:"Loading device group..."});if(t)return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Text,{color:"red",children:["Error: ",t]}),(0,m.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:n})]});if(!e)return(0,m.jsx)(o.Text,{color:"red",children:"Device group not found"});return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Box,{children:[(0,m.jsx)(o.Text,{bold:!0,color:"cyan",children:e.name}),(0,m.jsx)(o.Text,{color:"gray",children:" - "}),(0,m.jsx)(T,{countdown:i,lastRefreshTime:a})]}),e.description&&(0,m.jsx)(o.Text,{color:"gray",children:e.description}),(0,m.jsxs)(o.Box,{marginY:1,flexDirection:"column",children:[(0,m.jsxs)(o.Text,{color:"gray",children:["ID: ",e._id]}),e.tags?.length>0&&(0,m.jsxs)(o.Text,{color:"gray",children:["Tags: ",e.tags.join(", ")]}),(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsxs)(o.Text,{bold:!0,color:"white",children:["Devices (",e.devices?.length||0,")"]}),(0,m.jsx)(O,{loading:r,groupDevices:l})]}),(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Timestamps"}),e.create_datetime&&(0,m.jsxs)(o.Text,{color:"gray",children:[" Created: ",new Date(e.create_datetime).toLocaleString()]}),e.last_modify_datetime&&(0,m.jsxs)(o.Text,{color:"gray",children:[" ","Modified: ",new Date(e.last_modify_datetime).toLocaleString()]})]})]}),(0,m.jsx)(y.Ay,{items:[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],onSelect:n})]})},R=({boxes:e,loading:l,onSelect:r})=>{if(l)return(0,m.jsx)(v,{text:"Loading media boxes..."});if(!e?.length)return(0,m.jsx)(o.Text,{color:"yellow",children:"No media boxes found"});var t=[...e.map(e=>({label:`📦 ${e.name||"Unnamed"}`,value:e.id,box:e})),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Text,{bold:!0,marginBottom:1,children:["Media Boxes (",e.length,")"]}),(0,m.jsx)(y.Ay,{items:t,onSelect:r})]})},N=({box:e,loading:l,error:r,onSelect:t})=>{if(l&&!e)return(0,m.jsx)(v,{text:"Loading media box..."});if(r)return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Text,{color:"red",children:["Error: ",r]}),(0,m.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:t})]});if(!e)return(0,m.jsx)(o.Text,{color:"red",children:"Media box not found"});return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(o.Text,{bold:!0,color:"cyan",children:e.name||"Unnamed"}),e.description&&(0,m.jsx)(o.Text,{color:"gray",children:e.description}),(0,m.jsxs)(o.Box,{marginY:1,flexDirection:"column",children:[(0,m.jsxs)(o.Text,{color:"gray",children:["ID: ",e.id]}),e.tags?.length>0&&(0,m.jsxs)(o.Text,{color:"gray",children:["Tags: ",e.tags.join(", ")]}),null!=e.size&&(0,m.jsxs)(o.Text,{color:"gray",children:["Size: ",e.size]}),e.passcodes?.length>0&&(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsxs)(o.Text,{bold:!0,color:"white",children:["Passcodes (",e.passcodes.length,")"]}),e.passcodes.slice(0,5).map(e=>(0,m.jsxs)(o.Text,{color:"gray",children:[" ",e.name||"Passcode",": ",e.code]},e.id)),e.passcodes.length>5&&(0,m.jsxs)(o.Text,{color:"gray",dimColor:!0,children:[" ","... and ",e.passcodes.length-5," more"]})]}),(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Timestamps"}),e.createdAt&&(0,m.jsxs)(o.Text,{color:"gray",children:[" Created: ",new Date(e.createdAt).toLocaleString()]}),e.updatedAt&&(0,m.jsxs)(o.Text,{color:"gray",children:[" Modified: ",new Date(e.updatedAt).toLocaleString()]})]})]}),(0,m.jsx)(y.Ay,{items:[{label:"List Files",value:"files"},{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],onSelect:t})]})},U=({files:e,loading:l,onSelect:r,box:t})=>{if(l)return(0,m.jsx)(v,{text:"Loading media files..."});if(!e?.length)return(0,m.jsx)(o.Text,{color:"yellow",children:"No media files found"});var n=[...e.map(e=>{return{label:`${l=e.fileType,"Image"===l?"🖼":"Video"===l?"🎞":"Audio"===l?"🎵":"📄"} ${e.name||"Unnamed"}`,value:e.id,file:e};var l}),{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}];return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Text,{bold:!0,marginBottom:1,children:["Media Files (",e.length,")",t?.name?` - ${t.name}`:""]}),(0,m.jsx)(y.Ay,{items:n,onSelect:r})]})},G=({file:e,loading:l,error:r,onSelect:t})=>{if(l&&!e)return(0,m.jsx)(v,{text:"Loading media file..."});if(r)return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Text,{color:"red",children:["Error: ",r]}),(0,m.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:t})]});if(!e)return(0,m.jsx)(o.Text,{color:"red",children:"Media file not found"});var n=e.meta,i=(0,d.Gu)(e),a=(0,d.Gu)(e,{preferThumbnail:!0}),s=Boolean(a&&a!==i);return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(o.Text,{bold:!0,color:"cyan",children:e.name||"Unnamed"}),e.description&&(0,m.jsx)(o.Text,{color:"gray",children:e.description}),(0,m.jsxs)(o.Box,{marginY:1,flexDirection:"column",children:[(0,m.jsxs)(o.Text,{color:"gray",children:["ID: ",e.id]}),(0,m.jsxs)(o.Text,{color:"gray",children:["Box ID: ",e.boxId]}),(0,m.jsxs)(o.Text,{color:"gray",children:["Type: ",e.fileType]}),e.userTags?.length>0&&(0,m.jsxs)(o.Text,{color:"gray",children:["Tags: ",e.userTags.join(", ")]}),null!=n?.originalWidth&&null!=n?.originalHeight&&(0,m.jsxs)(o.Text,{color:"gray",children:["Size: ",n.originalWidth,"x",n.originalHeight]}),null!=n?.originalFileSize&&(0,m.jsxs)(o.Text,{color:"gray",children:["File: ",(Number(n.originalFileSize)/1024).toFixed(1)," KB"]}),i&&(0,m.jsxs)(o.Text,{color:"gray",children:["Original URL: ",i]}),s&&(0,m.jsxs)(o.Text,{color:"gray",children:["Thumbnail URL: ",a]}),(0,m.jsxs)(o.Box,{flexDirection:"column",marginTop:1,children:[(0,m.jsx)(o.Text,{bold:!0,color:"white",children:"Timestamps"}),e.createdAt&&(0,m.jsxs)(o.Text,{color:"gray",children:[" Created: ",new Date(e.createdAt).toLocaleString()]}),e.updatedAt&&(0,m.jsxs)(o.Text,{color:"gray",children:[" Modified: ",new Date(e.updatedAt).toLocaleString()]})]})]}),(0,m.jsx)(y.Ay,{items:[{label:"↻ Refresh",value:"refresh"},{label:"← Back",value:"back"}],onSelect:t})]})},V=r(77146),F=(e,l)=>{if(!e)return"";var r="string"==typeof e?e:JSON.stringify(e);return r.length>l?r.slice(0,l-1)+"…":r},H=({onBack:e})=>{var l=(0,i.useState)([]),r=a(l,2),t=r[0],s=r[1],d=(0,i.useState)(!0),x=a(d,2),u=x[0],h=x[1],g=(0,i.useState)(null),j=a(g,2),T=j[0],f=j[1];(0,i.useEffect)(()=>{var e=(0,c.getCurrentProfile)(),l=(0,c.getToken)(e),r=(0,c.getActivityLogBaseUrl)();if(!l)return f("Not logged in. Run `bricks auth login` first."),void h(!1);if(!r)return f("Activity log URL not configured."),void h(!1);var t,i=(0,V.W)(r,l),o=new Date(Date.now()-36e5).toISOString(),a=(new Date).toISOString(),d=new AbortController;return(t=n(function*(){try{var e=yield i.collectEvents({start_time:o,end_time:a},{limit:50,signal:d.signal});s(e)}catch(e){"AbortError"!==e.name&&f(e.message)}h(!1)}),function(){return t.apply(this,arguments)})(),()=>d.abort()},[]);return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(o.Text,{bold:!0,marginBottom:1,children:"Activity Log (last 1h)"}),u&&(0,m.jsx)(v,{text:"Fetching events..."}),T&&(0,m.jsxs)(o.Text,{color:"red",children:["Error: ",T]}),!u&&!T&&0===t.length&&(0,m.jsx)(o.Text,{color:"yellow",children:"No events found in the last hour"}),!u&&t.length>0&&(0,m.jsxs)(o.Box,{flexDirection:"column",marginBottom:1,children:[(0,m.jsxs)(o.Text,{color:"gray",children:["Timestamp".padEnd(22)," ","Type".padEnd(12)," ","Device".padEnd(14)," ","Event Name".padEnd(24)," Sender"]}),t.map((e,l)=>{return(0,m.jsxs)(o.Text,{children:[(r=e.timestamp,new Date(r).toISOString().replace("T"," ").replace(/\.\d+Z$/,"Z")).padEnd(22)," ",F(e.event_type||"",12).padEnd(12)," ",F(e.device_id||"",14).padEnd(14)," ",F(e.event_name||"",24).padEnd(24)," ",F(e.sender||"",16)]},l);var r}),t.length>=50&&(0,m.jsxs)(o.Text,{color:"yellow",children:["Showing first ",50," events"]})]}),(0,m.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:l=>"back"===l.value&&e()})]})},$=r(29253),Y=r(35704),z=["B","C","G","D"],X=({instanceType:e,instance:l,client:r,onDone:t,onCancel:s})=>{var c=(0,o.useApp)().exit,d=(0,i.useState)("select_ref"),x=a(d,2),u=x[0],h=x[1],g=(0,i.useState)(""),j=a(g,2),T=j[0],f=j[1],p=(0,i.useState)("search"),_=a(p,2),b=_[0],D=_[1],E=(0,i.useState)(null),S=a(E,2),I=S[0],A=S[1],B=(0,i.useState)(null),C=a(B,2),L=C[0],k=C[1],w=(0,i.useState)(""),P=a(w,2),O=P[0],M=P[1],R=(0,i.useState)(""),N=a(R,2),U=N[0],G=N[1],V=(0,i.useState)(null),F=a(V,2),H=F[0],X=F[1],J=l?.short_edit?.ref_map||{},W=Object.entries(J).filter(([,e])=>e&&!e.hide),q=(0,Y.V)(J,{keyword:T,types:z}),K=q.flatMap(e=>[{label:e.label,value:`__header_${e.prefix}__`,isHeader:!0},...e.refs.map(({shortId:e,ref:l})=>({label:`${l.title||e} (${e})`,value:e,ref:l}))]),Z=[...T?[{label:"↻ Clear Search",value:"__clear_search__"}]:[],{label:"← Back",value:"__back__"}],Q=K.length>0?[...K,...Z]:Z,ee=Q.findIndex(e=>!e.isHeader&&!e.value?.startsWith("__"));(0,o.useInput)((e,l)=>{l.tab&&"select_ref"===u?D(e=>"search"===e?"list":"search"):(l.escape&&("select_ref"===u&&s(),"input_path"===u&&h("select_ref"),"input_content"===u&&h("input_path"),"confirm"===u&&h("input_content"),"done"===u&&s()),"q"!==e||("input_path"===u||"input_content"===u)||"select_ref"===u&&"search"===b||c())},{isActive:!0});var le,re=e=>{var l=e.trim();if(""===l)return null;try{return JSON.parse(l)}catch{return l}},te=(le=n(function*(){if(r&&l?._id&&I){h("submitting"),X(null);try{var n={shortId:I,path:O.trim(),content:re(U),forwardDataLink:!0};L?.inner_ref?.pid&&(n.innerRefParentShortId=L.inner_ref.pid),"application"===e?yield r.shortEditApplication({id:l._id,list:[n]}):yield r.shortEditModule({id:l._id,list:[n]}),yield t(),h("done")}catch(e){X(e.message),h("confirm")}}}),function(){return le.apply(this,arguments)});return l?.short_edit?.enabled?0===W.length?(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(o.Text,{color:"yellow",children:"No Short Edit references found."}),(0,m.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:s})]}):"select_ref"===u?(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(o.Text,{bold:!0,children:"Short Edit References"}),(0,m.jsx)(o.Text,{color:"gray",dimColor:!0,children:"Showing: Brick, Canvas, Generator, Data"}),(0,m.jsxs)(o.Box,{marginTop:1,flexDirection:"column",children:[(0,m.jsx)(o.Text,{color:"gray",children:"Search (title or shortId)"}),(0,m.jsx)($.A,{value:T,placeholder:"type to filter, Enter to focus list",onChange:e=>f(e),onSubmit:()=>D("list"),focus:"search"===b}),(0,m.jsx)(o.Text,{color:"gray",dimColor:!0,children:"Press Tab to switch focus"})]}),(0,m.jsxs)(o.Box,{marginTop:1,children:[0===q.length&&(0,m.jsx)(o.Text,{color:"yellow",children:"No references match your search."}),(0,m.jsx)(y.Ay,{items:Q,isFocused:"list"===b,initialIndex:ee>-1?ee:0,indicatorComponent:()=>null,itemComponent:({label:e,isSelected:l,isHeader:r})=>r?(0,m.jsx)(o.Box,{marginTop:1,children:(0,m.jsx)(o.Text,{bold:!0,color:"white",children:e})}):(0,m.jsxs)(o.Text,{color:l?"blue":void 0,children:[l?"❯":" "," ",e]}),onSelect:e=>{if("__back__"!==e.value)return"__clear_search__"===e.value?(f(""),void D("search")):void(e.isHeader||(A(e.value),k(e.ref),h("input_path")));s()}})]})]}):"input_path"===u?(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Text,{children:["Reference:"," ",(0,m.jsxs)(o.Text,{color:"cyan",children:[L?.title||I," (",I,")"]})]}),(0,m.jsx)(o.Text,{marginTop:1,children:"Enter property path (e.g. title, property.backgroundColor)"}),H&&(0,m.jsxs)(o.Text,{color:"red",children:["Error: ",H]}),(0,m.jsx)($.A,{value:O,placeholder:"path",onChange:e=>{M(e),H&&X(null)},onSubmit:e=>{var l=e.trim();l?(M(l),h("input_content")):X("Path is required")},focus:!0})]}):"input_content"===u?(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Text,{children:["Path: ",(0,m.jsx)(o.Text,{color:"cyan",children:O})]}),(0,m.jsx)(o.Text,{marginTop:1,children:"Enter new content (JSON or plain text). Empty to clear."}),H&&(0,m.jsxs)(o.Text,{color:"red",children:["Error: ",H]}),(0,m.jsx)($.A,{value:U,placeholder:"content",onChange:e=>{G(e),H&&X(null)},onSubmit:()=>h("confirm"),focus:!0})]}):"submitting"===u?(0,m.jsx)(v,{text:"Applying short edit..."}):"done"===u?(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(o.Text,{color:"green",children:"Short edit applied successfully."}),(0,m.jsx)(y.Ay,{items:[{label:"Edit another property",value:"again"},{label:"← Back",value:"back"}],onSelect:e=>{"again"===e.value?(h("select_ref"),A(null),k(null),M(""),G(""),X(null)):s()}})]}):(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(o.Text,{bold:!0,marginBottom:1,children:"Confirm Short Edit"}),(0,m.jsxs)(o.Text,{children:["Reference:"," ",(0,m.jsxs)(o.Text,{color:"cyan",children:[L?.title||I," (",I,")"]})]}),(0,m.jsxs)(o.Text,{children:["Path: ",(0,m.jsx)(o.Text,{color:"cyan",children:O})]}),(0,m.jsxs)(o.Text,{children:["Content: ",(0,m.jsx)(o.Text,{color:"cyan",children:U||"<empty>"})]}),H&&(0,m.jsxs)(o.Text,{color:"red",children:["Error: ",H]}),(0,m.jsx)(y.Ay,{items:[{label:"Apply",value:"apply"},{label:"Edit Path",value:"edit_path"},{label:"Edit Content",value:"edit_content"},{label:"← Back",value:"back"}],onSelect:e=>{"apply"===e.value&&te(),"edit_path"===e.value&&h("input_path"),"edit_content"===e.value&&h("input_content"),"back"===e.value&&s()}})]}):(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Text,{color:"yellow",children:["Short Edit is not enabled for this ",e,"."]}),(0,m.jsx)(y.Ay,{items:[{label:"← Back",value:"back"}],onSelect:s})]})},J=r(16928),W=r(79896),q=r(35317),K=r(10750),Z="options",Q="output_dir",ee="confirm",le="generating",re="post_install",te="done",ne=e=>{try{return(0,q.execSync)(`which ${e}`,{stdio:"ignore"}),!0}catch{return!1}},ie=(e,l,r)=>new Promise((t,n)=>{var i=[e,...l].join(" "),o=(0,q.spawn)(i,[],{cwd:r,stdio:"pipe",shell:!0});o.on("close",e=>{0===e?t():n(new Error(`Command failed with code ${e}`))}),o.on("error",n)}),oe=(t=n(function*(e,l){try{var t=(yield Promise.resolve().then(r.bind(r,79491))).format;return(yield t(l,e,{trailingComma:"all",tabWidth:2,semi:!1,singleQuote:!0,printWidth:100})).code}catch{}return e}),function(e,l){return t.apply(this,arguments)}),ae=({type:e,instance:l,client:r,onDone:t,onCancel:s})=>{var c,d=(0,o.useApp)().exit,x=(0,i.useState)(Z),u=a(x,2),h=u[0],j=u[1],T=(0,i.useState)({setupGitHubActions:!0,setupAgents:!0,setupClaudeCode:!0,setupGeminiCLI:!1,runBunInstall:!0,initGit:!0}),f=a(T,2),p=f[0],v=f[1],_=(0,i.useState)(process.cwd()),b=a(_,2),D=b[0],E=b[1],S=(0,i.useState)(""),I=a(S,2),A=I[0],B=I[1],C=(0,i.useState)(null),L=a(C,2),k=L[0],w=L[1],P=(0,i.useState)(null),O=a(P,2),M=O[0],R=O[1],N=K(l?.name||"bricks-ctor"),U=J.resolve(D,N),G=(0,i.useCallback)(e=>{"back"!==e.value?"continue"!==e.value?v(l=>({...l,[e.value]:!l[e.value]})):j(Q):s()},[s]),V=(0,i.useCallback)(()=>{W.existsSync(U)?w(`Directory already exists: ${U}`):(w(null),j(ee))},[U]),F=(0,i.useCallback)((c=n(function*(t){var i;if("back"!==t.value)if("cancel"!==t.value){if("confirm"===t.value){j(le);try{B("Fetching project from BRICKS...");var o="application"===e,a=o?"UNSTABLE_applicationProject":"UNSTABLE_moduleProject",c=o?r.queries.applicationProject:r.queries.moduleProject,d=(yield r.query(c,{id:l._id,buildApplicationOnly:!1,setupGitHubActions:p.setupGitHubActions,setupAgents:p.setupAgents,setupClaudeCode:p.setupClaudeCode,setupGeminiCLI:p.setupGeminiCLI}))[a];if(!d?.files)throw new Error("Failed to fetch project files");B("Creating project directory..."),W.mkdirSync(U,{recursive:!0}),B(`Writing ${d.files.length} files...`);var x=yield Promise.all(d.files.map((i=n(function*(e){var l=J.join(U,e.name),r=e.input;return e.formatable&&(r=yield oe(r,l)),{...e,filePath:l,content:r}}),function(e){return i.apply(this,arguments)})));x.forEach(e=>{var l=J.dirname(e.filePath);W.existsSync(l)||W.mkdirSync(l,{recursive:!0}),W.writeFileSync(e.filePath,e.content)}),j(re);var u={path:U,files:d.files.length,bunInstalled:!1,gitInitialized:!1};if(p.runBunInstall&&ne("bun")){B("Installing dependencies (bun install)...");try{yield ie("bun",["install"],U),u.bunInstalled=!0}catch{}}if(p.initGit&&ne("git")){B("Initializing git repository...");try{yield ie("git",["init"],U),yield ie("git",["add","."],U),yield ie("git",["-c 'user.name=BRICKS CLI'","-c 'user.email=cli@bricks.tools'","commit","-m 'chore: initialize commit'"],U),u.gitInitialized=!0}catch{}}R(u),j(te)}catch(e){w(e.message),j(Z)}}}else s();else j(Q)}),function(e){return c.apply(this,arguments)}),[r,l,e,p,U,s]),H=(0,i.useCallback)(e=>{"exit"===e.value?d():t()},[d,t]);if(h===Z){var Y=[{label:(p.setupGitHubActions?"[x]":"[ ]")+" GitHub Actions workflow",value:"setupGitHubActions"},{label:(p.setupAgents?"[x]":"[ ]")+" AGENTS.md",value:"setupAgents"},{label:(p.setupClaudeCode?"[x]":"[ ]")+" CLAUDE.md",value:"setupClaudeCode"},{label:(p.setupGeminiCLI?"[x]":"[ ]")+" GEMINI.md",value:"setupGeminiCLI"},{label:(p.runBunInstall?"[x]":"[ ]")+" Run bun install after generation",value:"runBunInstall"},{label:(p.initGit?"[x]":"[ ]")+" Initialize git repository",value:"initGit"},{label:"→ Continue",value:"continue"},{label:"← Back",value:"back"}];return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsxs)(o.Text,{bold:!0,color:"cyan",children:["Initialize BRICKS Project: ",l?.name||"Untitled"]}),(0,m.jsx)(o.Text,{color:"gray",marginBottom:1,children:"Select options for project generation (press Enter to toggle)"}),k&&(0,m.jsxs)(o.Text,{color:"red",marginBottom:1,children:["Error: ",k]}),(0,m.jsx)(y.Ay,{items:Y,onSelect:G})]})}if(h===Q)return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(o.Text,{bold:!0,color:"cyan",children:"Output Directory"}),(0,m.jsx)(o.Text,{color:"gray",marginBottom:1,children:"Enter the parent directory for the project:"}),k&&(0,m.jsx)(o.Text,{color:"red",marginBottom:1,children:k}),(0,m.jsxs)(o.Box,{children:[(0,m.jsx)(o.Text,{children:"Directory: "}),(0,m.jsx)($.A,{value:D,onChange:E,onSubmit:V})]}),(0,m.jsxs)(o.Text,{color:"gray",marginTop:1,children:["Project will be created at: ",U]})]});if(h===ee){return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(o.Text,{bold:!0,color:"cyan",children:"Confirm Project Generation"}),(0,m.jsxs)(o.Box,{marginY:1,flexDirection:"column",children:[(0,m.jsxs)(o.Text,{children:["Name: ",(0,m.jsx)(o.Text,{color:"green",children:l?.name||"Untitled"})]}),(0,m.jsxs)(o.Text,{children:["Type: ",(0,m.jsx)(o.Text,{color:"yellow",children:e})]}),(0,m.jsxs)(o.Text,{children:["Path: ",(0,m.jsx)(o.Text,{color:"cyan",children:U})]}),(0,m.jsx)(o.Text,{color:"gray",marginTop:1,children:"Options:"}),(0,m.jsxs)(o.Text,{color:"gray",children:[" - GitHub Actions: ",p.setupGitHubActions?"Yes":"No"]}),(0,m.jsxs)(o.Text,{color:"gray",children:[" - AGENTS.md: ",p.setupAgents?"Yes":"No"]}),(0,m.jsxs)(o.Text,{color:"gray",children:[" - CLAUDE.md: ",p.setupClaudeCode?"Yes":"No"]}),(0,m.jsxs)(o.Text,{color:"gray",children:[" - GEMINI.md: ",p.setupGeminiCLI?"Yes":"No"]}),(0,m.jsxs)(o.Text,{color:"gray",children:[" - Run bun install: ",p.runBunInstall?"Yes":"No"]}),(0,m.jsxs)(o.Text,{color:"gray",children:[" - Initialize git: ",p.initGit?"Yes":"No"]})]}),(0,m.jsx)(y.Ay,{items:[{label:"Confirm & Generate",value:"confirm"},{label:"← Change Directory",value:"back"},{label:"Cancel",value:"cancel"}],onSelect:F})]})}if(h===le||h===re)return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(o.Text,{bold:!0,color:"cyan",children:"Generating Project..."}),(0,m.jsxs)(o.Box,{marginY:1,children:[(0,m.jsx)(o.Text,{color:"green",children:(0,m.jsx)(g.A,{type:"dots"})}),(0,m.jsxs)(o.Text,{children:[" ",A]})]})]});if(h===te&&M){return(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(o.Text,{bold:!0,color:"green",children:"Project initialized successfully!"}),(0,m.jsxs)(o.Box,{marginY:1,flexDirection:"column",children:[(0,m.jsxs)(o.Text,{children:["Path: ",(0,m.jsx)(o.Text,{color:"cyan",children:M.path})]}),(0,m.jsxs)(o.Text,{children:["Files: ",(0,m.jsx)(o.Text,{color:"green",children:M.files})]}),(0,m.jsxs)(o.Text,{children:["Dependencies:"," ",(0,m.jsx)(o.Text,{color:M.bunInstalled?"green":"yellow",children:M.bunInstalled?"Installed":"Not installed (run bun install manually)"})]}),(0,m.jsxs)(o.Text,{children:["Git:"," ",(0,m.jsx)(o.Text,{color:M.gitInitialized?"green":"yellow",children:M.gitInitialized?"Initialized":"Not initialized"})]})]}),(0,m.jsx)(o.Text,{bold:!0,marginY:1,children:"Next steps:"}),(0,m.jsxs)(o.Text,{color:"gray",children:[" cd ",N]}),!M.bunInstalled&&(0,m.jsx)(o.Text,{color:"gray",children:" bun install"}),(0,m.jsx)(o.Text,{color:"gray",children:" bun preview"}),(0,m.jsxs)(o.Text,{color:"gray",marginTop:1,children:["For more information, see ",N,"/README.md"]}),(0,m.jsx)(o.Box,{marginTop:1,children:(0,m.jsx)(y.Ay,{items:[{label:"← Back to Detail",value:"back"},{label:"Exit CLI",value:"exit"}],onSelect:H})})]})}return null};const se=()=>{var e=(0,o.useApp)().exit,l=(0,i.useState)(x.MAIN),r=a(l,2),t=r[0],u=r[1],h=(0,i.useState)(null),g=a(h,2),T=g[0],_=g[1],y=(0,i.useState)(null),D=a(y,2),E=D[0],O=D[1],V=(0,i.useState)(!0),F=a(V,2),$=F[0],Y=F[1],z=(0,i.useState)(null),J=a(z,2),W=J[0],q=J[1],K=(0,i.useState)([]),Z=a(K,2),Q=Z[0],ee=Z[1],le=(0,i.useState)(null),re=a(le,2),te=re[0],ne=re[1],ie=(0,i.useState)([]),oe=a(ie,2),se=oe[0],ce=oe[1],de=(0,i.useState)(null),xe=a(de,2),ue=xe[0],he=xe[1],ge=(0,i.useState)([]),me=a(ge,2),je=me[0],Te=me[1],fe=(0,i.useState)(null),pe=a(fe,2),ve=pe[0],_e=pe[1],ye=(0,i.useState)([]),be=a(ye,2),De=be[0],Ee=be[1],Se=(0,i.useState)(null),Ie=a(Se,2),Ae=Ie[0],Be=Ie[1],Ce=(0,i.useState)([]),Le=a(Ce,2),ke=Le[0],we=Le[1],Pe=(0,i.useState)(!1),Oe=a(Pe,2),Me=Oe[0],Re=Oe[1],Ne=(0,i.useState)(null),Ue=a(Ne,2),Ge=Ue[0],Ve=Ue[1],Fe=(0,i.useState)(null),He=a(Fe,2),$e=He[0],Ye=He[1],ze=(0,i.useState)(null),Xe=a(ze,2),Je=Xe[0],We=Xe[1],qe=(0,i.useState)(null),Ke=a(qe,2),Ze=Ke[0],Qe=Ke[1],el=(0,i.useState)([]),ll=a(el,2),rl=ll[0],tl=ll[1],nl=(0,i.useState)(null),il=a(nl,2),ol=il[0],al=il[1],sl=(0,i.useState)([]),cl=a(sl,2),dl=cl[0],xl=cl[1],ul=(0,i.useState)(null),hl=a(ul,2),gl=hl[0],ml=hl[1],jl=t===x.DEVICES,Tl=t===x.DEVICE_DETAIL,fl=t===x.GROUPS,pl=t===x.GROUP_DETAIL;(0,i.useEffect)(()=>{var e=(0,c.getCurrentProfile)(),l=(0,c.getToken)(e);if(!l)return q("Not logged in. Run `bricks auth login` first."),void Y(!1);var r=(0,s.createClient)((0,c.getBaseUrl)(),l);_(r),r.workspace().then(e=>{O(e),Y(!1)}).catch(e=>{q(e.message),Y(!1)})},[]),(0,o.useInput)((l,r)=>{"q"===l&&e(),r.escape&&(t===x.DEVICE_CONTROL?(u(x.DEVICE_DETAIL),Ve(null)):t===x.DEVICE_SCREENSHOT?(u(x.DEVICE_DETAIL),We(null),Qe(null)):t===x.DEVICE_DETAIL?(u(x.DEVICES),ne(null)):t===x.APP_DETAIL?(u(x.APPS),he(null)):t===x.MODULE_DETAIL?(u(x.MODULES),_e(null)):t===x.GROUP_DETAIL?(u(x.GROUPS),Be(null),we([])):t===x.MEDIA_FILE_DETAIL?(u(x.MEDIA_FILES),ml(null)):t===x.MEDIA_FILES?(u(x.MEDIA_BOX_DETAIL),ml(null)):t===x.MEDIA_BOX_DETAIL?(u(x.MEDIA_BOXES),al(null),xl([])):(t===x.MEDIA_BOXES||t!==x.MAIN)&&u(x.MAIN))},{isActive:t!==x.APP_SHORT_EDIT&&t!==x.MODULE_SHORT_EDIT&&t!==x.APP_PROJECT_INIT&&t!==x.MODULE_PROJECT_INIT});var vl,_l,yl,bl,Dl,El,Sl,Il,Al=(0,i.useCallback)(n(function*(){if(T){Y(!0);try{var e=yield T.devices({});ee(e||[])}catch(e){q(e.message)}Y(!1)}}),[T]),Bl=(0,i.useCallback)((vl=n(function*(e){if(T){Y(!0),Ye(null);try{var l=yield T.device({id:e});ne(l)}catch(e){Ye(e.message)}Y(!1)}}),function(e){return vl.apply(this,arguments)}),[T]),Cl=(0,i.useCallback)(n(function*(){if(T){Y(!0);try{var e=yield T.applications({});ce(e||[])}catch(e){q(e.message)}Y(!1)}}),[T]),Ll=(0,i.useCallback)((_l=n(function*(e){if(T){Y(!0),Ye(null);try{var l=yield T.application({id:e});he(l)}catch(e){Ye(e.message)}Y(!1)}}),function(e){return _l.apply(this,arguments)}),[T]),kl=(0,i.useCallback)(n(function*(){if(T){Y(!0);try{var e=yield T.modules({});Te(e||[])}catch(e){q(e.message)}Y(!1)}}),[T]),wl=(0,i.useCallback)((yl=n(function*(e){if(T){Y(!0),Ye(null);try{var l=yield T.module({id:e});_e(l)}catch(e){Ye(e.message)}Y(!1)}}),function(e){return yl.apply(this,arguments)}),[T]),Pl=(0,i.useCallback)(n(function*(){if(T){Y(!0);try{var e=yield T.deviceGroups({});Ee(e||[])}catch(e){q(e.message)}Y(!1)}}),[T]),Ol=(0,i.useCallback)((bl=n(function*(e){if(T){Y(!0),Ye(null);try{var l=yield Promise.all([T.deviceGroup({id:e}),T.devicesByGroup({id:e})]),r=a(l,2),t=r[0],n=r[1];Be(t),we(n||[])}catch(e){Ye(e.message)}Y(!1)}}),function(e){return bl.apply(this,arguments)}),[T]),Ml=(0,i.useCallback)(n(function*(){if(T){Y(!0);try{var e=yield T.mediaBoxes();tl(e||[])}catch(e){q(e.message)}Y(!1)}}),[T]),Rl=(0,i.useCallback)((Dl=n(function*(e){if(T){Y(!0),Ye(null);try{var l=yield T.mediaBox({id:e});al(l)}catch(e){Ye(e.message)}Y(!1)}}),function(e){return Dl.apply(this,arguments)}),[T]),Nl=(0,i.useCallback)((El=n(function*(e){if(T){Y(!0);try{var l=yield T.mediaFiles({boxId:e});xl(l||[])}catch(e){q(e.message)}Y(!1)}}),function(e){return El.apply(this,arguments)}),[T]),Ul=(0,i.useCallback)((Sl=n(function*(e){if(T){Y(!0),Ye(null);try{var l=yield T.mediaFile({id:e});ml(l)}catch(e){Ye(e.message)}Y(!1)}}),function(e){return Sl.apply(this,arguments)}),[T]),Gl=(0,i.useCallback)((Il=n(function*(e){if(T&&te){Re(!0),Ve(null);try{yield T.controlDevice({id:te._id,type:e}),Ve({success:!0,message:`Command sent: ${e}`})}catch(e){Ve({success:!1,message:e.message})}Re(!1)}}),function(e){return Il.apply(this,arguments)}),[T,te]),Vl=(0,i.useCallback)(n(function*(e=!1){if(T&&te&&E){Y(!0),Qe(null),We(null);try{e&&(yield T.controlDevice({id:te._id,type:"take-screenshot"}),yield new Promise(e=>setTimeout(e,3e3)));var l=yield(0,d.he)(T,E,te._id,null,{preferThumbnail:!0});l.error?Qe(l.error):We(l)}catch(e){Qe(e.message)}Y(!1)}}),[T,te,E]),Fl=j((0,i.useCallback)(()=>{T&&Al()},[T,Al]),jl),Hl=j((0,i.useCallback)(()=>{T&&te&&Bl(te._id)},[T,te,Bl]),Tl),$l=j((0,i.useCallback)(()=>{T&&Pl()},[T,Pl]),fl),Yl=j((0,i.useCallback)(()=>{T&&Ae&&Ol(Ae._id)},[T,Ae,Ol]),pl);return $&&!E?(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(f,{workspace:E,view:t}),(0,m.jsx)(v,{text:"Connecting to workspace..."})]}):W&&!E?(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(f,{workspace:E,view:t}),(0,m.jsxs)(o.Text,{color:"red",children:["Error: ",W]}),(0,m.jsx)(p,{})]}):(0,m.jsxs)(o.Box,{flexDirection:"column",children:[(0,m.jsx)(f,{workspace:E,view:t}),t===x.MAIN&&(0,m.jsx)(b,{onSelect:l=>{"exit"!==l.value?(u(l.value),l.value===x.DEVICES?Al():l.value===x.APPS?Cl():l.value===x.MODULES?kl():l.value===x.GROUPS?Pl():l.value===x.MEDIA_BOXES&&Ml()):e()},mediaEnabled:(0,d.wR)(E),activityLogEnabled:!!(0,c.getActivityLogBaseUrl)()}),t===x.DEVICES&&(0,m.jsx)(S,{devices:Q,loading:$,onSelect:e=>{if("back"!==e.value){if("refresh"===e.value)return Al(),void Fl.resetCountdown();ne(null),Y(!0),u(x.DEVICE_DETAIL),Bl(e.value)}else u(x.MAIN)},countdown:Fl.countdown,lastRefreshTime:Fl.lastRefreshTime}),t===x.DEVICE_DETAIL&&(0,m.jsx)(I,{device:te,loading:$,error:$e,onSelect:e=>"back"===e.value?(u(x.DEVICES),void ne(null)):"refresh"===e.value?(Bl(te._id),void Hl.resetCountdown()):("control"===e.value&&(u(x.DEVICE_CONTROL),Ve(null)),void("screenshot"===e.value&&(u(x.DEVICE_SCREENSHOT),We(null),Qe(null),Vl(!1)))),mediaEnabled:(0,d.wR)(E),countdown:Hl.countdown,lastRefreshTime:Hl.lastRefreshTime}),t===x.DEVICE_CONTROL&&(0,m.jsx)(A,{device:te,onSelect:e=>{if("back"===e.value)return u(x.DEVICE_DETAIL),void Ve(null);Gl(e.value)},controlling:Me,controlResult:Ge}),t===x.DEVICE_SCREENSHOT&&(0,m.jsx)(B,{device:te,screenshot:Je,loading:$,error:Ze,onSelect:e=>{if("back"===e.value)return u(x.DEVICE_DETAIL),We(null),void Qe(null);"refresh"!==e.value?"take"===e.value&&Vl(!0):Vl(!1)}}),t===x.APPS&&(0,m.jsx)(C,{apps:se,loading:$,onSelect:e=>{"back"!==e.value?"refresh"!==e.value?(he(null),Y(!0),u(x.APP_DETAIL),Ll(e.value)):Cl():u(x.MAIN)}}),t===x.APP_DETAIL&&(0,m.jsx)(L,{app:ue,loading:$,error:$e,onSelect:e=>{if("back"===e.value)return u(x.APPS),void he(null);"refresh"!==e.value?("short_edit"===e.value&&(u(x.APP_SHORT_EDIT),Ye(null)),"project_init"===e.value&&(u(x.APP_PROJECT_INIT),Ye(null))):Ll(ue._id)}}),t===x.APP_SHORT_EDIT&&(0,m.jsx)(X,{instanceType:"application",instance:ue,client:T,onDone:n(function*(){return Ll(ue._id)}),onCancel:()=>u(x.APP_DETAIL)}),t===x.APP_PROJECT_INIT&&(0,m.jsx)(ae,{type:"application",instance:ue,client:T,onDone:()=>u(x.APP_DETAIL),onCancel:()=>u(x.APP_DETAIL)}),t===x.MODULES&&(0,m.jsx)(k,{modules:je,loading:$,onSelect:e=>{"back"!==e.value?"refresh"!==e.value?(_e(null),Y(!0),u(x.MODULE_DETAIL),wl(e.value)):kl():u(x.MAIN)}}),t===x.MODULE_DETAIL&&(0,m.jsx)(w,{module:ve,loading:$,error:$e,onSelect:e=>{if("back"===e.value)return u(x.MODULES),void _e(null);"refresh"!==e.value?("short_edit"===e.value&&(u(x.MODULE_SHORT_EDIT),Ye(null)),"project_init"===e.value&&(u(x.MODULE_PROJECT_INIT),Ye(null))):wl(ve._id)}}),t===x.MODULE_SHORT_EDIT&&(0,m.jsx)(X,{instanceType:"module",instance:ve,client:T,onDone:n(function*(){return wl(ve._id)}),onCancel:()=>u(x.MODULE_DETAIL)}),t===x.MODULE_PROJECT_INIT&&(0,m.jsx)(ae,{type:"module",instance:ve,client:T,onDone:()=>u(x.MODULE_DETAIL),onCancel:()=>u(x.MODULE_DETAIL)}),t===x.GROUPS&&(0,m.jsx)(P,{groups:De,loading:$,onSelect:e=>{if("back"!==e.value){if("refresh"===e.value)return Pl(),void $l.resetCountdown();Be(null),we([]),Y(!0),u(x.GROUP_DETAIL),Ol(e.value)}else u(x.MAIN)},countdown:$l.countdown,lastRefreshTime:$l.lastRefreshTime}),t===x.GROUP_DETAIL&&(0,m.jsx)(M,{group:Ae,groupDevices:ke,loading:$,error:$e,onSelect:e=>{if("back"===e.value)return u(x.GROUPS),Be(null),void we([]);"refresh"===e.value&&(Ol(Ae._id),Yl.resetCountdown())},countdown:Yl.countdown,lastRefreshTime:Yl.lastRefreshTime}),t===x.ACTIVITY_LOG&&(0,m.jsx)(H,{onBack:()=>u(x.MAIN)}),t===x.MEDIA_BOXES&&(0,m.jsx)(R,{boxes:rl,loading:$,onSelect:e=>{"back"!==e.value?"refresh"!==e.value?(al(null),xl([]),Y(!0),u(x.MEDIA_BOX_DETAIL),Rl(e.value)):Ml():u(x.MAIN)}}),t===x.MEDIA_BOX_DETAIL&&(0,m.jsx)(N,{box:ol,loading:$,error:$e,onSelect:e=>{if("back"===e.value)return u(x.MEDIA_BOXES),al(null),void xl([]);"refresh"!==e.value?"files"===e.value&&(xl([]),ml(null),u(x.MEDIA_FILES),Nl(ol.id)):Rl(ol.id)}}),t===x.MEDIA_FILES&&(0,m.jsx)(U,{files:dl,box:ol,loading:$,onSelect:e=>{if("back"===e.value)return u(x.MEDIA_BOX_DETAIL),void ml(null);"refresh"!==e.value?(ml(null),Y(!0),u(x.MEDIA_FILE_DETAIL),Ul(e.value)):Nl(ol.id)}}),t===x.MEDIA_FILE_DETAIL&&(0,m.jsx)(G,{file:gl,loading:$,error:$e,onSelect:e=>{if("back"===e.value)return u(x.MEDIA_FILES),void ml(null);"refresh"===e.value&&Ul(gl.id)}}),(0,m.jsx)(p,{})]})};var ce="1"===process.env.BRICKS_CLI_DISTRIBUTION,de=function(){var e=n(function*(){if(ce)(0,o.render)((0,m.jsx)(se,{}));else{var e=(yield Promise.resolve().then(r.bind(r,29557))).TerminalInfoProvider;(0,o.render)((0,m.jsx)(e,{children:(0,m.jsx)(se,{})}))}});return function(){return e.apply(this,arguments)}}()}};
package/lib/890.js DELETED
@@ -1 +0,0 @@
1
- export const __webpack_esm_id__=890;export const __webpack_esm_ids__=[890];export const __webpack_esm_modules__={38890:(e,r,t)=>{const{getDocByTemplateKey:a}=t(63981),n=t(80211),i=t(45907),{getBrickName:o}=t(86343);r.checkConfigDeprecatedFeatures=e=>{const r=[];return Object.entries(e.subspace_map||{}).forEach(([e,t])=>{Object.entries(t.brick_map||{}).forEach(([n,i])=>{void 0===i.property?.borderLeftWidth&&void 0===i.property?.borderRightWidth&&void 0===i.property?.borderTopWidth&&void 0===i.property?.borderBottomWidth||r.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 \`${o("brick",i,n)}\` brick still used the border width. Please re-edit it to transfer to the new unit.`});const s=a(i.template_key);s?.brickMeta?.deprecated&&r.push({id:n,name:"Used Deprecated Feature",data:`The \`${o("brick",i,n)}\` brick in \`${o("subspace",t,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(t.generator_map||{}).forEach(([n,i])=>{const s=a(i.template_key);s?.brickMeta?.deprecated&&r.push({id:n,name:"Used Deprecated Feature",data:`The \`${o("brick",i,n)}\` brick in \`${o("subspace",t,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.`})})}),r},r.checkConfig=e=>{const r={schema:n(e),ref:i(e)};return r.valid=0===r.schema.length&&0===r.ref.length,r.message=r.schema.concat(r.ref).map(({instancePath:e,field:r,message:t})=>{const a=e||r;return a?`${a}: ${t}`:t}).join("\n"),r}},86343:(e,r,t)=>{const{v4:a}=t(79194),n=t(95479),{nameMap:i,brickMapping:o,generatorMapping:s}=t(63981);r.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,r.getAnimationType=e=>e.type||e.compose_type||e.composeType,r.cleanUpAnimationMap=e=>Object.entries(e).reduce((e,[r,t])=>((t.type||t.compose_type)&&(e[r]=t),e),{}),r.matchItemByItem=(e,r)=>{if(!e)return!1;let t;switch("string"==typeof r&&(t=r),e.type){case"brick":return e.brick_id===(t||r.brick_id);case"subspace":return e.subspace_id===(t||r.subspace_id);case"canvas":return e.canvas_id===(t||r.canvas_id);case"generator":return e.generator_id===(t||r.generator_id);case"property_bank":return e.property_bank_id===(t||r.property_bank_id);default:return!1}},r.makePasscode=()=>a(),r.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"]},r.getKindOneOfTypes=(e,t)=>"array"===e?"object"===t?r.kindOneOfTypes[`${e}-${t}`]:void 0:r.kindOneOfTypes[e],r.unitOneOfTypes=["grid","px","ms"],r.idOneOfTypes=["canvas","brick","generator","animation","property_bank"],r.typeToName={brick:"Brick",generator:"Generator",subspace:"Subspace",canvas:"Canvas",animation:"Animation",property_bank:"Data",property_bank_calc:"Calculation"},r.getBrickName=(e,t,a)=>{if(!t)return e.toUpperCase();if(t.title)return t.title;let o;switch(e){case"bank":o="BANK";break;case"subspace":o="SUBSPACE";break;case"canvas":o="CANVAS";break;case"animation":o=`<${n(r.getAnimationType(t))}>`;break;case"property_bank":o="<Data>";break;case"property_bank_calc":o="<Map>";break;case"state_group":o="<Switch Case>";break;default:o=`<${i[t.template_key||t.templateKey]||"Unknown"}>`}return a&&a.length>10?o+=` (${a.replace(/[A-Z_]+/g,"").substr(0,6)}...)`:a&&(o+=` (${a})`),o},r.getCallInternalActions=e=>{const r=o[e]||s[e];if(r)return r.callInternalActions},r.mapToList=(e,t)=>Object.entries(t).reduce((t,[a,n])=>(t.push({id:a,...n,title:r.getBrickName(e,n,a)}),t),[]);const p={subspaceMap:"subspace",brickMap:"brick",generatorMap:"generator",propertyBankMap:"property_bank",propertyAvailableToAdd:"property_bank",canvasMap:"canvas",animationMap:"animation"},c={};r.mapToListForDerivedState=(e,t,a,n)=>{const i=a[e]||c;return i!==n[e]?{[e]:i,[t]:r.mapToList(p[e],i)}:{}},r.arrayTypePrefix="array of ",r.propertyBankTypes=["string","number","bool","object","any",`${r.arrayTypePrefix}string`,`${r.arrayTypePrefix}number`,`${r.arrayTypePrefix}bool`,`${r.arrayTypePrefix}object`],r.animationRunTypes=["once","loop"],r.stopPropagationOnKeyBackspace=e=>{8===e.keyCode&&e.stopPropagation()},r.nestedTypes=["object","array","any"],r.isPropertyBankTypeNested=e=>r.nestedTypes.includes(e),r.propertyTypeToSchema=e=>{const t=e.indexOf(r.arrayTypePrefix)>-1,a=e.replace(r.arrayTypePrefix,"");return{type:a,properties:"object"===a?{}:void 0,allowNewItem:t,allowCustomProperty:"object"===a}}}};
package/lib/999.js DELETED
@@ -1 +0,0 @@
1
- export const __webpack_esm_id__=999;export const __webpack_esm_ids__=[999];export const __webpack_esm_modules__={12999:(e,r,t)=>{t.a(e,async(e,o)=>{try{t.r(r),t.d(r,{createCdpClient:()=>l});var n=t(99436),a=t(84361),s=e([a]),i=s.then?(await s)():s;a=i[0];var c=(m=n(function*(e,r,t){if(!t)try{var o=new AbortController,n=setTimeout(()=>o.abort(),3e3),a=yield fetch(`http://${e}:${r}/json/list`,{signal:o.signal});if(clearTimeout(n),a.ok){var s=yield a.json(),i=s?.[0]?.webSocketDebuggerUrl;if(i){var c=i.match(/\/ws(?:\/.*)?$/);if(c)return`ws://${e}:${r}${c[0]}`}}}catch{}return t?`ws://${e}:${r}/ws/${encodeURIComponent(t)}`:`ws://${e}:${r}/ws`}),function(e,r,t){return m.apply(this,arguments)}),l=(e,r,t)=>{var o,s,i=0,l=new Map,m=new Map;return{connect:(s=n(function*(){var n=yield c(e,r,t);return new Promise((t,s)=>{(o=new a.WebSocket(n)).once("open",()=>t()),o.once("error",t=>{s(new Error(t.message||`Cannot connect to ${e}:${r}`))}),o.on("message",e=>{try{var r=JSON.parse(e.toString());if(null!=r.id&&l.has(r.id)){var t=l.get(r.id),o=t.resolve,n=t.reject,a=t.timer;return clearTimeout(a),l.delete(r.id),void(r.error?n(new Error(r.error.message)):o(r.result))}if(r.method){var s=m.get(r.method);if(s)for(var i of s)i(r.params)}}catch{}}),o.on("close",()=>{for(var e of l.values()){var r=e.reject,t=e.timer;clearTimeout(t),r(new Error("Connection closed"))}l.clear()})})}),function(){return s.apply(this,arguments)}),send:(e,r={},t=15e3)=>new Promise((n,a)=>{if(o&&o.readyState===o.OPEN){var s=++i,c=setTimeout(()=>{l.delete(s),a(new Error(`Timeout: ${e}`))},t);l.set(s,{resolve:n,reject:a,timer:c}),o.send(JSON.stringify({id:s,method:e,params:r}))}else a(new Error("Not connected"))}),on:(e,r)=>{m.has(e)||m.set(e,[]),m.get(e).push(r)},off:(e,r)=>{var t=m.get(e);if(t){var o=t.indexOf(r);o>=0&&t.splice(o,1)}},close:()=>{for(var e of l.values()){var r=e.timer;clearTimeout(r)}l.clear(),o&&(o.terminate(),o=null)}}};o()}catch(e){o(e)}var m})}};