@fugood/bricks-cli 2.25.0-beta.53 → 2.25.0-beta.58

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/117.js CHANGED
@@ -1,6 +1,6 @@
1
- export const __rspack_esm_id=117;export const __rspack_esm_ids=[117];export const __webpack_modules__={98372(e,i,t){t.r(i),t.d(i,{startStdioServer:()=>tJ});var n,a,o,r,s,d,c={};t.r(c),t.d(c,{applicationFragment:()=>es,applicationShortFragment:()=>ef,deviceFragment:()=>eo,deviceGroupFragment:()=>er,deviceShortFragment:()=>ey,instanceVersionFragment:()=>ep,mediaBoxFragment:()=>ev,mediaFileFragment:()=>eh,mediaWorkspaceFragment:()=>e$,moduleFragment:()=>ec,moduleShortFragment:()=>el,operationFragment:()=>eu,publicApplicationBasicInfoFragment:()=>ed,userFavoriteFragment:()=>em,workspaceFragment:()=>e_,workspaceShortFragment:()=>eg});var l={};t.r(l),t.d(l,{application:()=>eW,applicationByDevice:()=>eE,applicationReleaseVersion:()=>eT,applicationReleaseVersions:()=>eC,applicationTestsByDevice:()=>eU,applications:()=>eq,checkBindDevicePasscode:()=>eM,deviceUsage:()=>eV,devices:()=>ej,devicesByGroup:()=>eP,devicesByUniqueId:()=>eR,me:()=>ek,module:()=>eD,moduleReleaseVersion:()=>eB,moduleReleaseVersions:()=>ex,modules:()=>eA,publicModules:()=>eS,publicModulesByIdList:()=>ew,workspace:()=>eF,workspacePricingPlans:()=>eO,workspaces:()=>eN});var p={};t.r(p),t.d(p,{addUserFavorite:()=>iD,assignGroupPermissions:()=>ih,bindApplication:()=>e7,bindApplicationWithDeviceGroup:()=>it,changeWorkspaceAdditionalLimitSpending:()=>iw,changeWorkspaceSubscriptionPlan:()=>iS,controlDevice:()=>e0,createApplication:()=>e9,createApplicationWithShareVersion:()=>e3,createConfigChangeOperation:()=>ig,createDevice:()=>ez,createDeviceGroup:()=>e1,createDeviceGroupWithApp:()=>ir,createModule:()=>il,createVirtualDevice:()=>eH,createWorkspace:()=>eY,createWorkspaceOTP:()=>iC,dispatchDeviceGroupAction:()=>e6,doOperation:()=>iy,duplicateApplication:()=>id,duplicateModule:()=>im,forkApplication:()=>is,moveApplication:()=>io,moveDevice:()=>eX,moveModule:()=>iu,registerFCMNotification:()=>ib,registerRemoteDebug:()=>iI,removeApplication:()=>ic,removeDevice:()=>eZ,removeDeviceGroup:()=>e5,removeModule:()=>i_,removeOperation:()=>iv,removeUserFavorite:()=>iA,removeWorkspace:()=>e2,revokeWorkspaceOTP:()=>iT,shareAccessToken:()=>ik,shareApplication:()=>ia,toggleShortEditApplication:()=>ie,updateApplication:()=>e8,updateApplicationViewportPreset:()=>ii,updateDevice:()=>eJ,updateDeviceGroup:()=>e4,updateModule:()=>ip,updateOperation:()=>i$,updateVirtualDevice:()=>eQ,updateWorkspace:()=>eG,updateWorkspaceTokens:()=>eL});var u={};t.r(u),t.d(u,{application:()=>iM,applicationByDevice:()=>iR,applications:()=>iU,device:()=>iN,deviceUsage:()=>iW,devices:()=>iF,devicesByApplication:()=>iq,mediaBox:()=>iK,mediaBoxes:()=>iV,mediaFile:()=>iG,mediaFiles:()=>iY,mediaWorkspace:()=>ij,module:()=>iO,modules:()=>iP,workspace:()=>iE});var m={};t.r(m),t.d(m,{bindApplication:()=>iH,copyMediaFiles:()=>i6,createApplication:()=>iL,createModule:()=>iX,deleteMediaBoxFiles:()=>i2,deleteMediaFiles:()=>i5,requestFileUpload:()=>iZ,setMediaFileAsBoxPreview:()=>i4,unbindApplication:()=>iJ,updateApplication:()=>iz,updateMediaFile:()=>i0,updateMediaFiles:()=>i1,updateModule:()=>iQ});var _={};t.r(_),t.d(_,{mediaBox:()=>tg,mediaBoxes:()=>tm,mediaFile:()=>ty,mediaFiles:()=>tf,mediaWorkspace:()=>t_,mediaWorkspaces:()=>tu});var g={};t.r(g),t.d(g,{assignGroupPermissions:()=>tT,copyMediaFiles:()=>tw,createMediaBox:()=>th,createMediaWorkspace:()=>t$,deleteMediaFiles:()=>tS,moveMediaBox:()=>tb,requestFileUpload:()=>tk,setMediaFileAsBoxPreview:()=>tC,updateMediaBox:()=>tI,updateMediaFile:()=>tD,updateMediaFiles:()=>tA,updateMediaWorkspace:()=>tv});var f={};t.r(f),t.d(f,{mediaBox:()=>tB,mediaFile:()=>tU,mediaFiles:()=>tE});var y={};t.r(y),t.d(y,{deleteMediaFiles:()=>tO,requestFileUpload:()=>tM,updateMediaFile:()=>tR,updateMediaFiles:()=>tP});var $=t(99436),v=t(25326),h=t(66029),b={info:"info",manage_signature:"sign",query_application:"qa",query_device:"qd",query_device_group:"qdg",query_module:"qm",query_activity_log:"qal",create_application:"ca",create_device:"cd",create_device_group:"cdg",create_module:"cm",update_application:"ua",bind_application:"ba",short_edit_application:"uas",canvas_control_application:"uacc",update_device:"ud",update_device_group:"udg",update_module:"um",short_edit_module:"ums",remove_application:"ra",remove_device:"rd",remove_device_group:"rdg",remove_module:"rm",control_device:"ctld",control_application_device:"ctlad",control_device_group:"ctldg",query_media_flow:"qmf",write_media_flow:"wmf",access_unstable_feature:"UNSTABLE"},I=Object.entries(b).reduce((e,[i,t])=>(e[t]=i,e),{}),k=["HS256","RS256"],D=["https://auth0.bricks.tools/","https://mybigday.auth0.com/"],A=t(84867);let S='# Getting Started with BRICKS\n\nBRICKS (方塊磚) is a comprehensive platform for creating interactive multimedia display applications specifically designed for digital signage screens. It enables users to design complete applications without programming, using a visual, component-based approach.\n\n**Important**: Users interact through a visual GUI editor, not raw configuration files. Always 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 details\n\n## Core Philosophy\n\nBRICKS operates as a **Launcher system** that reads configuration files from the cloud (or cached locally) and must maintain normal operation even when offline. The system periodically reports health status and supports watchdog timers for automatic restart or maintenance mode activation.\n\n## Fundamental Architecture\n\n### The Three Core Elements\n\n#### 1. Canvas (畫布)\n- **Definition**: The visual container that defines what users see on screen\n- **Behavior**: Screen transitions occur by switching between different canvases\n- **Smart Transitions**: When switching canvases, BRICKS automatically compares shared elements and smoothly animates their position/size changes\n- **Properties**:\n - `Showing Timeout`: Auto-advance to next canvas after specified time\n - `Next Canvas ID`: Target canvas for timeout transitions\n - `Background Color`: Canvas background\n - `Dismiss Keyboard On Press`: Touch behavior for keyboard dismissal\n- **Events**: `CANVAS_FIRST_ENTER`, `CANVAS_ENTER`, `CANVAS_SHOWING_TIMEOUT`, `CANVAS_EXIT`\n\n#### 2. Brick (方塊)\n- **Definition**: Visual components that display content and handle user interactions\n- **Animation System**: All bricks support three animation phases:\n - **Enter Animation**: How the brick appears on screen\n - **Display Animation**: Ongoing animations while visible\n - **Exit Animation**: How the brick disappears\n- **Positioning**: Uses grid-based positioning system for resolution independence\n- **Interaction**: Can respond to touch events and trigger system actions\n\nAvailable template:\n[:BRICK_IDS:]\n\n#### 3. Generator (處理器)\n- **Definition**: Invisible processing units that handle non-visual functionality\n- **Purpose**: Handle hardware interactions (camera, sensors), data processing, network communication\n- **Input**: Receives parameters exclusively through Property Bank\n- **Output**: Returns results exclusively through Property Bank\n- **Triggers**: Activated by Events connected to their Actions\n\nAvailable template:\n[:GENERATOR_IDS:]\n\n### Data (Property Bank, 參數庫)\nThe central data management system that serves as the backbone of BRICKS applications:\n\n#### Key Features\n- **KEY-VALUE Structure**: Simple, accessible data storage\n- **Dual Events**: Each property supports both "Update" and "Value Change" events\n- **Auto-Refresh**: UI elements automatically update when linked data changes\n- **Cross-Subspace Communication**: Properties can be shared between different subspaces\n- **Data Types**: `string`, `number`, `bool`, `object`, `array`, `any`\n- **Special Kinds**: `color`, `datetime`, `id`, `media-resource-*`, `lottie-file-uri`\n- **Units**: `grid`, `px`, `ms` for different measurement types\n\n#### Routing Options\n- **read-only**: Cannot be changed from other subspaces\n- **Default**: Accepts changes from other subspaces\n\nTerminology note: We refer to the central data system as "Data" in docs and UI. Internally, it remains "Property Bank" and uses `PROPERTY_BANK_*` identifiers.\n\n### Event System\nBRICKS uses a comprehensive event-driven architecture:\n\n#### Event Sources\n- **System Events**: Property Bank changes, timer events, canvas transitions\n- **Brick Events**: User interactions (press, focus, value changes)\n- **Generator Events**: Hardware responses, network callbacks, processing completions\n\n#### Event Handling\n- **Sequential Processing**: Events trigger Actions in defined order\n- **Parameter Passing**: All parameters passed through Property Bank\n- **Action Types**: System actions or Generator actions\n\n### Subspace (子空間)\nAdvanced modularity system for complex applications:\n\n#### Concept\n- **Nested Systems**: Complete BRICKS system within a brick\n- **Independent Operation**: Own canvases, bricks, and property banks\n- **Modular Behavior**: Can be positioned, scaled, and animated like regular bricks\n\n#### Communication\n- **Input**: External Property Bank values copied to internal Property Bank\n- **Output**: Internal Property Bank changes trigger external events\n- **Data Flow**: Call-by-value copying maintains isolation while enabling communication\n\n## Grid System\n\n### Resolution Independence\n- **Default Grid**: 96\xd754 units (optimized for HD displays)\n- **Automatic Scaling**: Grid units convert to pixels based on device resolution\n- **Calculation**: `grid_unit_size_px = device_width_px / app_grid_width`\n\n### Examples\n| Device Resolution | App Grid Size | Grid Unit Size |\n|------------------|---------------|----------------|\n| 1920\xd71080 | 96\xd754 | 20px |\n| 3840\xd72160 | 96\xd754 | 40px |\n| 1280\xd7720 | 96\xd754 | 13.33px |\n\n### Positioning Features\n- **Overflow Support**: Elements can extend beyond visible area\n- **Partial Display**: Elements at negative positions show partial content\n- **Performance Optimization**: Completely off-screen elements are automatically ignored\n\n## Configuration Structure\n\n### Hierarchy\n```\nApplication (應用程式)\n├── Root Subspace\n├── Subspace Map\n│ ├── Canvas Map\n│ ├── Brick Map\n│ └── Generator Map\n├── Property Bank\n├── Property Bank Calc\n├── Event Map\n└── Automation Map\n```\n\n### Item property\nProperties can set constant value or link data like this\n\n```js\n{\n "example1": 123,\n "example2": "PROPERTY_BANK#<Data Node ID>", // Link Data\n "example3": {\n "PROPERTY_BANK#<Data Node ID>", // Link Data in object, we recommend direct link without middle object data\n }\n}\n```\n\n### Item outlet\nData output from brick or generator, you can link it to data\n\n```js\n{\n OUTLET_NAME: \'<Data Node ID>\'\n}\n```\n\n### Event actions\nOn handling event can do actions with this schema\n\n```js\n[\n {\n "action": "string",\n "handler": "string",\n "parameter_list": [\n {\n "input_to_receiver": "string", // Argument\n "result_from_sender": "string" // Link data\n }\n ],\n "wait_async": "boolean"\n }\n]\n```\n\n- `handler: SYSTEM`\n[:SYSTEM_ACTIONS:]\n- `handler: GENERATOR_<UUID>`\n- `handler: BRICK_<UUID>`\n\n## Development Workflow\n\n### 1. Design Phase\n- Define grid layout (usually 96\xd754)\n- Plan canvas flow and transitions\n- Identify required data flows\n\n### 2. Implementation\n- Use `create_item` to constuct config\n- Create subspaces for different app sections\n- Add canvases for each screen/state\n- Place and configure bricks for UI elements\n- Add generators for processing logic\n- Connect events to actions\n\n### 3. Data Management\n- Set up Property Bank structure\n- Configure property types and routing\n- Link UI elements to data sources\n- Implement data processing flows\n\n#### Mental Model\n- Reactive architecture: events trigger actions; actions update Data; UI and generators react to Data changes.\n- Calculations: optional graphs transform Data using Data Calculation (command/data nodes or script).\n- Always read/write via Data. Generators receive input from Data and write outputs back to Data.\n\n#### Common Patterns\n- Event → Action → Data update or Outlet → Data update\n- Data change → Triggers downstream calculations → Updates target Data\n- Cross-subspace routing: respect `read-only` vs `default`\n\n### 4. Testing & Deployment\n- Use automation maps for testing\n- Validate configuration schema\n- Deploy to target devices\n- Monitor system health\n\n## Best Practices\n\n### Performance\n- Use 96\xd754 grid for standard content\n- Minimize off-screen elements\n- Optimize property bank access patterns\n- Cache media resources appropriately\n\n### User Experience\n- Always use enter/exit animations (avoid sudden appearances)\n- Maintain consistent transition timing\n- Design for offline operation\n- Implement proper error handling\n\n### Architecture\n- Keep subspaces focused and modular\n- Use generators for all non-visual processing\n- Minimize cross-subspace dependencies\n- Design for reusability through modules\n\n## Network & Offline Behavior\n\n### Online Operation\n- Configuration sync from cloud\n- Media resource loading\n- Real-time data updates\n- Health status reporting\n\n### Offline Requirements\n- **Display Continuity**: All display and reading functions must work offline\n- **Data Caching**: Write operations cached locally and synced when online\n- **Resource Management**: Media and assets preloaded during online periods\n- **Graceful Degradation**: Non-essential features disabled, core functionality maintained\n\nThis comprehensive foundation enables the creation of sophisticated, interactive digital signage applications that are both powerful and maintainable.\n\n## Local Sync\n\nLocal Sync enables near real-time intranet communication between devices for seamless multi-screen display splicing.\n\n- Data Sync: Synchronize selected data (Property Bank/Data nodes) across devices so UI updates remain consistent.\n- Canvas Sync: Optionally synchronize active canvas to orchestrate state transitions across screens.\n- Typical Use: Video walls, tiled displays, or clustered players that must behave as one.\n- Transport: LAN/intranet only; optimized for low latency and reliability inside the local network.\n- Resilience: Designed to tolerate temporary disconnections; devices rejoin and resynchronize state.\n\nConfiguration hints (high level):\n- Subspaces can define local sync behavior (e.g., whether to sync canvas changes).\n- Generators may opt into specific local sync run modes.\n- Keep payloads small and data normalized for best performance.';var w=t(20181),C=(e,i={})=>({content:[w.Buffer.isBuffer(e)?{...i,blob:e.toString("base64"),type:"blob"}:{...i,text:"string"==typeof e?e:JSON.stringify(e,null,2),type:"text"}],isError:!1}),T=t(68832),x=t(79657),B=t(79861),E=t(46123),U=t(80211),M=t(45907),R=t(99548),P=t(96423),O=U.ajv.getSchema("http://display.bricks.tools/root.schema.json5"),F=(0,P.A)(["subspace_map.*.property_bank_calc_map.*.script_config"]);function N(e){var i=[];try{var t=U(e);i.push(...(0,R.L)({errors:t,schema:O,data:e}).map(({path:e,message:i})=>`${e}: ${i}`));try{i.push(...M(e).map(({field:e,message:i})=>`${e}: ${i}`))}catch(e){i.push(`Component reference validation failed: ${e.message}`)}return F(e).forEach(t=>{var n=t.slice(0,-1),a=E(e,n),o=n.join(".");if(0===Object.keys(a.map).length)i.push(`${o}.map is empty`);else{var r=a.script_config,s=r.inputs,d=r.output,c=r.outputs,l=r.error;s&&Object.keys(s).forEach(e=>{a.map[e]||i.push(`${o}.map.${e} is missing`)}),d&&!a.map[d]&&i.push(`${o}.map.${d} is missing`),c&&Object.values(c).forEach(e=>{a.map[e]||i.push(`${o}.map.${e} is missing`)}),l&&!a.map[l]&&i.push(`${o}.map.${l} is missing`)}}),{valid:0===i.length,errors:i}}catch(e){return{valid:!1,errors:[`Validation failed: ${e.message}`]}}}var q=t(49741),W=t(63981),j=(e,i="en-us")=>"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,"object"!=typeof t||Array.isArray(t)?t:t[i]??j(t,i)])):e,V=j(q.t),K=Object.entries(q.systemActions).map(([e,{propertyNameType:i,property:t}])=>` - \`${e}\`: ${V[e]}
1
+ export const __rspack_esm_id=117;export const __rspack_esm_ids=[117];export const __webpack_modules__={98372(e,i,t){t.r(i),t.d(i,{startStdioServer:()=>tX});var n,a,o,r,s,d,c={};t.r(c),t.d(c,{applicationFragment:()=>ed,applicationShortFragment:()=>ey,deviceFragment:()=>er,deviceGroupFragment:()=>es,deviceShortFragment:()=>e$,instanceVersionFragment:()=>eu,mediaBoxFragment:()=>eh,mediaFileFragment:()=>eb,mediaWorkspaceFragment:()=>ev,moduleFragment:()=>el,moduleShortFragment:()=>ep,operationFragment:()=>em,publicApplicationBasicInfoFragment:()=>ec,userFavoriteFragment:()=>e_,workspaceFragment:()=>eg,workspaceShortFragment:()=>ef});var l={};t.r(l),t.d(l,{application:()=>ej,applicationByDevice:()=>eU,applicationReleaseVersion:()=>ex,applicationReleaseVersions:()=>eT,applicationTestsByDevice:()=>eM,applications:()=>eW,checkBindDevicePasscode:()=>eR,deviceUsage:()=>eK,devices:()=>eV,devicesByGroup:()=>eO,devicesByUniqueId:()=>eP,me:()=>eD,module:()=>eA,moduleReleaseVersion:()=>eE,moduleReleaseVersions:()=>eB,modules:()=>eS,publicModules:()=>ew,publicModulesByIdList:()=>eC,workspace:()=>eN,workspacePricingPlans:()=>eF,workspaces:()=>eq});var p={};t.r(p),t.d(p,{addUserFavorite:()=>iA,assignGroupPermissions:()=>ib,bindApplication:()=>ie,bindApplicationWithDeviceGroup:()=>ia,changeWorkspaceAdditionalLimitSpending:()=>iC,changeWorkspaceSubscriptionPlan:()=>iw,controlDevice:()=>e1,createApplication:()=>e3,createApplicationWithShareVersion:()=>e8,createConfigChangeOperation:()=>iy,createDevice:()=>eH,createDeviceGroup:()=>e4,createDeviceGroupWithApp:()=>is,createModule:()=>ip,createVirtualDevice:()=>eJ,createWorkspace:()=>eG,createWorkspaceOTP:()=>iT,dispatchDeviceGroupAction:()=>e5,doOperation:()=>i$,duplicateApplication:()=>ic,duplicateModule:()=>i_,forkApplication:()=>id,moveApplication:()=>ir,moveDevice:()=>eQ,moveModule:()=>im,registerFCMNotification:()=>iI,registerRemoteDebug:()=>ik,removeApplication:()=>il,removeDevice:()=>e0,removeDeviceGroup:()=>e2,removeModule:()=>ig,removeOperation:()=>ih,removeUserFavorite:()=>iS,removeWorkspace:()=>e9,revokeWorkspaceOTP:()=>ix,shareAccessToken:()=>iD,shareApplication:()=>io,toggleShortEditApplication:()=>ii,updateApplication:()=>e7,updateApplicationViewportPreset:()=>it,updateDevice:()=>eX,updateDeviceGroup:()=>e6,updateModule:()=>iu,updateOperation:()=>iv,updateVirtualDevice:()=>eZ,updateWorkspace:()=>eL,updateWorkspaceTokens:()=>ez});var u={};t.r(u),t.d(u,{application:()=>iR,applicationByDevice:()=>iP,applications:()=>iM,device:()=>iq,deviceUsage:()=>ij,devices:()=>iN,devicesByApplication:()=>iW,mediaBox:()=>iY,mediaBoxes:()=>iK,mediaFile:()=>iL,mediaFiles:()=>iG,mediaWorkspace:()=>iV,module:()=>iF,modules:()=>iO,workspace:()=>iU});var m={};t.r(m),t.d(m,{bindApplication:()=>iJ,copyMediaFiles:()=>i5,createApplication:()=>iz,createModule:()=>iQ,deleteMediaBoxFiles:()=>i9,deleteMediaFiles:()=>i2,requestFileUpload:()=>i0,setMediaFileAsBoxPreview:()=>i6,unbindApplication:()=>iX,updateApplication:()=>iH,updateMediaFile:()=>i1,updateMediaFiles:()=>i4,updateModule:()=>iZ});var _={};t.r(_),t.d(_,{mediaBox:()=>tf,mediaBoxes:()=>t_,mediaFile:()=>t$,mediaFiles:()=>ty,mediaWorkspace:()=>tg,mediaWorkspaces:()=>tm});var g={};t.r(g),t.d(g,{assignGroupPermissions:()=>tx,copyMediaFiles:()=>tC,createMediaBox:()=>tb,createMediaWorkspace:()=>tv,deleteMediaFiles:()=>tw,moveMediaBox:()=>tI,requestFileUpload:()=>tD,setMediaFileAsBoxPreview:()=>tT,updateMediaBox:()=>tk,updateMediaFile:()=>tA,updateMediaFiles:()=>tS,updateMediaWorkspace:()=>th});var f={};t.r(f),t.d(f,{mediaBox:()=>tE,mediaFile:()=>tM,mediaFiles:()=>tU});var y={};t.r(y),t.d(y,{deleteMediaFiles:()=>tF,requestFileUpload:()=>tR,updateMediaFile:()=>tP,updateMediaFiles:()=>tO});var $=t(99436),v=t(25326),h=t(66029),b={info:"info",manage_signature:"sign",query_application:"qa",query_device:"qd",query_device_group:"qdg",query_module:"qm",query_activity_log:"qal",create_application:"ca",create_device:"cd",create_device_group:"cdg",create_module:"cm",update_application:"ua",bind_application:"ba",short_edit_application:"uas",canvas_control_application:"uacc",update_device:"ud",update_device_group:"udg",update_module:"um",short_edit_module:"ums",remove_application:"ra",remove_device:"rd",remove_device_group:"rdg",remove_module:"rm",control_device:"ctld",control_application_device:"ctlad",control_device_group:"ctldg",query_media_flow:"qmf",write_media_flow:"wmf",access_unstable_feature:"UNSTABLE"},I=Object.entries(b).reduce((e,[i,t])=>(e[t]=i,e),{}),k=["HS256","RS256"],D=["https://auth0.bricks.tools/","https://mybigday.auth0.com/"],A=t(84867);let S='# Getting Started with BRICKS\n\nBRICKS (方塊磚) is a comprehensive platform for creating interactive multimedia display applications specifically designed for digital signage screens. It enables users to design complete applications without programming, using a visual, component-based approach.\n\n**Important**: Users interact through a visual GUI editor, not raw configuration files. Always 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 details\n\n## Core Philosophy\n\nBRICKS operates as a **Launcher system** that reads configuration files from the cloud (or cached locally) and must maintain normal operation even when offline. The system periodically reports health status and supports watchdog timers for automatic restart or maintenance mode activation.\n\n## Fundamental Architecture\n\n### The Three Core Elements\n\n#### 1. Canvas (畫布)\n- **Definition**: The visual container that defines what users see on screen\n- **Behavior**: Screen transitions occur by switching between different canvases\n- **Smart Transitions**: When switching canvases, BRICKS automatically compares shared elements and smoothly animates their position/size changes\n- **Properties**:\n - `Showing Timeout`: Auto-advance to next canvas after specified time\n - `Next Canvas ID`: Target canvas for timeout transitions\n - `Background Color`: Canvas background\n - `Dismiss Keyboard On Press`: Touch behavior for keyboard dismissal\n- **Events**: `CANVAS_FIRST_ENTER`, `CANVAS_ENTER`, `CANVAS_SHOWING_TIMEOUT`, `CANVAS_EXIT`\n\n#### 2. Brick (方塊)\n- **Definition**: Visual components that display content and handle user interactions\n- **Animation System**: All bricks support three animation phases:\n - **Enter Animation**: How the brick appears on screen\n - **Display Animation**: Ongoing animations while visible\n - **Exit Animation**: How the brick disappears\n- **Positioning**: Uses grid-based positioning system for resolution independence\n- **Interaction**: Can respond to touch events and trigger system actions\n\nAvailable template:\n[:BRICK_IDS:]\n\n#### 3. Generator (處理器)\n- **Definition**: Invisible processing units that handle non-visual functionality\n- **Purpose**: Handle hardware interactions (camera, sensors), data processing, network communication\n- **Input**: Receives parameters exclusively through Property Bank\n- **Output**: Returns results exclusively through Property Bank\n- **Triggers**: Activated by Events connected to their Actions\n\nAvailable template:\n[:GENERATOR_IDS:]\n\n### Data (Property Bank, 參數庫)\nThe central data management system that serves as the backbone of BRICKS applications:\n\n#### Key Features\n- **KEY-VALUE Structure**: Simple, accessible data storage\n- **Dual Events**: Each property supports both "Update" and "Value Change" events\n- **Auto-Refresh**: UI elements automatically update when linked data changes\n- **Cross-Subspace Communication**: Properties can be shared between different subspaces\n- **Data Types**: `string`, `number`, `bool`, `object`, `array`, `any`\n- **Special Kinds**: `color`, `datetime`, `id`, `media-resource-*`, `lottie-file-uri`\n- **Units**: `grid`, `px`, `ms` for different measurement types\n\n#### Routing Options\n- **read-only**: Cannot be changed from other subspaces\n- **Default**: Accepts changes from other subspaces\n\nTerminology note: We refer to the central data system as "Data" in docs and UI. Internally, it remains "Property Bank" and uses `PROPERTY_BANK_*` identifiers.\n\n### Event System\nBRICKS uses a comprehensive event-driven architecture:\n\n#### Event Sources\n- **System Events**: Property Bank changes, timer events, canvas transitions\n- **Brick Events**: User interactions (press, focus, value changes)\n- **Generator Events**: Hardware responses, network callbacks, processing completions\n\n#### Event Handling\n- **Sequential Processing**: Events trigger Actions in defined order\n- **Parameter Passing**: All parameters passed through Property Bank\n- **Action Types**: System actions or Generator actions\n\n### Subspace (子空間)\nAdvanced modularity system for complex applications:\n\n#### Concept\n- **Nested Systems**: Complete BRICKS system within a brick\n- **Independent Operation**: Own canvases, bricks, and property banks\n- **Modular Behavior**: Can be positioned, scaled, and animated like regular bricks\n\n#### Communication\n- **Input**: External Property Bank values copied to internal Property Bank\n- **Output**: Internal Property Bank changes trigger external events\n- **Data Flow**: Call-by-value copying maintains isolation while enabling communication\n\n## Grid System\n\n### Resolution Independence\n- **Default Grid**: 96\xd754 units (optimized for HD displays)\n- **Automatic Scaling**: Grid units convert to pixels based on device resolution\n- **Calculation**: `grid_unit_size_px = device_width_px / app_grid_width`\n\n### Examples\n| Device Resolution | App Grid Size | Grid Unit Size |\n|------------------|---------------|----------------|\n| 1920\xd71080 | 96\xd754 | 20px |\n| 3840\xd72160 | 96\xd754 | 40px |\n| 1280\xd7720 | 96\xd754 | 13.33px |\n\n### Positioning Features\n- **Overflow Support**: Elements can extend beyond visible area\n- **Partial Display**: Elements at negative positions show partial content\n- **Performance Optimization**: Completely off-screen elements are automatically ignored\n\n## Configuration Structure\n\n### Hierarchy\n```\nApplication (應用程式)\n├── Root Subspace\n├── Subspace Map\n│ ├── Canvas Map\n│ ├── Brick Map\n│ └── Generator Map\n├── Property Bank\n├── Property Bank Calc\n├── Event Map\n└── Automation Map\n```\n\n### Item property\nProperties can set constant value or link data like this\n\n```js\n{\n "example1": 123,\n "example2": "PROPERTY_BANK#<Data Node ID>", // Link Data\n "example3": {\n "PROPERTY_BANK#<Data Node ID>", // Link Data in object, we recommend direct link without middle object data\n }\n}\n```\n\n### Item outlet\nData output from brick or generator, you can link it to data\n\n```js\n{\n OUTLET_NAME: \'<Data Node ID>\'\n}\n```\n\n### Event actions\nOn handling event can do actions with this schema\n\n```js\n[\n {\n "action": "string",\n "handler": "string",\n "parameter_list": [\n {\n "input_to_receiver": "string", // Argument\n "result_from_sender": "string" // Link data\n }\n ],\n "wait_async": "boolean"\n }\n]\n```\n\n- `handler: SYSTEM`\n[:SYSTEM_ACTIONS:]\n- `handler: GENERATOR_<UUID>`\n- `handler: BRICK_<UUID>`\n\n## Development Workflow\n\n### 1. Design Phase\n- Define grid layout (usually 96\xd754)\n- Plan canvas flow and transitions\n- Identify required data flows\n\n### 2. Implementation\n- Use `create_item` to constuct config\n- Create subspaces for different app sections\n- Add canvases for each screen/state\n- Place and configure bricks for UI elements\n- Add generators for processing logic\n- Connect events to actions\n\n### 3. Data Management\n- Set up Property Bank structure\n- Configure property types and routing\n- Link UI elements to data sources\n- Implement data processing flows\n\n#### Mental Model\n- Reactive architecture: events trigger actions; actions update Data; UI and generators react to Data changes.\n- Calculations: optional graphs transform Data using Data Calculation (command/data nodes or script).\n- Always read/write via Data. Generators receive input from Data and write outputs back to Data.\n\n#### Common Patterns\n- Event → Action → Data update or Outlet → Data update\n- Data change → Triggers downstream calculations → Updates target Data\n- Cross-subspace routing: respect `read-only` vs `default`\n\n### 4. Testing & Deployment\n- Use automation maps for testing\n- Validate configuration schema\n- Deploy to target devices\n- Monitor system health\n\n## Best Practices\n\n### Performance\n- Use 96\xd754 grid for standard content\n- Minimize off-screen elements\n- Optimize property bank access patterns\n- Cache media resources appropriately\n\n### User Experience\n- Always use enter/exit animations (avoid sudden appearances)\n- Maintain consistent transition timing\n- Design for offline operation\n- Implement proper error handling\n\n### Architecture\n- Keep subspaces focused and modular\n- Use generators for all non-visual processing\n- Minimize cross-subspace dependencies\n- Design for reusability through modules\n\n## Network & Offline Behavior\n\n### Online Operation\n- Configuration sync from cloud\n- Media resource loading\n- Real-time data updates\n- Health status reporting\n\n### Offline Requirements\n- **Display Continuity**: All display and reading functions must work offline\n- **Data Caching**: Write operations cached locally and synced when online\n- **Resource Management**: Media and assets preloaded during online periods\n- **Graceful Degradation**: Non-essential features disabled, core functionality maintained\n\nThis comprehensive foundation enables the creation of sophisticated, interactive digital signage applications that are both powerful and maintainable.\n\n## Local Sync\n\nLocal Sync enables near real-time intranet communication between devices for seamless multi-screen display splicing.\n\n- Data Sync: Synchronize selected data (Property Bank/Data nodes) across devices so UI updates remain consistent.\n- Canvas Sync: Optionally synchronize active canvas to orchestrate state transitions across screens.\n- Typical Use: Video walls, tiled displays, or clustered players that must behave as one.\n- Transport: LAN/intranet only; optimized for low latency and reliability inside the local network.\n- Resilience: Designed to tolerate temporary disconnections; devices rejoin and resynchronize state.\n\nConfiguration hints (high level):\n- Subspaces can define local sync behavior (e.g., whether to sync canvas changes).\n- Generators may opt into specific local sync run modes.\n- Keep payloads small and data normalized for best performance.';var w=t(20181),C=(e,i={})=>({content:[w.Buffer.isBuffer(e)?{...i,blob:e.toString("base64"),type:"blob"}:{...i,text:"string"==typeof e?e:JSON.stringify(e,null,2),type:"text"}],isError:!1}),T=t(68832),x=t(79657),B=t(79861),E=t(46123),U=t(80211),M=t(45907),R=t(99548),P=t(96423),O=U.ajv.getSchema("http://display.bricks.tools/root.schema.json5"),F=(0,P.A)(["subspace_map.*.property_bank_calc_map.*.script_config"]),N=e=>e&&"object"==typeof e?e:{};function q(e){var i=[];try{var t=U(e);i.push(...(0,R.L)({errors:t,schema:O,data:e}).map(({path:e,message:i})=>`${e}: ${i}`));try{i.push(...M(e).map(({field:e,message:i})=>`${e}: ${i}`))}catch(e){i.push(`Component reference validation failed: ${e.message}`)}return F(e).forEach(t=>{var n=t.slice(0,-1),a=E(e,n),o=n.join("."),r=N(a?.map),s=N(a?.script_config);if(0===Object.keys(r).length)i.push(`${o}.map is empty`);else{var d=s.inputs,c=s.output,l=s.outputs,p=s.error,u=N(d),m=N(l);d&&Object.keys(u).forEach(e=>{r[e]||i.push(`${o}.map.${e} is missing`)}),c&&!r[c]&&i.push(`${o}.map.${c} is missing`),l&&Object.values(m).forEach(e=>{r[e]||i.push(`${o}.map.${e} is missing`)}),p&&!r[p]&&i.push(`${o}.map.${p} is missing`)}}),{valid:0===i.length,errors:i}}catch(e){return{valid:!1,errors:[`Validation failed: ${e.message}`]}}}var W=t(49741),j=t(63981),V=(e,i="en-us")=>"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,"object"!=typeof t||Array.isArray(t)?t:t[i]??V(t,i)])):e,K=V(W.t),Y=Object.entries(W.systemActions).map(([e,{propertyNameType:i,property:t}])=>` - \`${e}\`: ${K[e]}
2
2
  ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i])=>` - \`${e}\`: ${JSON.stringify(i)}`).join("\n");case"property_bank":return" - `PROPERTY_BANK_DATA_NODE_*`: Value";default:return""}})(i,t)}
3
- `.trim()).join("\n"),Y=Object.keys(W.brickMapping).map(e=>`- \`${e}\``).join("\n"),G=Object.keys(W.generatorMapping).map(e=>`- \`${e}\``).join("\n");let L=S.replace("[:SYSTEM_ACTIONS:]",K).replace("[:BRICK_IDS:]",Y).replace("[:GENERATOR_IDS:]",G);var z=t(44668),H=t(5018),J=t(63315),X=t(30409),Q=t(40906),Z=t(79760),ee=t(22268),ei=t(7068),et=t(26197),en=t(94370);let ea=(0,en.default)`
3
+ `.trim()).join("\n"),G=Object.keys(j.brickMapping).map(e=>`- \`${e}\``).join("\n"),L=Object.keys(j.generatorMapping).map(e=>`- \`${e}\``).join("\n");let z=S.replace("[:SYSTEM_ACTIONS:]",Y).replace("[:BRICK_IDS:]",G).replace("[:GENERATOR_IDS:]",L);var H=t(44668),J=t(5018),X=t(63315),Q=t(30409),Z=t(40906),ee=t(79760),ei=t(22268),et=t(7068),en=t(26197),ea=t(94370);let eo=(0,ea.default)`
4
4
  fragment workspaceArguments on Workspace {
5
5
  __typename
6
6
  _id
@@ -93,7 +93,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
93
93
  updated_at
94
94
  }
95
95
  }
96
- `,eo=(0,en.default)`
96
+ `,er=(0,ea.default)`
97
97
  fragment deviceArguments on Device {
98
98
  __typename
99
99
  _id
@@ -246,7 +246,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
246
246
  }
247
247
  }
248
248
  }
249
- `,er=(0,en.default)`
249
+ `,es=(0,ea.default)`
250
250
  fragment deviceGroupArguments on DeviceGroup {
251
251
  __typename
252
252
  _id
@@ -284,7 +284,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
284
284
  device_target_name
285
285
  }
286
286
  }
287
- `,es=(0,en.default)`
287
+ `,ed=(0,ea.default)`
288
288
  fragment applicationArguments on Application {
289
289
  __typename
290
290
  _id
@@ -433,7 +433,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
433
433
  scope
434
434
  }
435
435
  }
436
- `,ed=(0,en.default)`
436
+ `,ec=(0,ea.default)`
437
437
  fragment publicApplicationBasicInfoArguments on PublicApplicationBasicInfo {
438
438
  _id
439
439
  owner {
@@ -477,7 +477,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
477
477
  }
478
478
  }
479
479
  }
480
- `,ec=(0,en.default)`
480
+ `,el=(0,ea.default)`
481
481
  fragment moduleArguments on Module {
482
482
  __typename
483
483
  _id
@@ -521,7 +521,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
521
521
  last_screenshot_id
522
522
  }
523
523
  }
524
- `,el=(0,en.default)`
524
+ `,ep=(0,ea.default)`
525
525
  fragment moduleShortArguments on Module {
526
526
  __typename
527
527
  _id
@@ -545,7 +545,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
545
545
  last_screenshot_id
546
546
  }
547
547
  }
548
- `,ep=(0,en.default)`
548
+ `,eu=(0,ea.default)`
549
549
  fragment instanceVersionArguments on ConfigVersion {
550
550
  __typename
551
551
  _id
@@ -556,7 +556,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
556
556
  instance_id
557
557
  entry
558
558
  }
559
- `,eu=(0,en.default)`
559
+ `,em=(0,ea.default)`
560
560
  fragment operationArguments on Operation {
561
561
  __typename
562
562
  _id
@@ -569,7 +569,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
569
569
  expired_datetime
570
570
  payload
571
571
  }
572
- `,em=(0,en.default)`
572
+ `,e_=(0,ea.default)`
573
573
  fragment userFavoriteArguments on UserFavorite {
574
574
  _id
575
575
  instance_type
@@ -580,7 +580,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
580
580
  }
581
581
  last_modify_datetime
582
582
  }
583
- `;var e_=(0,en.default)`
583
+ `;var eg=(0,ea.default)`
584
584
  fragment mcpWorkspaceArguments on Workspace {
585
585
  __typename
586
586
  _id
@@ -663,25 +663,25 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
663
663
  updated_at
664
664
  }
665
665
  }
666
- `,eg=(0,en.default)`
666
+ `,ef=(0,ea.default)`
667
667
  fragment mcpWorkspaceShortArguments on Workspace {
668
668
  _id
669
669
  name
670
670
  description
671
671
  }
672
- `,ef=(0,en.default)`
672
+ `,ey=(0,ea.default)`
673
673
  fragment mcpApplicationShortArguments on Application {
674
674
  _id
675
675
  name
676
676
  description
677
677
  }
678
- `,ey=(0,en.default)`
678
+ `,e$=(0,ea.default)`
679
679
  fragment mcpDeviceShortArguments on Device {
680
680
  _id
681
681
  name
682
682
  description
683
683
  }
684
- `,e$=(0,en.default)`
684
+ `,ev=(0,ea.default)`
685
685
  fragment workspaceMediaWorkspaceArguments on MediaWorkspace {
686
686
  id
687
687
  name
@@ -693,7 +693,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
693
693
  size
694
694
  sizeLimit
695
695
  }
696
- `,ev=(0,en.default)`
696
+ `,eh=(0,ea.default)`
697
697
  fragment workspaceMediaBoxArguments on MediaBox {
698
698
  id
699
699
  name
@@ -715,7 +715,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
715
715
  updatedAt
716
716
  size
717
717
  }
718
- `,eh=(0,en.default)`
718
+ `,eb=(0,ea.default)`
719
719
  fragment workspaceMediaFileArguments on MediaFile {
720
720
  id
721
721
  name
@@ -798,70 +798,70 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
798
798
  systemTags
799
799
  }
800
800
  }
801
- `,eb={query:"query",mutation:"mutate"},eI=z(function e(i,t,n,a,o){H(this,e),this.baseUrl=i,this.token=t,this.endpoint=n;var r=(0,Z.$)({uri:`${i}${n}`}),s=(0,et.o)((e,{headers:i})=>({headers:{...i,authorization:`Bearer ${t}`}}));this.apolloClient=new ee.R({link:s.concat(r),cache:new ei.D,defaultOptions:{watchQuery:{errorPolicy:"all",fetchPolicy:"no-cache"},query:{errorPolicy:"all",fetchPolicy:"no-cache"}}}),this.fragments=c,this.queries=a,this.mutations=o,this.generateMethods()},[{key:"generateMethods",value:function(){var e=this,i=i=>([t,n])=>{if(this[t])throw Error(`Overwriting client.${t}`);this[t]=$(function*(a={},o={}){try{var r=e.apolloClient[eb[i]],s=yield r({[i]:n,variables:a,...o}),d=s.data,c=s.errors;if(n.needResetStore)try{yield e.apolloClient.resetStore()}catch(e){console.error(e)}if(c)throw Error(c.map(({message:e})=>e).join("\n"));return d[t]}catch(e){if(e.cause)if(e.cause.result?.errors)throw Error(e.cause.result.errors.map(({message:e})=>e).join("\n"));else console.error(e.cause);throw e}})};Object.entries(this.queries).forEach(i("query")),Object.entries(this.mutations).forEach(i("mutation"))}},{key:"query",value:(n=$(function*(e,i={}){var t=yield this.apolloClient.query({query:e,variables:i,fetchPolicy:"no-cache"}),n=t.data,a=t.errors,o=t.error,r=t.message;if(o&&r)throw Error(r);if(a&&a.length>0)throw Error(a.map(({message:e})=>e).join("\n"));return n}),function(e){return n.apply(this,arguments)})},{key:"mutate",value:(a=$(function*(e,i={}){var t=yield this.apolloClient.mutate({mutation:e,variables:i}),n=t.data,a=t.errors,o=t.error,r=t.message;if(o&&r)throw Error(r);if(a&&a.length>0)throw Error(a.map(({message:e})=>e).join("\n"));return n}),function(e){return a.apply(this,arguments)})}]);let ek=(0,en.default)`
801
+ `,eI={query:"query",mutation:"mutate"},ek=H(function e(i,t,n,a,o){J(this,e),this.baseUrl=i,this.token=t,this.endpoint=n;var r=(0,ee.$)({uri:`${i}${n}`}),s=(0,en.o)((e,{headers:i})=>({headers:{...i,authorization:`Bearer ${t}`}}));this.apolloClient=new ei.R({link:s.concat(r),cache:new et.D,defaultOptions:{watchQuery:{errorPolicy:"all",fetchPolicy:"no-cache"},query:{errorPolicy:"all",fetchPolicy:"no-cache"}}}),this.fragments=c,this.queries=a,this.mutations=o,this.generateMethods()},[{key:"generateMethods",value:function(){var e=this,i=i=>([t,n])=>{if(this[t])throw Error(`Overwriting client.${t}`);this[t]=$(function*(a={},o={}){try{var r=e.apolloClient[eI[i]],s=yield r({[i]:n,variables:a,...o}),d=s.data,c=s.errors;if(n.needResetStore)try{yield e.apolloClient.resetStore()}catch(e){console.error(e)}if(c)throw Error(c.map(({message:e})=>e).join("\n"));return d[t]}catch(e){if(e.cause)if(e.cause.result?.errors)throw Error(e.cause.result.errors.map(({message:e})=>e).join("\n"));else console.error(e.cause);throw e}})};Object.entries(this.queries).forEach(i("query")),Object.entries(this.mutations).forEach(i("mutation"))}},{key:"query",value:(n=$(function*(e,i={}){var t=yield this.apolloClient.query({query:e,variables:i,fetchPolicy:"no-cache"}),n=t.data,a=t.errors,o=t.error,r=t.message;if(o&&r)throw Error(r);if(a&&a.length>0)throw Error(a.map(({message:e})=>e).join("\n"));return n}),function(e){return n.apply(this,arguments)})},{key:"mutate",value:(a=$(function*(e,i={}){var t=yield this.apolloClient.mutate({mutation:e,variables:i}),n=t.data,a=t.errors,o=t.error,r=t.message;if(o&&r)throw Error(r);if(a&&a.length>0)throw Error(a.map(({message:e})=>e).join("\n"));return n}),function(e){return a.apply(this,arguments)})}]);let eD=(0,ea.default)`
802
802
  query ControllerClient_me {
803
803
  me {
804
804
  _id
805
805
  id_from_user
806
806
  }
807
807
  }
808
- `,eD=(0,en.default)`
808
+ `,eA=(0,ea.default)`
809
809
  query ControllerClient_module($id: ID!) {
810
810
  module(id: $id) {
811
811
  ...moduleArguments
812
812
  }
813
813
  }
814
- ${ec}
815
- `,eA=(0,en.default)`
814
+ ${el}
815
+ `,eS=(0,ea.default)`
816
816
  query ControllerClient_modules($workspaceId: ID, $limit: Int) {
817
817
  modules(workspaceId: $workspaceId, paginate: { limit: $limit }) {
818
818
  ...moduleShortArguments
819
819
  }
820
820
  }
821
- ${el}
822
- `,eS=(0,en.default)`
821
+ ${ep}
822
+ `,ew=(0,ea.default)`
823
823
  query ControllerClient_publicModules($keyword: String!, $limit: Int) {
824
824
  publicModules(keyword: $keyword, paginate: { limit: $limit }) {
825
825
  ...moduleShortArguments
826
826
  }
827
827
  }
828
- ${el}
829
- `,ew=(0,en.default)`
828
+ ${ep}
829
+ `,eC=(0,ea.default)`
830
830
  query ControllerClient_publicModulesByIdList($idList: [ID]) {
831
831
  publicModulesByIdList(idList: $idList) {
832
832
  ...moduleShortArguments
833
833
  }
834
834
  }
835
- ${el}
836
- `,eC=(0,en.default)`
835
+ ${ep}
836
+ `,eT=(0,ea.default)`
837
837
  query ControllerClient_applicationReleaseVersions($id: ID!) {
838
838
  applicationReleaseVersions(id: $id) {
839
839
  ...instanceVersionArguments
840
840
  }
841
841
  }
842
- ${ep}
843
- `,eT=(0,en.default)`
842
+ ${eu}
843
+ `,ex=(0,ea.default)`
844
844
  query ControllerClient_applicationReleaseVersion($id: ID!, $versionId: ID!) {
845
845
  applicationReleaseVersion(id: $id, versionId: $versionId) {
846
846
  ...applicationReleaseVersionArguments
847
847
  }
848
848
  }
849
- ${ep}
850
- `,ex=(0,en.default)`
849
+ ${eu}
850
+ `,eB=(0,ea.default)`
851
851
  query ControllerClient_moduleReleaseVersions($id: ID!) {
852
852
  moduleReleaseVersions(id: $id) {
853
853
  ...instanceVersionArguments
854
854
  }
855
855
  }
856
- ${ep}
857
- `,eB=(0,en.default)`
856
+ ${eu}
857
+ `,eE=(0,ea.default)`
858
858
  query ControllerClient_moduleReleaseVersion($id: ID!, $versionId: ID!) {
859
859
  moduleReleaseVersion(id: $id, versionId: $versionId) {
860
860
  ...instanceVersionArguments
861
861
  }
862
862
  }
863
- ${ep}
864
- `,eE=(0,en.default)`
863
+ ${eu}
864
+ `,eU=(0,ea.default)`
865
865
  query ControllerClient_applicationByDevice(
866
866
  $deviceId: ID!
867
867
  $debug: Boolean
@@ -878,8 +878,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
878
878
  config_tests
879
879
  }
880
880
  }
881
- ${es}
882
- `,eU=(0,en.default)`
881
+ ${ed}
882
+ `,eM=(0,ea.default)`
883
883
  query ControllerClient_applicationTestsByDevice($deviceId: ID!) {
884
884
  applicationTestsByDevice: applicationByDevice(
885
885
  deviceId: $deviceId
@@ -892,18 +892,18 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
892
892
  config_tests
893
893
  }
894
894
  }
895
- `,eM=(0,en.default)`
895
+ `,eR=(0,ea.default)`
896
896
  query ControllerClient_checkBindDevicePasscode($passcode: String!) {
897
897
  checkBindDevicePasscode(passcode: $passcode)
898
898
  }
899
- `,eR=(0,en.default)`
899
+ `,eP=(0,ea.default)`
900
900
  query ControllerClient_devicesByUniqueId($uniqueID: String!, $unbindApplication: Boolean) {
901
901
  devicesByUniqueId(uniqueID: $uniqueID, unbindApplication: $unbindApplication) {
902
902
  ...deviceArguments
903
903
  }
904
904
  }
905
- ${eo}
906
- `,eP=(0,en.default)`
905
+ ${er}
906
+ `,eO=(0,ea.default)`
907
907
  query ControllerClient_devicesByGroup($id: ID!) {
908
908
  devicesByGroup(id: $id) {
909
909
  device {
@@ -954,46 +954,46 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
954
954
  target_name
955
955
  }
956
956
  }
957
- `,eO=(0,en.default)`
957
+ `,eF=(0,ea.default)`
958
958
  query ControllerClient_workspacePricingPlans {
959
959
  workspacePricingPlans
960
960
  }
961
- `;var eF=(0,en.default)`
961
+ `;var eN=(0,ea.default)`
962
962
  query User_workspace($id: ID!) {
963
963
  workspace(id: $id) {
964
964
  ...mcpWorkspaceArguments
965
965
  }
966
966
  }
967
- ${e_}
968
- `,eN=(0,en.default)`
967
+ ${eg}
968
+ `,eq=(0,ea.default)`
969
969
  query User_workspaces($paginate: Paginate) {
970
970
  workspaces(paginate: $paginate) {
971
971
  ...mcpWorkspaceShortArguments
972
972
  }
973
973
  }
974
- ${eg}
975
- `,eq=(0,en.default)`
974
+ ${ef}
975
+ `,eW=(0,ea.default)`
976
976
  query User_applications {
977
977
  applications {
978
978
  ...mcpApplicationShortArguments
979
979
  }
980
980
  }
981
- ${ef}
982
- `,eW=(0,en.default)`
981
+ ${ey}
982
+ `,ej=(0,ea.default)`
983
983
  query User_application($id: ID!) {
984
984
  application(id: $id) {
985
985
  ...applicationArguments
986
986
  }
987
987
  }
988
- ${es}
989
- `,ej=(0,en.default)`
988
+ ${ed}
989
+ `,eV=(0,ea.default)`
990
990
  query User_devices {
991
991
  devices {
992
992
  ...mcpDeviceShortArguments
993
993
  }
994
994
  }
995
- ${ey}
996
- `,eV=(0,en.default)`
995
+ ${e$}
996
+ `,eK=(0,ea.default)`
997
997
  query User_deviceUsage($deviceId: ID, $startDate: Date, $endDate: Date) {
998
998
  deviceUsage(deviceId: $deviceId, startDate: $startDate, endDate: $endDate) {
999
999
  _id
@@ -1012,14 +1012,14 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1012
1012
  }
1013
1013
  }
1014
1014
  }
1015
- `;let eK=e=>(e.needResetStore=!0,e),eY=eK((0,en.default)`
1015
+ `;let eY=e=>(e.needResetStore=!0,e),eG=eY((0,ea.default)`
1016
1016
  mutation ControllerClient_createWorkspace($name: String, $description: String) {
1017
1017
  createWorkspace(name: $name, description: $description) {
1018
1018
  ...workspaceArguments
1019
1019
  }
1020
1020
  }
1021
- ${ea}
1022
- `),eG=eK((0,en.default)`
1021
+ ${eo}
1022
+ `),eL=eY((0,ea.default)`
1023
1023
  mutation ControllerClient_updateWorkspace(
1024
1024
  $id: ID!
1025
1025
  $name: String
@@ -1047,8 +1047,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1047
1047
  ...workspaceArguments
1048
1048
  }
1049
1049
  }
1050
- ${ea}
1051
- `),eL=eK((0,en.default)`
1050
+ ${eo}
1051
+ `),ez=eY((0,ea.default)`
1052
1052
  mutation ControllerClient_updateWorkspaceTokens(
1053
1053
  $id: ID!
1054
1054
  $tokens: [WorkspaceTokenInput]
@@ -1064,8 +1064,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1064
1064
  }
1065
1065
  }
1066
1066
  }
1067
- ${ea}
1068
- `),ez=eK((0,en.default)`
1067
+ ${eo}
1068
+ `),eH=eY((0,ea.default)`
1069
1069
  mutation ControllerClient_createDevice(
1070
1070
  $workspaceId: ID
1071
1071
  $name: String
@@ -1087,8 +1087,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1087
1087
  ...deviceArguments
1088
1088
  }
1089
1089
  }
1090
- ${eo}
1091
- `),eH=eK((0,en.default)`
1090
+ ${er}
1091
+ `),eJ=eY((0,ea.default)`
1092
1092
  mutation ControllerClient_createVirtualDevice(
1093
1093
  $workspaceId: ID
1094
1094
  $name: String
@@ -1104,8 +1104,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1104
1104
  ...deviceArguments
1105
1105
  }
1106
1106
  }
1107
- ${eo}
1108
- `),eJ=eK((0,en.default)`
1107
+ ${er}
1108
+ `),eX=eY((0,ea.default)`
1109
1109
  mutation ControllerClient_updateDevice(
1110
1110
  $id: ID!
1111
1111
  $name: String
@@ -1143,8 +1143,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1143
1143
  ...deviceArguments
1144
1144
  }
1145
1145
  }
1146
- ${eo}
1147
- `),eX=eK((0,en.default)`
1146
+ ${er}
1147
+ `),eQ=eY((0,ea.default)`
1148
1148
  mutation ControllerClient_moveDevice(
1149
1149
  $id: ID!
1150
1150
  $workspaceId: ID!
@@ -1162,8 +1162,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1162
1162
  ...deviceArguments
1163
1163
  }
1164
1164
  }
1165
- ${eo}
1166
- `),eQ=eK((0,en.default)`
1165
+ ${er}
1166
+ `),eZ=eY((0,ea.default)`
1167
1167
  mutation ControllerClient_updateVirtualDevice(
1168
1168
  $id: ID!
1169
1169
  $tokens: [DeviceTokenInput]
@@ -1179,19 +1179,19 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1179
1179
  }
1180
1180
  }
1181
1181
  }
1182
- ${eo}
1183
- `),eZ=eK((0,en.default)`
1182
+ ${er}
1183
+ `),e0=eY((0,ea.default)`
1184
1184
  mutation ControllerClient_removeDevice($id: ID!) {
1185
1185
  removeDevice(id: $id)
1186
1186
  }
1187
- `),e0=eK((0,en.default)`
1187
+ `),e1=eY((0,ea.default)`
1188
1188
  mutation ControllerClient_controlDevice($id: ID!, $type: String!, $eventPayload: JSON) {
1189
1189
  controlDevice(id: $id, type: $type, eventPayload: $eventPayload) {
1190
1190
  ...deviceArguments
1191
1191
  }
1192
1192
  }
1193
- ${eo}
1194
- `),e1=eK((0,en.default)`
1193
+ ${er}
1194
+ `),e4=eY((0,ea.default)`
1195
1195
  mutation ControllerClient_createDeviceGroup(
1196
1196
  $workspaceId: ID!
1197
1197
  $name: String!
@@ -1201,8 +1201,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1201
1201
  ...deviceGroupArguments
1202
1202
  }
1203
1203
  }
1204
- ${er}
1205
- `),e4=eK((0,en.default)`
1204
+ ${es}
1205
+ `),e6=eY((0,ea.default)`
1206
1206
  mutation ControllerClient_updateDeviceGroup(
1207
1207
  $id: ID!
1208
1208
  $name: String
@@ -1226,23 +1226,23 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1226
1226
  ...deviceGroupArguments
1227
1227
  }
1228
1228
  }
1229
- ${er}
1230
- `),e6=eK((0,en.default)`
1229
+ ${es}
1230
+ `),e5=eY((0,ea.default)`
1231
1231
  mutation ControllerClient_dispatchDeviceGroupAction($id: ID!, $action: String!) {
1232
1232
  dispatchDeviceGroupAction(id: $id, action: $action) {
1233
1233
  devices
1234
1234
  dispatched
1235
1235
  }
1236
1236
  }
1237
- `),e5=eK((0,en.default)`
1237
+ `),e2=eY((0,ea.default)`
1238
1238
  mutation ControllerClient_removeDeviceGroup($id: ID!) {
1239
1239
  removeDeviceGroup(id: $id)
1240
1240
  }
1241
- `),e2=eK((0,en.default)`
1241
+ `),e9=eY((0,ea.default)`
1242
1242
  mutation ControllerClient_removeWorkspace($id: ID!) {
1243
1243
  removeWorkspace(id: $id)
1244
1244
  }
1245
- `),e9=eK((0,en.default)`
1245
+ `),e3=eY((0,ea.default)`
1246
1246
  mutation ControllerClient_createApplication(
1247
1247
  $workspaceId: ID
1248
1248
  $name: String
@@ -1262,8 +1262,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1262
1262
  ...applicationArguments
1263
1263
  }
1264
1264
  }
1265
- ${es}
1266
- `),e3=eK((0,en.default)`
1265
+ ${ed}
1266
+ `),e8=eY((0,ea.default)`
1267
1267
  mutation ControllerClient_createApplicationWithShareVersion(
1268
1268
  $workspaceId: ID
1269
1269
  $name: String
@@ -1279,8 +1279,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1279
1279
  ...applicationArguments
1280
1280
  }
1281
1281
  }
1282
- ${es}
1283
- `),e8=eK((0,en.default)`
1282
+ ${ed}
1283
+ `),e7=eY((0,ea.default)`
1284
1284
  mutation ControllerClient_updateApplication(
1285
1285
  $id: ID!
1286
1286
  $name: String
@@ -1324,8 +1324,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1324
1324
  ...applicationArguments
1325
1325
  }
1326
1326
  }
1327
- ${es}
1328
- `),e7=eK((0,en.default)`
1327
+ ${ed}
1328
+ `),ie=eY((0,ea.default)`
1329
1329
  mutation ControllerClient_bindApplication(
1330
1330
  $id: ID!
1331
1331
  $devices: [ID]
@@ -1347,12 +1347,12 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1347
1347
  ...applicationArguments
1348
1348
  }
1349
1349
  }
1350
- ${es}
1351
- `),ie=eK((0,en.default)`
1350
+ ${ed}
1351
+ `),ii=eY((0,ea.default)`
1352
1352
  mutation ControllerClient_toggleShortEditApplication($id: ID!, $enabled: Boolean!) {
1353
1353
  toggleShortEditApplication(id: $id, enabled: $enabled)
1354
1354
  }
1355
- `),ii=eK((0,en.default)`
1355
+ `),it=eY((0,ea.default)`
1356
1356
  mutation ControllerClient_updateApplicationViewportPreset(
1357
1357
  $id: ID!
1358
1358
  $newViewportPresets: [ApplicationViewportPresetInput]
@@ -1368,8 +1368,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1368
1368
  ...applicationArguments
1369
1369
  }
1370
1370
  }
1371
- ${es}
1372
- `),it=eK((0,en.default)`
1371
+ ${ed}
1372
+ `),ia=eY((0,ea.default)`
1373
1373
  mutation ControllerClient_bindApplicationWithDeviceGroup(
1374
1374
  $id: ID!
1375
1375
  $bindDeviceGroup: ApplicationBindDeviceGroupInput
@@ -1385,8 +1385,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1385
1385
  ...applicationArguments
1386
1386
  }
1387
1387
  }
1388
- ${es}
1389
- `),ia=eK((0,en.default)`
1388
+ ${ed}
1389
+ `),io=eY((0,ea.default)`
1390
1390
  mutation ControllerClient_shareApplication(
1391
1391
  $id: ID!
1392
1392
  $shareSetting: ApplicationShareSettingInput
@@ -1406,15 +1406,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1406
1406
  ...applicationArguments
1407
1407
  }
1408
1408
  }
1409
- ${es}
1410
- `),io=eK((0,en.default)`
1409
+ ${ed}
1410
+ `),ir=eY((0,ea.default)`
1411
1411
  mutation ControllerClient_moveApplication($id: ID!, $workspaceId: ID!) {
1412
1412
  moveApplication(id: $id, workspaceId: $workspaceId) {
1413
1413
  ...applicationArguments
1414
1414
  }
1415
1415
  }
1416
- ${es}
1417
- `),ir=eK((0,en.default)`
1416
+ ${ed}
1417
+ `),is=eY((0,ea.default)`
1418
1418
  mutation ControllerClient_createDeviceGroupWithApp(
1419
1419
  $applicationId: ID!
1420
1420
  $name: String!
@@ -1439,15 +1439,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1439
1439
  }
1440
1440
  }
1441
1441
  }
1442
- ${es}
1443
- `),is=eK((0,en.default)`
1442
+ ${ed}
1443
+ `),id=eY((0,ea.default)`
1444
1444
  mutation ControllerClient_forkApplication($id: ID!) {
1445
1445
  forkApplication(id: $id) {
1446
1446
  ...applicationArguments
1447
1447
  }
1448
1448
  }
1449
- ${es}
1450
- `),id=eK((0,en.default)`
1449
+ ${ed}
1450
+ `),ic=eY((0,ea.default)`
1451
1451
  mutation ControllerClient_duplicateApplication(
1452
1452
  $id: ID!
1453
1453
  $includeVersions: Boolean
@@ -1461,12 +1461,12 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1461
1461
  ...applicationArguments
1462
1462
  }
1463
1463
  }
1464
- ${es}
1465
- `),ic=eK((0,en.default)`
1464
+ ${ed}
1465
+ `),il=eY((0,ea.default)`
1466
1466
  mutation ControllerClient_removeApplication($id: ID!) {
1467
1467
  removeApplication(id: $id)
1468
1468
  }
1469
- `),il=eK((0,en.default)`
1469
+ `),ip=eY((0,ea.default)`
1470
1470
  mutation ControllerClient_createModule(
1471
1471
  $workspaceId: ID
1472
1472
  $name: String
@@ -1492,8 +1492,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1492
1492
  ...moduleArguments
1493
1493
  }
1494
1494
  }
1495
- ${ec}
1496
- `),ip=eK((0,en.default)`
1495
+ ${el}
1496
+ `),iu=eY((0,ea.default)`
1497
1497
  mutation ControllerClient_updateModule(
1498
1498
  $id: ID!
1499
1499
  $name: String
@@ -1523,26 +1523,26 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1523
1523
  ...moduleArguments
1524
1524
  }
1525
1525
  }
1526
- ${ec}
1527
- `),iu=eK((0,en.default)`
1526
+ ${el}
1527
+ `),im=eY((0,ea.default)`
1528
1528
  mutation ControllerClient_moveModule($id: ID!, $workspaceId: ID!) {
1529
1529
  moveModule(id: $id, workspaceId: $workspaceId) {
1530
1530
  ...moduleArguments
1531
1531
  }
1532
1532
  }
1533
- ${ec}
1534
- `),im=eK((0,en.default)`
1533
+ ${el}
1534
+ `),i_=eY((0,ea.default)`
1535
1535
  mutation ControllerClient_duplicateModule($id: ID!) {
1536
1536
  duplicateModule(id: $id) {
1537
1537
  ...moduleArguments
1538
1538
  }
1539
1539
  }
1540
- ${ec}
1541
- `),i_=eK((0,en.default)`
1540
+ ${el}
1541
+ `),ig=eY((0,ea.default)`
1542
1542
  mutation ControllerClient_removeModule($id: ID!) {
1543
1543
  removeModule(id: $id)
1544
1544
  }
1545
- `),ig=eK((0,en.default)`
1545
+ `),iy=eY((0,ea.default)`
1546
1546
  mutation ControllerClient_createConfigChangeOperation(
1547
1547
  $applicationId: ID!
1548
1548
  $config: JSON!
@@ -1552,12 +1552,12 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1552
1552
  ...operationArguments
1553
1553
  }
1554
1554
  }
1555
- ${eu}
1556
- `),iy=eK((0,en.default)`
1555
+ ${em}
1556
+ `),i$=eY((0,ea.default)`
1557
1557
  mutation ControllerClient_doOperation($id: ID!, $applicationId: ID!) {
1558
1558
  doOperation(id: $id, applicationId: $applicationId)
1559
1559
  }
1560
- `),i$=eK((0,en.default)`
1560
+ `),iv=eY((0,ea.default)`
1561
1561
  mutation ControllerClient_updateOperation(
1562
1562
  $id: ID!
1563
1563
  $applicationId: ID!
@@ -1568,12 +1568,12 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1568
1568
  ...operationArguments
1569
1569
  }
1570
1570
  }
1571
- ${eu}
1572
- `),iv=eK((0,en.default)`
1571
+ ${em}
1572
+ `),ih=eY((0,ea.default)`
1573
1573
  mutation ControllerClient_removeOperation($id: ID!, $applicationId: ID!) {
1574
1574
  removeOperation(id: $id, applicationId: $applicationId)
1575
1575
  }
1576
- `),ih=eK((0,en.default)`
1576
+ `),ib=eY((0,ea.default)`
1577
1577
  mutation ControllerClient_assignGroupPermissions(
1578
1578
  $roleId: String!
1579
1579
  $instanceType: String!
@@ -1587,18 +1587,18 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1587
1587
  permissions: $permissions
1588
1588
  )
1589
1589
  }
1590
- `),ib=(0,en.default)`
1590
+ `),iI=(0,ea.default)`
1591
1591
  mutation ControllerClient_registerFCMNotification($workspaceId: ID!, $token: String!) {
1592
1592
  registerFCMNotification(workspaceId: $workspaceId, token: $token)
1593
1593
  }
1594
- `,iI=(0,en.default)`
1594
+ `,ik=(0,ea.default)`
1595
1595
  mutation ControllerClient_registerRemoteDebug($deviceId: ID!) {
1596
1596
  registerRemoteDebug(deviceId: $deviceId) {
1597
1597
  deviceId
1598
1598
  token
1599
1599
  }
1600
1600
  }
1601
- `,ik=(0,en.default)`
1601
+ `,iD=(0,ea.default)`
1602
1602
  mutation ControllerClient_shareAccessToken(
1603
1603
  $workspaceId: ID
1604
1604
  $passcode: String!
@@ -1606,7 +1606,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1606
1606
  ) {
1607
1607
  shareAccessToken(workspaceId: $workspaceId, passcode: $passcode, refreshToken: $refreshToken)
1608
1608
  }
1609
- `,iD=eK((0,en.default)`
1609
+ `,iA=eY((0,ea.default)`
1610
1610
  mutation ControllerClient_addUserFavorite($instanceType: InstanceType!, $instanceId: ID!) {
1611
1611
  addUserFavorite(instanceType: $instanceType, instanceId: $instanceId) {
1612
1612
  _id
@@ -1619,11 +1619,11 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1619
1619
  last_modify_datetime
1620
1620
  }
1621
1621
  }
1622
- `),iA=eK((0,en.default)`
1622
+ `),iS=eY((0,ea.default)`
1623
1623
  mutation ControllerClient_removeUserFavorite($instanceType: InstanceType!, $instanceId: ID!) {
1624
1624
  removeUserFavorite(instanceType: $instanceType, instanceId: $instanceId)
1625
1625
  }
1626
- `),iS=eK((0,en.default)`
1626
+ `),iw=eY((0,ea.default)`
1627
1627
  mutation ControllerClient_changeWorkspaceSubscriptionPlan(
1628
1628
  $workspaceId: ID!
1629
1629
  $type: String!
@@ -1631,7 +1631,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1631
1631
  ) {
1632
1632
  changeWorkspaceSubscriptionPlan(workspaceId: $workspaceId, type: $type, period: $period)
1633
1633
  }
1634
- `),iw=eK((0,en.default)`
1634
+ `),iC=eY((0,ea.default)`
1635
1635
  mutation ControllerClient_changeWorkspaceAdditionalLimitSpending(
1636
1636
  $workspaceId: ID!
1637
1637
  $boundDevicesLimit: Float
@@ -1643,7 +1643,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1643
1643
  groupMembersLimit: $groupMembersLimit
1644
1644
  )
1645
1645
  }
1646
- `),iC=(0,en.default)`
1646
+ `),iT=(0,ea.default)`
1647
1647
  mutation ControllerClient_createWorkspaceOTP(
1648
1648
  $workspaceId: ID!
1649
1649
  $tokenTypes: [WorkspaceTokenType]!
@@ -1655,32 +1655,32 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1655
1655
  expired_datetime
1656
1656
  }
1657
1657
  }
1658
- `,iT=(0,en.default)`
1658
+ `,ix=(0,ea.default)`
1659
1659
  mutation ControllerClient_revokeWorkspaceOTP($id: ID!) {
1660
1660
  revokeWorkspaceOTP(id: $id)
1661
1661
  }
1662
- `;function ix(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ix=function(){return!!e})()}var iB=function(e){function i(e,t){var n,a,o;return H(this,i),a=i,o=[e,t,"/api/graphql",l,p],a=X(a),(n=J(this,ix()?Reflect.construct(a,o||[],X(this).constructor):a.apply(this,o))).tokenType="user",n}return Q(i,e),z(i)}(eI),iE=(0,en.default)`
1662
+ `;function iB(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(iB=function(){return!!e})()}var iE=function(e){function i(e,t){var n,a,o;return J(this,i),a=i,o=[e,t,"/api/graphql",l,p],a=Q(a),(n=X(this,iB()?Reflect.construct(a,o||[],Q(this).constructor):a.apply(this,o))).tokenType="user",n}return Z(i,e),H(i)}(ek),iU=(0,ea.default)`
1663
1663
  query Workspace_workspace {
1664
1664
  workspace {
1665
1665
  ...mcpWorkspaceArguments
1666
1666
  }
1667
1667
  }
1668
- ${e_}
1669
- `,iU=(0,en.default)`
1668
+ ${eg}
1669
+ `,iM=(0,ea.default)`
1670
1670
  query Workspace_applications($keyword: String, $paginate: Paginate) {
1671
1671
  applications(keyword: $keyword, paginate: $paginate) {
1672
1672
  ...mcpApplicationShortArguments
1673
1673
  }
1674
1674
  }
1675
- ${ef}
1676
- `,iM=(0,en.default)`
1675
+ ${ey}
1676
+ `,iR=(0,ea.default)`
1677
1677
  query Workspace_application($id: ID!, $composed: Boolean, $debug: Boolean) {
1678
1678
  application(id: $id, composed: $composed, debug: $debug) {
1679
1679
  ...applicationArguments
1680
1680
  }
1681
1681
  }
1682
- ${es}
1683
- `,iR=(0,en.default)`
1682
+ ${ed}
1683
+ `,iP=(0,ea.default)`
1684
1684
  query Workspace_applicationByDevice(
1685
1685
  $deviceId: ID!
1686
1686
  $composeModule: Boolean
@@ -1696,43 +1696,43 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1696
1696
  ...applicationArguments
1697
1697
  }
1698
1698
  }
1699
- ${es}
1700
- `,iP=(0,en.default)`
1699
+ ${ed}
1700
+ `,iO=(0,ea.default)`
1701
1701
  query Workspace_modules($keyword: String, $paginate: Paginate) {
1702
1702
  modules(keyword: $keyword, paginate: $paginate) {
1703
1703
  ...moduleShortArguments
1704
1704
  }
1705
1705
  }
1706
- ${el}
1707
- `,iO=(0,en.default)`
1706
+ ${ep}
1707
+ `,iF=(0,ea.default)`
1708
1708
  query Workspace_module($id: ID!) {
1709
1709
  module(id: $id) {
1710
1710
  ...moduleArguments
1711
1711
  }
1712
1712
  }
1713
- ${ec}
1714
- `,iF=(0,en.default)`
1713
+ ${el}
1714
+ `,iN=(0,ea.default)`
1715
1715
  query Workspace_devices($keyword: String, $paginate: Paginate) {
1716
1716
  devices(keyword: $keyword, paginate: $paginate) {
1717
1717
  ...deviceArguments
1718
1718
  }
1719
1719
  }
1720
- ${eo}
1721
- `,iN=(0,en.default)`
1720
+ ${er}
1721
+ `,iq=(0,ea.default)`
1722
1722
  query Workspace_device($id: ID) {
1723
1723
  device(id: $id) {
1724
1724
  ...deviceArguments
1725
1725
  }
1726
1726
  }
1727
- ${eo}
1728
- `,iq=(0,en.default)`
1727
+ ${er}
1728
+ `,iW=(0,ea.default)`
1729
1729
  query Workspace_devicesByApplication($id: ID!) {
1730
1730
  devicesByApplication(id: $id) {
1731
1731
  ...deviceArguments
1732
1732
  }
1733
1733
  }
1734
- ${eo}
1735
- `,iW=(0,en.default)`
1734
+ ${er}
1735
+ `,ij=(0,ea.default)`
1736
1736
  query Workspace_deviceUsage($deviceId: ID, $startDate: Date, $endDate: Date) {
1737
1737
  deviceUsage(deviceId: $deviceId, startDate: $startDate, endDate: $endDate) {
1738
1738
  _id
@@ -1751,28 +1751,28 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1751
1751
  }
1752
1752
  }
1753
1753
  }
1754
- `,ij=(0,en.default)`
1754
+ `,iV=(0,ea.default)`
1755
1755
  query Workspace_mediaWorkspace {
1756
1756
  mediaWorkspace {
1757
1757
  ...workspaceMediaWorkspaceArguments
1758
1758
  }
1759
1759
  }
1760
- ${e$}
1761
- `,iV=(0,en.default)`
1760
+ ${ev}
1761
+ `,iK=(0,ea.default)`
1762
1762
  query Workspace_mediaBoxes {
1763
1763
  mediaBoxes {
1764
1764
  ...workspaceMediaBoxArguments
1765
1765
  }
1766
1766
  }
1767
- ${ev}
1768
- `,iK=(0,en.default)`
1767
+ ${eh}
1768
+ `,iY=(0,ea.default)`
1769
1769
  query Workspace_mediaBox($boxId: ID!) {
1770
1770
  mediaBox(id: $boxId) {
1771
1771
  ...workspaceMediaBoxArguments
1772
1772
  }
1773
1773
  }
1774
- ${ev}
1775
- `,iY=(0,en.default)`
1774
+ ${eh}
1775
+ `,iG=(0,ea.default)`
1776
1776
  query Workspace_mediaFiles(
1777
1777
  $boxId: ID!
1778
1778
  $includeTypes: [String]
@@ -1790,15 +1790,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1790
1790
  ...workspaceMediaFileArguments
1791
1791
  }
1792
1792
  }
1793
- ${eh}
1794
- `,iG=(0,en.default)`
1793
+ ${eb}
1794
+ `,iL=(0,ea.default)`
1795
1795
  query Workspace_mediaFile($id: ID!) {
1796
1796
  mediaFile(id: $id) {
1797
1797
  ...workspaceMediaFileArguments
1798
1798
  }
1799
1799
  }
1800
- ${eh}
1801
- `,iL=(0,en.default)`
1800
+ ${eb}
1801
+ `,iz=(0,ea.default)`
1802
1802
  mutation Workspace_createApplication(
1803
1803
  $name: String
1804
1804
  $description: String
@@ -1815,8 +1815,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1815
1815
  config
1816
1816
  }
1817
1817
  }
1818
- ${ef}
1819
- `,iz=(0,en.default)`
1818
+ ${ey}
1819
+ `,iH=(0,ea.default)`
1820
1820
  mutation Workspace_updateApplication(
1821
1821
  $id: ID!
1822
1822
  $config: String
@@ -1836,8 +1836,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1836
1836
  has_unreleased_changes
1837
1837
  }
1838
1838
  }
1839
- ${ef}
1840
- `,iH=(0,en.default)`
1839
+ ${ey}
1840
+ `,iJ=(0,ea.default)`
1841
1841
  mutation Workspace_bindApplication($id: ID!, $bindDevices: [ID], $deviceFrames: JSON) {
1842
1842
  bindApplication(id: $id, bindDevices: $bindDevices, deviceFrames: $deviceFrames) {
1843
1843
  _id
@@ -1848,7 +1848,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1848
1848
  }
1849
1849
  }
1850
1850
  }
1851
- `,iJ=(0,en.default)`
1851
+ `,iX=(0,ea.default)`
1852
1852
  mutation Workspace_unbindApplication($id: ID!, $unbindDevices: [ID]) {
1853
1853
  bindApplication(id: $id, unbindDevices: $unbindDevices) {
1854
1854
  _id
@@ -1859,7 +1859,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1859
1859
  }
1860
1860
  }
1861
1861
  }
1862
- `,iX=(0,en.default)`
1862
+ `,iQ=(0,ea.default)`
1863
1863
  mutation Workspace_createModule(
1864
1864
  $name: String
1865
1865
  $description: String
@@ -1881,8 +1881,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1881
1881
  ...moduleArguments
1882
1882
  }
1883
1883
  }
1884
- ${ec}
1885
- `,iQ=(0,en.default)`
1884
+ ${el}
1885
+ `,iZ=(0,ea.default)`
1886
1886
  mutation Workspace_updateModule(
1887
1887
  $id: ID!
1888
1888
  $config: String
@@ -1900,8 +1900,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1900
1900
  ...moduleArguments
1901
1901
  }
1902
1902
  }
1903
- ${ec}
1904
- `,iZ=(0,en.default)`
1903
+ ${el}
1904
+ `,i0=(0,ea.default)`
1905
1905
  mutation Workspace_createMediaFileUploadRequest(
1906
1906
  $name: String!
1907
1907
  $description: String!
@@ -1932,7 +1932,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1932
1932
  }
1933
1933
  }
1934
1934
  }
1935
- `,i0=(0,en.default)`
1935
+ `,i1=(0,ea.default)`
1936
1936
  mutation Workspace_updateMediaFile(
1937
1937
  $id: ID!
1938
1938
  $name: String
@@ -1954,7 +1954,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1954
1954
  updatedAt
1955
1955
  }
1956
1956
  }
1957
- `,i1=(0,en.default)`
1957
+ `,i4=(0,ea.default)`
1958
1958
  mutation Workspace_updateMediaFiles(
1959
1959
  $fileIds: [ID!]!
1960
1960
  $name: String
@@ -1963,23 +1963,23 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1963
1963
  ) {
1964
1964
  updateMediaFiles(fileIds: $fileIds, name: $name, description: $description, userTags: $userTags)
1965
1965
  }
1966
- `,i4=(0,en.default)`
1966
+ `,i6=(0,ea.default)`
1967
1967
  mutation Workspace_setMediaFileAsBoxPreview($id: ID!) {
1968
1968
  setMediaFileAsBoxPreview(id: $id)
1969
1969
  }
1970
- `,i6=(0,en.default)`
1970
+ `,i5=(0,ea.default)`
1971
1971
  mutation Workspace_copyMediaFiles($fromBoxId: ID!, $toBoxId: ID!, $fileIds: [ID!]!) {
1972
1972
  copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, fileIds: $fileIds)
1973
1973
  }
1974
- `,i5=(0,en.default)`
1974
+ `,i2=(0,ea.default)`
1975
1975
  mutation Workspace_deleteMediaFiles($boxId: ID!, $fileIds: [ID!]!) {
1976
1976
  deleteMediaFiles(boxId: $boxId, fileIds: $fileIds)
1977
1977
  }
1978
- `,i2=(0,en.default)`
1978
+ `,i9=(0,ea.default)`
1979
1979
  mutation Workspace_deleteMediaBoxFiles($boxId: ID!, $includeTypes: [String]) {
1980
1980
  deleteMediaBoxFiles(boxId: $boxId, includeTypes: $includeTypes)
1981
1981
  }
1982
- `;function i9(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i9=function(){return!!e})()}var i3=function(e){function i(e,t){var n,a,o;return H(this,i),a=i,o=[e,t,"/api/graphql-workspace",u,m],a=X(a),(n=J(this,i9()?Reflect.construct(a,o||[],X(this).constructor):a.apply(this,o))).tokenType="workspace",n}return Q(i,e),z(i)}(eI),i8=t(19074),i7=t(36054),te=t(78342),ti=t(74114),tt=t(42028),tn=t(99815),ta=t(79556),to=t(17681),tr=t.n(to),ts=t(10655);let td=(0,en.default)`
1982
+ `;function i3(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(i3=function(){return!!e})()}var i8=function(e){function i(e,t){var n,a,o;return J(this,i),a=i,o=[e,t,"/api/graphql-workspace",u,m],a=Q(a),(n=X(this,i3()?Reflect.construct(a,o||[],Q(this).constructor):a.apply(this,o))).tokenType="workspace",n}return Z(i,e),H(i)}(ek),i7=t(19074),te=t(36054),ti=t(78342),tt=t(74114),tn=t(42028),ta=t(99815),to=t(79556),tr=t(17681),ts=t.n(tr),td=t(10655);let tc=(0,ea.default)`
1983
1983
  fragment mediaWorkspaceArguments on MediaWorkspace {
1984
1984
  __typename
1985
1985
  id
@@ -1993,7 +1993,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
1993
1993
  sizeLimit
1994
1994
  aiFeaturesEnabled
1995
1995
  }
1996
- `,tc=(0,en.default)`
1996
+ `,tl=(0,ea.default)`
1997
1997
  fragment boxArguments on MediaBox {
1998
1998
  __typename
1999
1999
  id
@@ -2018,7 +2018,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2018
2018
  previewUrl
2019
2019
  size
2020
2020
  }
2021
- `,tl=(0,en.default)`
2021
+ `,tp=(0,ea.default)`
2022
2022
  fragment fileArguments on MediaFile {
2023
2023
  __typename
2024
2024
  id
@@ -2075,7 +2075,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2075
2075
  createdAt
2076
2076
  updatedAt
2077
2077
  }
2078
- `,tp=(0,en.default)`
2078
+ `,tu=(0,ea.default)`
2079
2079
  fragment fileShortArguments on MediaFile {
2080
2080
  __typename
2081
2081
  id
@@ -2123,35 +2123,35 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2123
2123
  createdAt
2124
2124
  updatedAt
2125
2125
  }
2126
- `,tu=(0,en.default)`
2126
+ `,tm=(0,ea.default)`
2127
2127
  query MediaClient_workspaces {
2128
2128
  mediaWorkspaces {
2129
2129
  ...mediaWorkspaceArguments
2130
2130
  }
2131
2131
  }
2132
- ${td}
2133
- `,tm=(0,en.default)`
2132
+ ${tc}
2133
+ `,t_=(0,ea.default)`
2134
2134
  query MediaClient_boxes($workspaceId: UUID, $filter: String) {
2135
2135
  mediaBoxes(workspaceId: $workspaceId, filter: $filter) {
2136
2136
  ...boxArguments
2137
2137
  }
2138
2138
  }
2139
- ${tc}
2140
- `,t_=(0,en.default)`
2139
+ ${tl}
2140
+ `,tg=(0,ea.default)`
2141
2141
  query MediaClient_workspace($workspaceId: UUID!) {
2142
2142
  mediaWorkspace(id: $workspaceId) {
2143
2143
  ...mediaWorkspaceArguments
2144
2144
  }
2145
2145
  }
2146
- ${td}
2147
- `,tg=(0,en.default)`
2146
+ ${tc}
2147
+ `,tf=(0,ea.default)`
2148
2148
  query MediaClient_box($boxId: UUID!) {
2149
2149
  mediaBox(boxId: $boxId) {
2150
2150
  ...boxArguments
2151
2151
  }
2152
2152
  }
2153
- ${tc}
2154
- `,tf=(0,en.default)`
2153
+ ${tl}
2154
+ `,ty=(0,ea.default)`
2155
2155
  query MediaClient_files(
2156
2156
  $boxId: UUID!
2157
2157
  $includeTypes: [FileType!]
@@ -2169,29 +2169,29 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2169
2169
  ...fileShortArguments
2170
2170
  }
2171
2171
  }
2172
- ${tp}
2173
- `,ty=(0,en.default)`
2172
+ ${tu}
2173
+ `,t$=(0,ea.default)`
2174
2174
  query MediaClient_file($fileId: UUID!) {
2175
2175
  mediaFile(fileId: $fileId) {
2176
2176
  ...fileArguments
2177
2177
  }
2178
2178
  }
2179
- ${tl}
2180
- `,t$=(0,en.default)`
2179
+ ${tp}
2180
+ `,tv=(0,ea.default)`
2181
2181
  mutation MediaClient_createMediaWorkspace($name: String!, $description: String!) {
2182
2182
  createMediaWorkspace(name: $name, description: $description) {
2183
2183
  ...mediaWorkspaceArguments
2184
2184
  }
2185
2185
  }
2186
- ${td}
2187
- `,tv=(0,en.default)`
2186
+ ${tc}
2187
+ `,th=(0,ea.default)`
2188
2188
  mutation MediaClient_updateMediaWorkspace($id: UUID!, $name: String, $description: String) {
2189
2189
  updateMediaWorkspace(id: $id, name: $name, description: $description) {
2190
2190
  ...mediaWorkspaceArguments
2191
2191
  }
2192
2192
  }
2193
- ${td}
2194
- `,th=(0,en.default)`
2193
+ ${tc}
2194
+ `,tb=(0,ea.default)`
2195
2195
  mutation MediaClient_createMediaBox(
2196
2196
  $name: String!
2197
2197
  $description: String!
@@ -2209,15 +2209,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2209
2209
  ...boxArguments
2210
2210
  }
2211
2211
  }
2212
- ${tc}
2213
- `,tb=(0,en.default)`
2212
+ ${tl}
2213
+ `,tI=(0,ea.default)`
2214
2214
  mutation MediaClient_moveMediaBox($id: UUID!, $workspaceId: UUID) {
2215
2215
  moveMediaBox(id: $id, workspaceId: $workspaceId) {
2216
2216
  ...boxArguments
2217
2217
  }
2218
2218
  }
2219
- ${tc}
2220
- `,tI=(0,en.default)`
2219
+ ${tl}
2220
+ `,tk=(0,ea.default)`
2221
2221
  mutation MediaClient_updateMediaBox(
2222
2222
  $id: UUID!
2223
2223
  $name: String
@@ -2237,8 +2237,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2237
2237
  ...boxArguments
2238
2238
  }
2239
2239
  }
2240
- ${tc}
2241
- `,tk=(0,en.default)`
2240
+ ${tl}
2241
+ `,tD=(0,ea.default)`
2242
2242
  mutation MediaClient_requestFileUpload(
2243
2243
  $name: String!
2244
2244
  $description: String!
@@ -2260,8 +2260,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2260
2260
  ...fileArguments
2261
2261
  }
2262
2262
  }
2263
- ${tl}
2264
- `,tD=(0,en.default)`
2263
+ ${tp}
2264
+ `,tA=(0,ea.default)`
2265
2265
  mutation MediaClient_updateMediaFile(
2266
2266
  $fileId: UUID!
2267
2267
  $name: String!
@@ -2279,8 +2279,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2279
2279
  ...fileArguments
2280
2280
  }
2281
2281
  }
2282
- ${tl}
2283
- `,tA=(0,en.default)`
2282
+ ${tp}
2283
+ `,tS=(0,ea.default)`
2284
2284
  mutation MediaClient_updateMediaFiles(
2285
2285
  $fileIds: [UUID!]!
2286
2286
  $name: String
@@ -2289,19 +2289,19 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2289
2289
  ) {
2290
2290
  updateMediaFiles(fileIds: $fileIds, name: $name, description: $description, userTags: $userTags)
2291
2291
  }
2292
- `,tS=(0,en.default)`
2292
+ `,tw=(0,ea.default)`
2293
2293
  mutation MediaClient_deleteMediaFiles($boxId: UUID!, $list: [UUID!]!) {
2294
2294
  deleteMediaFiles(boxId: $boxId, list: $list)
2295
2295
  }
2296
- `,tw=(0,en.default)`
2296
+ `,tC=(0,ea.default)`
2297
2297
  mutation MediaClient_copyMediaFiles($fromBoxId: UUID!, $toBoxId: UUID!, $list: [UUID!]!) {
2298
2298
  copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, list: $list)
2299
2299
  }
2300
- `,tC=(0,en.default)`
2300
+ `,tT=(0,ea.default)`
2301
2301
  mutation MediaClient_setMediaFileAsBoxPreview($id: UUID!) {
2302
2302
  setMediaFileAsBoxPreview(id: $id)
2303
2303
  }
2304
- `,tT=(0,en.default)`
2304
+ `,tx=(0,ea.default)`
2305
2305
  mutation MediaClient_assignGroupPermissions(
2306
2306
  $roleId: String!
2307
2307
  $instanceType: InstanceType!
@@ -2315,7 +2315,7 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2315
2315
  permissions: $permissions
2316
2316
  )
2317
2317
  }
2318
- `,tx=(0,en.default)`
2318
+ `,tB=(0,ea.default)`
2319
2319
  subscription MediaClient_listenBoxChanged($boxId: UUID!, $types: [ChangeType!]) {
2320
2320
  mediaBoxChanged(boxId: $boxId, types: $types) {
2321
2321
  createType
@@ -2329,15 +2329,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2329
2329
  }
2330
2330
  }
2331
2331
  }
2332
- ${tl}
2333
- `,tB=(0,en.default)`
2332
+ ${tp}
2333
+ `,tE=(0,ea.default)`
2334
2334
  query MediaClient_box($boxId: UUID!, $passcode: String!) {
2335
2335
  mediaBox(boxId: $boxId, passcode: $passcode) {
2336
2336
  ...boxArguments
2337
2337
  }
2338
2338
  }
2339
- ${tc}
2340
- `,tE=(0,en.default)`
2339
+ ${tl}
2340
+ `,tU=(0,ea.default)`
2341
2341
  query MediaClient_files(
2342
2342
  $boxId: UUID!
2343
2343
  $passcode: String!
@@ -2357,15 +2357,15 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2357
2357
  ...fileShortArguments
2358
2358
  }
2359
2359
  }
2360
- ${tp}
2361
- `,tU=(0,en.default)`
2360
+ ${tu}
2361
+ `,tM=(0,ea.default)`
2362
2362
  query MediaClient_file($fileId: UUID!, $passcode: String!) {
2363
2363
  mediaFile(fileId: $fileId, passcode: $passcode) {
2364
2364
  ...fileArguments
2365
2365
  }
2366
2366
  }
2367
- ${tl}
2368
- `,tM=(0,en.default)`
2367
+ ${tp}
2368
+ `,tR=(0,ea.default)`
2369
2369
  mutation MediaClient_requestFileUpload(
2370
2370
  $name: String!
2371
2371
  $description: String!
@@ -2389,8 +2389,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2389
2389
  ...fileArguments
2390
2390
  }
2391
2391
  }
2392
- ${tl}
2393
- `,tR=(0,en.default)`
2392
+ ${tp}
2393
+ `,tP=(0,ea.default)`
2394
2394
  mutation MediaClient_updateMediaFile(
2395
2395
  $boxId: UUID!
2396
2396
  $passcode: String!
@@ -2412,8 +2412,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2412
2412
  ...fileArguments
2413
2413
  }
2414
2414
  }
2415
- ${tl}
2416
- `,tP=(0,en.default)`
2415
+ ${tp}
2416
+ `,tO=(0,ea.default)`
2417
2417
  mutation MediaClient_updateMediaFiles(
2418
2418
  $boxId: UUID!
2419
2419
  $passcode: String!
@@ -2431,11 +2431,11 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2431
2431
  userTags: $userTags
2432
2432
  )
2433
2433
  }
2434
- `,tO=(0,en.default)`
2434
+ `,tF=(0,ea.default)`
2435
2435
  mutation MediaClient_deleteMediaFiles($boxId: UUID!, $passcode: String!, $list: [UUID!]!) {
2436
2436
  deleteMediaFiles(boxId: $boxId, passcode: $passcode, list: $list)
2437
2437
  }
2438
- `,tF=(0,en.default)`
2438
+ `,tN=(0,ea.default)`
2439
2439
  subscription MediaClient_listenBoxChanged(
2440
2440
  $boxId: UUID!
2441
2441
  $passcode: String!
@@ -2453,8 +2453,8 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2453
2453
  }
2454
2454
  }
2455
2455
  }
2456
- ${tl}
2457
- `,tN={query:"query",mutation:"mutate"},tq=(e,i,t)=>([n,a])=>{if(e[n])throw Error(`Overwriting client.${n}`);e[n]=async(o,r={})=>{let s,d,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{let t=await e[tN[i]](c);({data:s,errors:d}=t||{})}if(d)throw Error(d.map(e=>e.message).join("\n"));return s?s[n]:null}},tW=e=>({data:i,errors:t})=>{var n;let a=(n=!i?.mediaBoxChanged&&"Missing mediaBoxChanged payload",t?.length?Error(t.map(e=>e.message).join("\n")):n?Error(n):null);return a?e(a):e(null,i.mediaBoxChanged)};var tj=`
2456
+ ${tp}
2457
+ `,tq={query:"query",mutation:"mutate"},tW=(e,i,t)=>([n,a])=>{if(e[n])throw Error(`Overwriting client.${n}`);e[n]=async(o,r={})=>{let s,d,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{let t=await e[tq[i]](c);({data:s,errors:d}=t||{})}if(d)throw Error(d.map(e=>e.message).join("\n"));return s?s[n]:null}},tj=e=>({data:i,errors:t})=>{var n;let a=(n=!i?.mediaBoxChanged&&"Missing mediaBoxChanged payload",t?.length?Error(t.map(e=>e.message).join("\n")):n?Error(n):null);return a?e(a):e(null,i.mediaBoxChanged)};var tV=`
2458
2458
  query AL_events($filter: EventsFilter!) {
2459
2459
  events(filter: $filter) {
2460
2460
  device_id
@@ -2466,13 +2466,13 @@ ${((e,i)=>{switch(e){case"defined_properties":return Object.entries(i).map(([e,i
2466
2466
  timestamp
2467
2467
  }
2468
2468
  }
2469
- `,tV=`
2469
+ `,tK=`
2470
2470
  query AL_screenshots($filter: ScreenshotFilter!) {
2471
2471
  screenshots(filter: $filter) {
2472
2472
  timestamp
2473
2473
  }
2474
2474
  }
2475
- `,tK=z(function e(i,t){H(this,e),this.baseUrl=i,this.token=t,this.graphqlUrl=`${i}/api/graphql`},[{key:"graphql",value:(o=$(function*(e,i){var t=yield(0,x.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 Error(`Activity-log query failed (${t.status}): ${n}`)}var a=yield t.json();if(a.errors?.length)throw Error(a.errors.map(e=>e.message).join("\n"));return a.data}),function(e,i){return o.apply(this,arguments)})},{key:"events",value:(r=$(function*(e,{limit:i,offset:t}={}){var n={...e};return null!=i&&(n.limit=i),null!=t&&(n.offset=t),(yield this.graphql(tj,{filter:n})).events}),function(e){return r.apply(this,arguments)})},{key:"screenshots",value:(s=$(function*(e){return(yield this.graphql(tV,{filter:e})).screenshots}),function(e){return s.apply(this,arguments)})},{key:"downloadScreenshot",value:(d=$(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,x.Ay)(n,{headers:{Authorization:`Bearer ${this.token}`}});if(!a.ok){var o=yield a.text().catch(()=>"");throw Error(`Screenshot fetch failed (${a.status}): ${o}`)}return Buffer.from((yield a.arrayBuffer()))}),function(e,i,t){return d.apply(this,arguments)})}]);process.env.STAGE,process.env.URL_BASE;var tY="bricks-mcp",tG={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"};process.env.AUTH0_DOMAIN,process.env.CACHE_URL;var tL=t(1639);let tz=({type:e,title:i,template_key:t})=>{var n,a,o=(0,tL.M4)(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=j(W.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,tL.M4)("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=j(W.dK.Basic),d=j(W.brickMapping[t]);if(!d)throw 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=j(W.generatorMapping[t]);if(!l)throw 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(W.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,tL.M4)("property_bank_command"),u=(0,tL.M4)("property_bank_command"),m=(0,tL.M4)("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 C({id:o,example:n,extraInfo:a})};var tH="2.25.0-beta.53";function tJ(){return tX.apply(this,arguments)}function tX(){return(tX=$(function*(e={}){var i,t=e.token||process.env.BRICKS_API_TOKEN;if(!t)throw console.error("Error: API token is required"),console.error("Please provide a token via options or set BRICKS_API_TOKEN environment variable"),Error("API token is required");var n=function(e){try{var i=e.queryStringParameters?.token;if(!i){var t=new Headers(e.headers);i=t.get("authorization")?.replace("Bearer ","")}if(!i)return{success:!1,message:"Authentication failed: No token provided"};var n=function(e){try{var i=e.split(".");if(i.length<3)return null;var t=JSON.parse(Buffer.from(i[0],"base64url").toString());if(!k.includes(t?.alg))return null;return JSON.parse(Buffer.from(i[1],"base64url").toString())}catch{return null}}(i);if(!n)return{success:!1,message:"Authentication failed: Invalid token"};var a=D.includes(n.iss)?"user":"workspace";if("workspace"===a){var o=Array.isArray(n.t)?n.t:[];n.permissions=o.reduce((e,i)=>{var t=I[i];return t&&e.push(t),e},[])}else n.permissions=Object.keys(b);return{success:!0,token:i,tokenInfo:n,tokenType:a}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}({queryStringParameters:{token:t}});if(!n.success)throw console.error("Error: Invalid BRICKS_API_TOKEN"),console.error(n.message),Error("Invalid BRICKS_API_TOKEN");var a=new v._({name:tY,version:tH}),o={...n,client:function(e,i,t){switch(t){case"user":return new iB(e,i);case"workspace":return new i3(e,i);default:throw Error(`Invalid token type: ${t}.`)}}(tG.bricks,n.token,n.tokenType)};a.prompt("getting-started","Getting started with BRICKS",{},$(function*(){return{messages:[{role:"user",content:{type:"text",text:`Welcome to BRICKS — start here.
2475
+ `,tY=H(function e(i,t){J(this,e),this.baseUrl=i,this.token=t,this.graphqlUrl=`${i}/api/graphql`},[{key:"graphql",value:(o=$(function*(e,i){var t=yield(0,x.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 Error(`Activity-log query failed (${t.status}): ${n}`)}var a=yield t.json();if(a.errors?.length)throw Error(a.errors.map(e=>e.message).join("\n"));return a.data}),function(e,i){return o.apply(this,arguments)})},{key:"events",value:(r=$(function*(e,{limit:i,offset:t}={}){var n={...e};return null!=i&&(n.limit=i),null!=t&&(n.offset=t),(yield this.graphql(tV,{filter:n})).events}),function(e){return r.apply(this,arguments)})},{key:"screenshots",value:(s=$(function*(e){return(yield this.graphql(tK,{filter:e})).screenshots}),function(e){return s.apply(this,arguments)})},{key:"downloadScreenshot",value:(d=$(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,x.Ay)(n,{headers:{Authorization:`Bearer ${this.token}`}});if(!a.ok){var o=yield a.text().catch(()=>"");throw Error(`Screenshot fetch failed (${a.status}): ${o}`)}return Buffer.from((yield a.arrayBuffer()))}),function(e,i,t){return d.apply(this,arguments)})}]);process.env.STAGE,process.env.URL_BASE;var tG="bricks-mcp",tL={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"};process.env.AUTH0_DOMAIN,process.env.CACHE_URL;var tz=t(1639);let tH=({type:e,title:i,template_key:t})=>{var n,a,o=(0,tz.M4)(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=V(j.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,tz.M4)("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=V(j.dK.Basic),d=V(j.brickMapping[t]);if(!d)throw 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=V(j.generatorMapping[t]);if(!l)throw 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(j.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,tz.M4)("property_bank_command"),u=(0,tz.M4)("property_bank_command"),m=(0,tz.M4)("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 C({id:o,example:n,extraInfo:a})};var tJ="2.25.0-beta.58";function tX(){return tQ.apply(this,arguments)}function tQ(){return(tQ=$(function*(e={}){var i,t=e.token||process.env.BRICKS_API_TOKEN;if(!t)throw console.error("Error: API token is required"),console.error("Please provide a token via options or set BRICKS_API_TOKEN environment variable"),Error("API token is required");var n=function(e){try{var i=e.queryStringParameters?.token;if(!i){var t=new Headers(e.headers);i=t.get("authorization")?.replace("Bearer ","")}if(!i)return{success:!1,message:"Authentication failed: No token provided"};var n=function(e){try{var i=e.split(".");if(i.length<3)return null;var t=JSON.parse(Buffer.from(i[0],"base64url").toString());if(!k.includes(t?.alg))return null;return JSON.parse(Buffer.from(i[1],"base64url").toString())}catch{return null}}(i);if(!n)return{success:!1,message:"Authentication failed: Invalid token"};var a=D.includes(n.iss)?"user":"workspace";if("workspace"===a){var o=Array.isArray(n.t)?n.t:[];n.permissions=o.reduce((e,i)=>{var t=I[i];return t&&e.push(t),e},[])}else n.permissions=Object.keys(b);return{success:!0,token:i,tokenInfo:n,tokenType:a}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}({queryStringParameters:{token:t}});if(!n.success)throw console.error("Error: Invalid BRICKS_API_TOKEN"),console.error(n.message),Error("Invalid BRICKS_API_TOKEN");var a=new v._({name:tG,version:tJ}),o={...n,client:function(e,i,t){switch(t){case"user":return new iE(e,i);case"workspace":return new i8(e,i);default:throw Error(`Invalid token type: ${t}.`)}}(tL.bricks,n.token,n.tokenType)};a.prompt("getting-started","Getting started with BRICKS",{},$(function*(){return{messages:[{role:"user",content:{type:"text",text:`Welcome to BRICKS — start here.
2476
2476
 
2477
2477
  Before doing any complex work (application design, deployments, etc.),
2478
2478
  always consult the official docs rather than guessing.
@@ -2543,4 +2543,4 @@ What I'll produce first:
2543
2543
  - Short recap of requirements
2544
2544
  - Clarifying questions (only what's necessary)
2545
2545
  - High-level architecture plan
2546
- - Minimal config skeleton that validates against the schema`}}]}}),function(e){return i.apply(this,arguments)})),a.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"},$(function*(){return C(S,{uri:"file://docs/getting-started.md",mimeType:"text/markdown"})})),function(e,i){var t,n="user"===i.tokenType,a=((e,i=null)=>({name:t,description:n,inputSchema:a,permission:o},r)=>{(!o||i.tokenInfo.permissions?.includes(o)||0)&&e.tool(t,n,a,r)})(e,i),o=e=>({...e,...n?{workspace_id:A.Yj().describe("Workspace ID")}:{}}),r=i.client,s=n?function(e){var i=e.endpoint,t=e.accessToken;if(!i)throw Error("Media API endpoint is required");if(!t)throw Error("Access token is required");return((e={})=>{let i=(({endpoint:e="http://localhost:3002",accessToken:i,boxId:t,passcode:n,enableSubscription:a=!0,enableRetry:o=!0,subscriptionOnConnectionOrError:r,onNetworkError:s}={})=>{let d,c,l,p=t&&n,u=`${e}/api/graphql`;return p&&(u=`${e}/api/graphql_with_passcode`),d=function({endpointURL:e,subscriptionEndpointURL:i,accessToken:t,boxId:n,passcode:a,origin:o,enableSubscription:r,enableRetry:s=!0,subscriptionOnConnectionOrError:d,onNetworkError:c=()=>{}}){let l,p,u,m,_={};o&&(_.origin=o),n&&a||(_.authorization=`Bearer ${t}`);let g=new ti.z({uri:e,headers:_}),f=()=>{m&&(clearTimeout(m),m=void 0)};r&&(l=(0,tn.UU)({url:i,lazy:!0,connectionParams:_,retryAttempts:1/0,shouldRetry:()=>!0,keepAlive:1e4,on:{error:e=>{f(),d?.(e)},opened:e=>{d?.(),u=e,f()},ping:e=>{e||(f(),m=setTimeout(()=>{u&&u.readyState===WebSocket.OPEN&&u.close(4205,"Client Restart")},5e3))},pong:e=>{e&&f()},closed:()=>{f()}}}),p=new tt.c(l));let y=i8.C.from([(0,ta.S)(({networkError:e,operation:i})=>{if(e){c(e,i);let t=e?.message||"";if("Aborted"===t||e?.name==="AbortError"||t.includes("Too many requests")||e?.response?.status===429||e?.statusCode===429||e?.status===429||"Timeout exceeded"===t||e?.timeout||e?.statusCode===403||e?.status===403)return new i7.c(e=>e.complete())}}),s&&new te.z({attempts:{max:3,retryIf:e=>{let i="string"==typeof e?.message?e.message:"string"==typeof e?e:"";return!(!e||i.includes("Too many requests")||e?.response?.status===429||e?.statusCode===429||e?.status===429||e?.statusCode===403||e?.status===403||e?.timeout||"Timeout exceeded"===i)&&"Aborted"!==i&&e?.name!=="AbortError"}}}),new(tr())(3e4),r?i8.C.split(({query:e})=>{let{kind:i,operation:t}=(0,ts.Vn)(e);return"OperationDefinition"===i&&"subscription"===t},p,g):g].filter(Boolean));return y.closeSubscriptionClient=()=>r&&l.dispose(),y}({endpointURL:u,subscriptionEndpointURL:u.replace("http:","ws:"),accessToken:i,enableSubscription:!p&&a,enableRetry:o,subscriptionOnConnectionOrError:r,onNetworkError:s}),c=new ei.D,(l=new ee.R({link:d,cache:c,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"}}})).close=()=>d.closeSubscriptionClient(),l})(e);if(e.boxId&&e.passcode){i.type="passcode",i.queries=f,i.mutations=y;let t={boxId:e.boxId,passcode:e.passcode};Object.entries(f).forEach(tq(i,"query",t)),Object.entries(y).forEach(tq(i,"mutation",t)),i.listenBoxChanged=(e,n)=>i.subscribe({query:tF,variables:{...t,...e}}).subscribe({next:tW(n),error(e){n(e)}})}else i.accessToken=e.accessToken,i.type="token",i.queries=_,i.mutations=g,Object.entries(_).forEach(tq(i,"query")),Object.entries(g).forEach(tq(i,"mutation")),i.listenBoxChanged=(e,t)=>i.subscribe({query:tx,variables:e}).subscribe({next:tW(t),error(e){t(e)}});return i})({endpoint:i,accessToken:t,enableSubscription:!1,enableRetry:!0})}({endpoint:tG.media,accessToken:i.token}):r;if(n&&e.tool("list_workspaces","List all workspaces",{},$(function*(){return C((yield r.workspaces()))})),a({name:"get_workspace_overview",description:"Get comprehensive overview of the BRICKS workspace including stats and summary",inputSchema:o({}),permission:"info"},(d=$(function*({workspace_id:e}){var i=T((yield Promise.all([r.workspace({id:e}),r.applications({workspaceId:e,paginate:{limit:50,offset:0}}),r.modules({workspaceId:e,paginate:{limit:50,offset:0}}),r.devices({workspaceId:e,paginate:{limit:50,offset:0}}),n?s.mediaWorkspace({workspaceId:e}).catch(()=>null):s.mediaWorkspace().catch(()=>null),n?s.mediaBoxes({workspaceId:e}).catch(()=>[]):s.mediaBoxes().catch(()=>[])])),6),t=i[0],a=i[1],o=i[2],d=i[3],c=i[4],l=i[5];if(!t)throw Error("Authentication failed, please check your token");return C({workspace:t,stats:{applications:a?.length??"No permission",modules:o?.length??"No permission",devices:d?.length??"No permission",running_apps:a?.filter(e=>e.status?.running).length??"No permission",media_boxes:l?.length??"No permission",media_enabled:!!c,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:c?{workspace_id:c.id,name:c.name,size_used:c.size,size_limit:c.sizeLimit,boxes:l?.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 d.apply(this,arguments)})),a({name:"get_applications",description:"List all applications in the workspace",inputSchema:o({limit:A.ai().describe("Maximum number of applications to return").optional().default(50),offset:A.ai().describe("Number of applications to skip").optional().default(0)}),permission:"query_application"},(c=$(function*({workspace_id:e,limit:i=50,offset:t=0}){return C((yield r.applications({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return c.apply(this,arguments)})),a({name:"get_application",description:"Get detailed info and config of a specific application",inputSchema:o({id:A.Yj().describe("Application ID")}),permission:"query_application"},(l=$(function*({workspace_id:e,id:i}){return C((yield r.application({workspaceId:e,id:i})))}),function(e){return l.apply(this,arguments)})),a({name:"get_modules",description:"List all modules in the workspace",inputSchema:o({limit:A.ai().describe("Maximum number of modules to return").optional().default(50),offset:A.ai().describe("Number of modules to skip").optional().default(0)}),permission:"query_module"},(p=$(function*({workspace_id:e,limit:i=50,offset:t=0}){return C((yield r.modules({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return p.apply(this,arguments)})),a({name:"get_module",description:"Get detailed info and config of a specific module",inputSchema:o({id:A.Yj().describe("Module ID")}),permission:"query_module"},(u=$(function*({workspace_id:e,id:i}){return C((yield r.module({workspaceId:e,id:i})))}),function(e){return u.apply(this,arguments)})),a({name:"update_module_info",description:"Update a specific module info",inputSchema:o({id:A.Yj().describe("Module ID"),name:A.Yj().describe("Module name"),description:A.Yj().describe("Module description")}),permission:"update_module"},(m=$(function*({workspace_id:e,id:i,name:t,description:n}){return C((yield r.updateModule({workspaceId:e,id:i,name:t,description:n})))}),function(e){return m.apply(this,arguments)})),a({name:"update_module_config",description:"Update a specific module configuration",inputSchema:o({id:A.Yj().describe("Module ID"),config:A.Ik({}).passthrough().describe("New configuration object, see file://docs/config-schema.md for schema reference")}),permission:"update_module"},(v=$(function*({workspace_id:e,id:i,config:t}){var n=yield N(t);if(!n.valid)throw Error(`Config validation failed: ${n.errors.join(", ")}`);return C((yield r.updateModule({workspaceId:e,id:i,config:JSON.stringify(t),validateConfig:!0})))}),function(e){return v.apply(this,arguments)})),a({name:"get_devices",description:"List all devices in the workspace",inputSchema:o({limit:A.ai().describe("Maximum number of devices to return").optional().default(50),offset:A.ai().describe("Number of devices to skip").optional().default(0)}),permission:"query_device"},(h=$(function*({workspace_id:e,limit:i=50,offset:t=0}){return C((yield r.devices({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return h.apply(this,arguments)})),a({name:"create_application",description:"Create a new BRICKS application with default grid layout",inputSchema:o({name:A.Yj().describe("Application name"),description:A.Yj().describe("Application description").optional(),grid_width:A.ai().describe("Grid width in units").optional().default(96),grid_height:A.ai().describe("Grid height in units").optional().default(54)}),permission:"create_application"},(b=$(function*({workspace_id:e,name:i,description:t,grid_width:n,grid_height:a}){return C((yield r.createApplication({workspaceId:e,name:i,description:t,gridWidth:n,gridHeight:a})))}),function(e){return b.apply(this,arguments)})),a({name:"update_application_info",description:"Update application info",inputSchema:{id:A.Yj().describe("Application ID"),name:A.Yj().describe("Application name"),description:A.Yj().describe("Application description")},permission:"update_application"},(I=$(function*({id:e,name:i,description:t}){return C((yield r.updateApplication({id:e,name:i,description:t})))}),function(e){return I.apply(this,arguments)})),a({name:"update_application_config",description:"Update application configuration with validation",inputSchema:{id:A.Yj().describe("Application ID"),config:A.Ik({}).passthrough().describe("New application configuration. Please read `getting-started` for BRICKS concepts before changing")},permission:"update_application"},(k=$(function*({id:e,config:i}){var t=yield N(i);if(!t.valid)throw Error(`Config validation failed: ${t.errors.join(", ")}`);return C((yield r.updateApplication({id:e,config:JSON.stringify(i)})))}),function(e){return k.apply(this,arguments)})),a({name:"bind_application",description:"Bind application to device with viewport configuration",inputSchema:{app_id:A.Yj().describe("Application ID"),viewports:A.YO(A.Ik({device_id:A.Yj().describe("Device ID"),x:A.ai().describe("X coordinate"),y:A.ai().describe("Y coordinate"),width:A.ai().describe("Width"),height:A.ai().describe("Height"),rotate:A.ai().describe("Rotation"),rotateType:A.Yj().describe("Rotation type")})).describe("Viewport configuration")},permission:"bind_application"},(D=$(function*({app_id:e,viewports:i}){return C((yield r.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 D.apply(this,arguments)})),a({name:"unbind_application",description:"Unbind application from device",inputSchema:{app_id:A.Yj().describe("Application ID"),device_id:A.Yj().describe("Device ID")},permission:"bind_application"},(S=$(function*({app_id:e,device_id:i}){return C((yield r.bindApplication({id:e,unbindDevices:[i]})))}),function(e){return S.apply(this,arguments)})),n&&a({name:"list_media_workspaces",description:"List all media workspaces",inputSchema:{},permission:"query_media_flow"},$(function*(){return C((yield s.mediaWorkspaces()))})),a({name:"get_media_workspace",description:"Get media workspace information and status",inputSchema:o({}),permission:"query_media_flow"},(E=$(function*({workspace_id:e}){return C((yield s.mediaWorkspace({workspaceId:e})))}),function(e){return E.apply(this,arguments)})),a({name:"list_media_boxes",description:"List all media boxes in the workspace",inputSchema:o({}),permission:"query_media_flow"},(U=$(function*({workspace_id:e}){return C((yield s.mediaBoxes({workspaceId:e})))}),function(e){return U.apply(this,arguments)})),a({name:"get_media_box",description:"Get detailed information about a specific media box",inputSchema:{box_id:A.Yj().describe("Media box ID")},permission:"query_media_flow"},(M=$(function*({box_id:e}){return C((yield s.mediaBox({boxId:e})))}),function(e){return M.apply(this,arguments)})),a({name:"list_media_files",description:"List media files in a specific box with filtering options",inputSchema:{box_id:A.Yj().describe("Media box ID"),include_types:A.YO(A.Yj()).optional().describe('Filter by file types (e.g., ["image", "video", "audio"])'),user_tags:A.YO(A.Yj()).optional().describe("Filter by user tags"),limit:A.ai().optional().default(50).describe("Maximum number of files to return"),offset:A.ai().optional().default(0).describe("Number of files to skip")},permission:"query_media_flow"},(R=$(function*({box_id:e,include_types:i,user_tags:t,limit:n,offset:a}){return C((yield s.mediaFiles({boxId:e,includeTypes:i,userTags:t,limit:n,offset:a})))}),function(e){return R.apply(this,arguments)})),a({name:"get_media_file_meta",description:"Get detailed information about a specific media file",inputSchema:{file_id:A.Yj().describe("Media file ID")},permission:"query_media_flow"},(P=$(function*({file_id:e}){return C((yield s.mediaFile({fileId:e})))}),function(e){return P.apply(this,arguments)})),a({name:"media_box_upload",description:"Upload a file to a media box from URL or base64 data",inputSchema:{box_id:A.Yj().describe("Target media box ID"),name:A.Yj().describe("File name"),description:A.Yj().optional().default("").describe("File description"),file_type:A.k5(["image","video","audio","file"]).describe("File type"),source_url:A.Yj().optional().describe("URL to download the file from"),base64_data:A.Yj().optional().describe("Base64 encoded file data"),user_tags:A.YO(A.Yj()).optional().default([]).describe("User-defined tags for the file")},permission:"write_media_flow"},(O=$(function*({box_id:e,name:i,description:t,source_url:a,base64_data:o,file_type:r,user_tags:d}){if(!a&&!o)throw Error("Either source_url or base64_data must be provided");if(a&&o)throw Error("Provide either source_url OR base64_data, not both");var c=a?null:"application/octet-stream",l=a?yield(0,x.Ay)(a,{agent:(0,B.fJ)(a)}).then(e=>(c=e.headers.get("content-type"),e.blob())):new Blob([w.Buffer.from(o,"base64")],{type:c}),p=yield s.requestFileUpload({name:i,description:t,boxId:e,fileType:n?r.toUpperCase():r,contentType:c,userTags:d,meta:{}}),u=!1;try{var m=JSON.parse(p?.meta.uploadInfo),_=new FormData;_.append("file",l),_.append("Content-Type",c),_.append("AWSAccessKeyId",m.AWSAccessKeyId),_.append("Signature",m.Signature),_.append("Policy",m.Policy),_.append("acl",m.acl),_.append("key",m.key),u=yield(0,x.Ay)(m.url,{method:"POST",body:_}).then(e=>e.ok).catch(()=>!1)}catch{u=!1}return C({file_id:p.id,upload_success:u,upload_info:{content_type:c,file_type:r,source_type:a?"url":"base64",processing_note:"File will be processed automatically. Use get_media_file to check processing status."}})}),function(e){return O.apply(this,arguments)})),a({name:"update_media_file_meta",description:"Update media file information",inputSchema:{file_id:A.Yj().describe("Media file ID"),name:A.Yj().optional().describe("New file name"),description:A.Yj().optional().describe("New file description"),user_tags:A.YO(A.Yj()).optional().describe("New user tags")},permission:"write_media_flow"},(F=$(function*({file_id:e,name:i,description:t,user_tags:n}){return C((yield s.updateMediaFile({fileId:e,name:i,description:t,userTags:n,requestUploadAgain:!1})))}),function(e){return F.apply(this,arguments)})),a({name:"copy_media_files",description:"Copy media files from one box to another",inputSchema:{from_box_id:A.Yj().describe("Source media box ID"),to_box_id:A.Yj().describe("Target media box ID"),file_ids:A.YO(A.Yj()).describe("Array of media file IDs to copy")},permission:"write_media_flow"},(q=$(function*({from_box_id:e,to_box_id:i,file_ids:t}){return C((yield s.copyMediaFiles({fromBoxId:e,toBoxId:i,list:t})))}),function(e){return q.apply(this,arguments)})),a({name:"delete_media_files",description:"Delete specific media files from a box",inputSchema:{box_id:A.Yj().describe("Media box ID"),file_ids:A.YO(A.Yj()).describe("Array of media file IDs to delete")},permission:"write_media_flow"},(W=$(function*({box_id:e,file_ids:i}){return C((yield s.deleteMediaFiles({boxId:e,list:i})))}),function(e){return W.apply(this,arguments)})),a({name:"cleanup_media_box",description:"Delete all files in a media box, optionally filtered by type",inputSchema:{box_id:A.Yj().describe("Media box ID"),include_types:A.YO(A.Yj()).optional().describe('Only delete files of these types (e.g., ["image", "video"])')},permission:"write_media_flow"},(j=$(function*({box_id:e,include_types:i}){if("deleteMediaBoxFiles"in s)return C((yield s.deleteMediaBoxFiles({boxId:e,includeTypes:i})));var t=yield s.mediaFiles({boxId:e,includeTypes:i});return C((yield s.deleteMediaFiles({boxId:e,list:t.map(e=>e.id)})))}),function(e){return j.apply(this,arguments)})),e.tool("calculate_grid_layout","Calculate grid layout and pixel conversions for different device resolutions",{device_width:A.ai().describe("Device width in pixels"),device_height:A.ai().describe("Device height in pixels"),app_grid_width:A.ai().describe("Application grid width").optional().default(96),app_grid_height:A.ai().describe("Application grid height").optional().default(54)},(V=$(function*({device_width:e,device_height:i,app_grid_width:t,app_grid_height:n}){var a,o=(a=e/t,{deviceBrickWidth:e/a,deviceBrickHeight:i/a,deviceBrickUnit:a}),r=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 C({device_resolution:{width:e,height:i,aspect_ratio:(e/i).toFixed(2)},current_grid:{width:t,height:n,unit_size_px:o.deviceBrickUnit.toFixed(2),total_pixels:{width:o.deviceBrickWidth.toFixed(2),height:o.deviceBrickHeight.toFixed(2)}},recommended_grid:{width:r.deviceBrickWidth,height:r.deviceBrickHeight,unit_size_px:r.deviceBrickUnit.toFixed(2),note:"Optimized for device aspect ratio"}})}),function(e){return V.apply(this,arguments)})),e.tool("create_item","Use this tool to create new item that you can put in application configuration",{type:A.k5(["subspace","canvas","brick","generator","property_bank","property_bank_calc","property_bank_command","animation","state_group","automation_map"]).describe("Item type"),title:A.Yj().describe("Item title"),template_key:A.Yj().optional().describe("Template key for brick or generator")},tz),e.tool("getting_started","Get documentation content for getting started",{},$(function*(){return C(L)})),!n){var d,c,l,p,u,m,v,h,b,I,k,D,S,E,U,M,R,P,O,F,q,W,j,V,K,Y,G,z=()=>new tK(tG.activityLog,i.token);a({name:"activity_log_events",description:"Query activity log events. Returns raw events (general, data, local_sync) with filtering. Max 30-day range.",inputSchema:o({start_time:A.Yj().describe("Start time (ISO 8601)"),end_time:A.Yj().describe("End time (ISO 8601)"),device_id:A.Yj().optional().describe("Filter by device ID"),event_type:A.k5(["general","data","local_sync"]).optional().describe("Filter by event type"),event_name:A.Yj().optional().describe("Filter by event name (e.g. BRICK_xxx_ON_PRESS)"),subspace_id:A.Yj().optional().describe("Filter by subspace ID"),sender:A.Yj().optional().describe("Filter by sender"),limit:A.ai().optional().default(50).describe("Max events to return per page"),offset:A.ai().optional().default(0).describe("Number of events to skip (for pagination)")}),permission:"query_activity_log"},(K=$(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=z(),l={start_time:e,end_time:i};return t&&(l.device_id=t),n&&(l.event_type=n),a&&(l.event_name=a),o&&(l.subspace_id=o),r&&(l.sender=r),C((yield c.events(l,{limit:s,offset:d})))}),function(e){return K.apply(this,arguments)})),a({name:"activity_log_screenshots",description:"List available screenshot timestamps for a device in a time range.",inputSchema:o({device_id:A.Yj().describe("Device ID (required)"),start_time:A.Yj().describe("Start time (ISO 8601)"),end_time:A.Yj().describe("End time (ISO 8601)")}),permission:"query_activity_log"},(Y=$(function*({device_id:e,start_time:i,end_time:t}){var n=z();return C((yield n.screenshots({device_id:e,start_time:i,end_time:t})))}),function(e){return Y.apply(this,arguments)})),a({name:"activity_log_screenshot",description:"Download a device screenshot at a specific timestamp. Returns JPEG image as blob.",inputSchema:o({device_id:A.Yj().describe("Device ID"),ts:A.Yj().describe("Screenshot timestamp (ISO 8601 or epoch ms)")}),permission:"query_activity_log"},(G=$(function*({workspace_id:e,device_id:t,ts:n}){var a=e||i.tokenInfo?.w_id;if(!a)throw Error("Could not determine workspace ID");var o=z(),r=/^\d+$/.test(n)?n:new Date(n).getTime();return C((yield o.downloadScreenshot(a,t,r)),{mimeType:"image/jpeg"})}),function(e){return G.apply(this,arguments)}))}a({name:"get_device_usage",description:"Get device usage metrics (uptime, memory, disk) for a date range. Data from BRICKS main server.",inputSchema:o({device_id:A.Yj().describe("Device ID"),start_date:A.Yj().optional().describe("Start date/time in ISO 8601 format (default: start of today)"),end_date:A.Yj().optional().describe("End date/time in ISO 8601 format (default: now)")}),permission:"query_device"},(t=$(function*({device_id:e,start_date:i,end_date:t}){var n=new Date,a=new Date(n.getFullYear(),n.getMonth(),n.getDate()).toISOString();return C((yield r.deviceUsage({deviceId:e,startDate:i?new Date(i).toISOString():a,endDate:t?new Date(t).toISOString():n.toISOString()})))}),function(e){return t.apply(this,arguments)}))}(a,o);var r=new h.S;try{yield a.connect(r),console.error("BRICKS MCP Server running on STDIO"),console.error(`Server: ${tY} v${tH}`),console.error(`Token Type: ${n.tokenType}`),console.error(`Permissions: ${n.tokenInfo.permissions.join(", ")}`),console.error("Ready to accept requests...")}catch(e){throw console.error("Failed to start MCP server:",e),e}})).apply(this,arguments)}}};
2546
+ - Minimal config skeleton that validates against the schema`}}]}}),function(e){return i.apply(this,arguments)})),a.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"},$(function*(){return C(S,{uri:"file://docs/getting-started.md",mimeType:"text/markdown"})})),function(e,i){var t,n="user"===i.tokenType,a=((e,i=null)=>({name:t,description:n,inputSchema:a,permission:o},r)=>{(!o||i.tokenInfo.permissions?.includes(o)||0)&&e.tool(t,n,a,r)})(e,i),o=e=>({...e,...n?{workspace_id:A.Yj().describe("Workspace ID")}:{}}),r=i.client,s=n?function(e){var i=e.endpoint,t=e.accessToken;if(!i)throw Error("Media API endpoint is required");if(!t)throw Error("Access token is required");return((e={})=>{let i=(({endpoint:e="http://localhost:3002",accessToken:i,boxId:t,passcode:n,enableSubscription:a=!0,enableRetry:o=!0,subscriptionOnConnectionOrError:r,onNetworkError:s}={})=>{let d,c,l,p=t&&n,u=`${e}/api/graphql`;return p&&(u=`${e}/api/graphql_with_passcode`),d=function({endpointURL:e,subscriptionEndpointURL:i,accessToken:t,boxId:n,passcode:a,origin:o,enableSubscription:r,enableRetry:s=!0,subscriptionOnConnectionOrError:d,onNetworkError:c=()=>{}}){let l,p,u,m,_={};o&&(_.origin=o),n&&a||(_.authorization=`Bearer ${t}`);let g=new tt.z({uri:e,headers:_}),f=()=>{m&&(clearTimeout(m),m=void 0)};r&&(l=(0,ta.UU)({url:i,lazy:!0,connectionParams:_,retryAttempts:1/0,shouldRetry:()=>!0,keepAlive:1e4,on:{error:e=>{f(),d?.(e)},opened:e=>{d?.(),u=e,f()},ping:e=>{e||(f(),m=setTimeout(()=>{u&&u.readyState===WebSocket.OPEN&&u.close(4205,"Client Restart")},5e3))},pong:e=>{e&&f()},closed:()=>{f()}}}),p=new tn.c(l));let y=i7.C.from([(0,to.S)(({networkError:e,operation:i})=>{if(e){c(e,i);let t=e?.message||"";if("Aborted"===t||e?.name==="AbortError"||t.includes("Too many requests")||e?.response?.status===429||e?.statusCode===429||e?.status===429||"Timeout exceeded"===t||e?.timeout||e?.statusCode===403||e?.status===403)return new te.c(e=>e.complete())}}),s&&new ti.z({attempts:{max:3,retryIf:e=>{let i="string"==typeof e?.message?e.message:"string"==typeof e?e:"";return!(!e||i.includes("Too many requests")||e?.response?.status===429||e?.statusCode===429||e?.status===429||e?.statusCode===403||e?.status===403||e?.timeout||"Timeout exceeded"===i)&&"Aborted"!==i&&e?.name!=="AbortError"}}}),new(ts())(3e4),r?i7.C.split(({query:e})=>{let{kind:i,operation:t}=(0,td.Vn)(e);return"OperationDefinition"===i&&"subscription"===t},p,g):g].filter(Boolean));return y.closeSubscriptionClient=()=>r&&l.dispose(),y}({endpointURL:u,subscriptionEndpointURL:u.replace("http:","ws:"),accessToken:i,enableSubscription:!p&&a,enableRetry:o,subscriptionOnConnectionOrError:r,onNetworkError:s}),c=new et.D,(l=new ei.R({link:d,cache:c,defaultOptions:{watchQuery:{fetchPolicy:"no-cache",errorPolicy:"ignore"},query:{fetchPolicy:"no-cache",errorPolicy:"all"}}})).close=()=>d.closeSubscriptionClient(),l})(e);if(e.boxId&&e.passcode){i.type="passcode",i.queries=f,i.mutations=y;let t={boxId:e.boxId,passcode:e.passcode};Object.entries(f).forEach(tW(i,"query",t)),Object.entries(y).forEach(tW(i,"mutation",t)),i.listenBoxChanged=(e,n)=>i.subscribe({query:tN,variables:{...t,...e}}).subscribe({next:tj(n),error(e){n(e)}})}else i.accessToken=e.accessToken,i.type="token",i.queries=_,i.mutations=g,Object.entries(_).forEach(tW(i,"query")),Object.entries(g).forEach(tW(i,"mutation")),i.listenBoxChanged=(e,t)=>i.subscribe({query:tB,variables:e}).subscribe({next:tj(t),error(e){t(e)}});return i})({endpoint:i,accessToken:t,enableSubscription:!1,enableRetry:!0})}({endpoint:tL.media,accessToken:i.token}):r;if(n&&e.tool("list_workspaces","List all workspaces",{},$(function*(){return C((yield r.workspaces()))})),a({name:"get_workspace_overview",description:"Get comprehensive overview of the BRICKS workspace including stats and summary",inputSchema:o({}),permission:"info"},(d=$(function*({workspace_id:e}){var i=T((yield Promise.all([r.workspace({id:e}),r.applications({workspaceId:e,paginate:{limit:50,offset:0}}),r.modules({workspaceId:e,paginate:{limit:50,offset:0}}),r.devices({workspaceId:e,paginate:{limit:50,offset:0}}),n?s.mediaWorkspace({workspaceId:e}).catch(()=>null):s.mediaWorkspace().catch(()=>null),n?s.mediaBoxes({workspaceId:e}).catch(()=>[]):s.mediaBoxes().catch(()=>[])])),6),t=i[0],a=i[1],o=i[2],d=i[3],c=i[4],l=i[5];if(!t)throw Error("Authentication failed, please check your token");return C({workspace:t,stats:{applications:a?.length??"No permission",modules:o?.length??"No permission",devices:d?.length??"No permission",running_apps:a?.filter(e=>e.status?.running).length??"No permission",media_boxes:l?.length??"No permission",media_enabled:!!c,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:c?{workspace_id:c.id,name:c.name,size_used:c.size,size_limit:c.sizeLimit,boxes:l?.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 d.apply(this,arguments)})),a({name:"get_applications",description:"List all applications in the workspace",inputSchema:o({limit:A.ai().describe("Maximum number of applications to return").optional().default(50),offset:A.ai().describe("Number of applications to skip").optional().default(0)}),permission:"query_application"},(c=$(function*({workspace_id:e,limit:i=50,offset:t=0}){return C((yield r.applications({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return c.apply(this,arguments)})),a({name:"get_application",description:"Get detailed info and config of a specific application",inputSchema:o({id:A.Yj().describe("Application ID")}),permission:"query_application"},(l=$(function*({workspace_id:e,id:i}){return C((yield r.application({workspaceId:e,id:i})))}),function(e){return l.apply(this,arguments)})),a({name:"get_modules",description:"List all modules in the workspace",inputSchema:o({limit:A.ai().describe("Maximum number of modules to return").optional().default(50),offset:A.ai().describe("Number of modules to skip").optional().default(0)}),permission:"query_module"},(p=$(function*({workspace_id:e,limit:i=50,offset:t=0}){return C((yield r.modules({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return p.apply(this,arguments)})),a({name:"get_module",description:"Get detailed info and config of a specific module",inputSchema:o({id:A.Yj().describe("Module ID")}),permission:"query_module"},(u=$(function*({workspace_id:e,id:i}){return C((yield r.module({workspaceId:e,id:i})))}),function(e){return u.apply(this,arguments)})),a({name:"update_module_info",description:"Update a specific module info",inputSchema:o({id:A.Yj().describe("Module ID"),name:A.Yj().describe("Module name"),description:A.Yj().describe("Module description")}),permission:"update_module"},(m=$(function*({workspace_id:e,id:i,name:t,description:n}){return C((yield r.updateModule({workspaceId:e,id:i,name:t,description:n})))}),function(e){return m.apply(this,arguments)})),a({name:"update_module_config",description:"Update a specific module configuration",inputSchema:o({id:A.Yj().describe("Module ID"),config:A.Ik({}).passthrough().describe("New configuration object, see file://docs/config-schema.md for schema reference")}),permission:"update_module"},(v=$(function*({workspace_id:e,id:i,config:t}){var n=yield q(t);if(!n.valid)throw Error(`Config validation failed: ${n.errors.join(", ")}`);return C((yield r.updateModule({workspaceId:e,id:i,config:JSON.stringify(t),validateConfig:!0})))}),function(e){return v.apply(this,arguments)})),a({name:"get_devices",description:"List all devices in the workspace",inputSchema:o({limit:A.ai().describe("Maximum number of devices to return").optional().default(50),offset:A.ai().describe("Number of devices to skip").optional().default(0)}),permission:"query_device"},(h=$(function*({workspace_id:e,limit:i=50,offset:t=0}){return C((yield r.devices({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return h.apply(this,arguments)})),a({name:"create_application",description:"Create a new BRICKS application with default grid layout",inputSchema:o({name:A.Yj().describe("Application name"),description:A.Yj().describe("Application description").optional(),grid_width:A.ai().describe("Grid width in units").optional().default(96),grid_height:A.ai().describe("Grid height in units").optional().default(54)}),permission:"create_application"},(b=$(function*({workspace_id:e,name:i,description:t,grid_width:n,grid_height:a}){return C((yield r.createApplication({workspaceId:e,name:i,description:t,gridWidth:n,gridHeight:a})))}),function(e){return b.apply(this,arguments)})),a({name:"update_application_info",description:"Update application info",inputSchema:{id:A.Yj().describe("Application ID"),name:A.Yj().describe("Application name"),description:A.Yj().describe("Application description")},permission:"update_application"},(I=$(function*({id:e,name:i,description:t}){return C((yield r.updateApplication({id:e,name:i,description:t})))}),function(e){return I.apply(this,arguments)})),a({name:"update_application_config",description:"Update application configuration with validation",inputSchema:{id:A.Yj().describe("Application ID"),config:A.Ik({}).passthrough().describe("New application configuration. Please read `getting-started` for BRICKS concepts before changing")},permission:"update_application"},(k=$(function*({id:e,config:i}){var t=yield q(i);if(!t.valid)throw Error(`Config validation failed: ${t.errors.join(", ")}`);return C((yield r.updateApplication({id:e,config:JSON.stringify(i)})))}),function(e){return k.apply(this,arguments)})),a({name:"bind_application",description:"Bind application to device with viewport configuration",inputSchema:{app_id:A.Yj().describe("Application ID"),viewports:A.YO(A.Ik({device_id:A.Yj().describe("Device ID"),x:A.ai().describe("X coordinate"),y:A.ai().describe("Y coordinate"),width:A.ai().describe("Width"),height:A.ai().describe("Height"),rotate:A.ai().describe("Rotation"),rotateType:A.Yj().describe("Rotation type")})).describe("Viewport configuration")},permission:"bind_application"},(D=$(function*({app_id:e,viewports:i}){return C((yield r.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 D.apply(this,arguments)})),a({name:"unbind_application",description:"Unbind application from device",inputSchema:{app_id:A.Yj().describe("Application ID"),device_id:A.Yj().describe("Device ID")},permission:"bind_application"},(S=$(function*({app_id:e,device_id:i}){return C((yield r.bindApplication({id:e,unbindDevices:[i]})))}),function(e){return S.apply(this,arguments)})),n&&a({name:"list_media_workspaces",description:"List all media workspaces",inputSchema:{},permission:"query_media_flow"},$(function*(){return C((yield s.mediaWorkspaces()))})),a({name:"get_media_workspace",description:"Get media workspace information and status",inputSchema:o({}),permission:"query_media_flow"},(E=$(function*({workspace_id:e}){return C((yield s.mediaWorkspace({workspaceId:e})))}),function(e){return E.apply(this,arguments)})),a({name:"list_media_boxes",description:"List all media boxes in the workspace",inputSchema:o({}),permission:"query_media_flow"},(U=$(function*({workspace_id:e}){return C((yield s.mediaBoxes({workspaceId:e})))}),function(e){return U.apply(this,arguments)})),a({name:"get_media_box",description:"Get detailed information about a specific media box",inputSchema:{box_id:A.Yj().describe("Media box ID")},permission:"query_media_flow"},(M=$(function*({box_id:e}){return C((yield s.mediaBox({boxId:e})))}),function(e){return M.apply(this,arguments)})),a({name:"list_media_files",description:"List media files in a specific box with filtering options",inputSchema:{box_id:A.Yj().describe("Media box ID"),include_types:A.YO(A.Yj()).optional().describe('Filter by file types (e.g., ["image", "video", "audio"])'),user_tags:A.YO(A.Yj()).optional().describe("Filter by user tags"),limit:A.ai().optional().default(50).describe("Maximum number of files to return"),offset:A.ai().optional().default(0).describe("Number of files to skip")},permission:"query_media_flow"},(R=$(function*({box_id:e,include_types:i,user_tags:t,limit:n,offset:a}){return C((yield s.mediaFiles({boxId:e,includeTypes:i,userTags:t,limit:n,offset:a})))}),function(e){return R.apply(this,arguments)})),a({name:"get_media_file_meta",description:"Get detailed information about a specific media file",inputSchema:{file_id:A.Yj().describe("Media file ID")},permission:"query_media_flow"},(P=$(function*({file_id:e}){return C((yield s.mediaFile({fileId:e})))}),function(e){return P.apply(this,arguments)})),a({name:"media_box_upload",description:"Upload a file to a media box from URL or base64 data",inputSchema:{box_id:A.Yj().describe("Target media box ID"),name:A.Yj().describe("File name"),description:A.Yj().optional().default("").describe("File description"),file_type:A.k5(["image","video","audio","file"]).describe("File type"),source_url:A.Yj().optional().describe("URL to download the file from"),base64_data:A.Yj().optional().describe("Base64 encoded file data"),user_tags:A.YO(A.Yj()).optional().default([]).describe("User-defined tags for the file")},permission:"write_media_flow"},(O=$(function*({box_id:e,name:i,description:t,source_url:a,base64_data:o,file_type:r,user_tags:d}){if(!a&&!o)throw Error("Either source_url or base64_data must be provided");if(a&&o)throw Error("Provide either source_url OR base64_data, not both");var c=a?null:"application/octet-stream",l=a?yield(0,x.Ay)(a,{agent:(0,B.fJ)(a)}).then(e=>(c=e.headers.get("content-type")||"application/octet-stream",e.blob())):new Blob([w.Buffer.from(o,"base64")],{type:c}),p=yield s.requestFileUpload({name:i,description:t,boxId:e,fileType:n?r.toUpperCase():r,contentType:c,userTags:d,meta:{}}),u=!1;try{var m=JSON.parse(p?.meta.uploadInfo),_=new FormData;_.append("file",l),_.append("Content-Type",c),_.append("AWSAccessKeyId",m.AWSAccessKeyId),_.append("Signature",m.Signature),_.append("Policy",m.Policy),_.append("acl",m.acl),_.append("key",m.key),u=yield(0,x.Ay)(m.url,{method:"POST",body:_}).then(e=>e.ok).catch(()=>!1)}catch{u=!1}return C({file_id:p.id,upload_success:u,upload_info:{content_type:c,file_type:r,source_type:a?"url":"base64",processing_note:"File will be processed automatically. Use get_media_file to check processing status."}})}),function(e){return O.apply(this,arguments)})),a({name:"update_media_file_meta",description:"Update media file information",inputSchema:{file_id:A.Yj().describe("Media file ID"),name:A.Yj().optional().describe("New file name"),description:A.Yj().optional().describe("New file description"),user_tags:A.YO(A.Yj()).optional().describe("New user tags")},permission:"write_media_flow"},(F=$(function*({file_id:e,name:i,description:t,user_tags:n}){return C((yield s.updateMediaFile({fileId:e,name:i,description:t,userTags:n,requestUploadAgain:!1})))}),function(e){return F.apply(this,arguments)})),a({name:"copy_media_files",description:"Copy media files from one box to another",inputSchema:{from_box_id:A.Yj().describe("Source media box ID"),to_box_id:A.Yj().describe("Target media box ID"),file_ids:A.YO(A.Yj()).describe("Array of media file IDs to copy")},permission:"write_media_flow"},(N=$(function*({from_box_id:e,to_box_id:i,file_ids:t}){return C((yield s.copyMediaFiles({fromBoxId:e,toBoxId:i,list:t})))}),function(e){return N.apply(this,arguments)})),a({name:"delete_media_files",description:"Delete specific media files from a box",inputSchema:{box_id:A.Yj().describe("Media box ID"),file_ids:A.YO(A.Yj()).describe("Array of media file IDs to delete")},permission:"write_media_flow"},(W=$(function*({box_id:e,file_ids:i}){return C((yield s.deleteMediaFiles({boxId:e,list:i})))}),function(e){return W.apply(this,arguments)})),a({name:"cleanup_media_box",description:"Delete all files in a media box, optionally filtered by type",inputSchema:{box_id:A.Yj().describe("Media box ID"),include_types:A.YO(A.Yj()).optional().describe('Only delete files of these types (e.g., ["image", "video"])')},permission:"write_media_flow"},(j=$(function*({box_id:e,include_types:i}){if("deleteMediaBoxFiles"in s)return C((yield s.deleteMediaBoxFiles({boxId:e,includeTypes:i})));var t=yield s.mediaFiles({boxId:e,includeTypes:i});return C((yield s.deleteMediaFiles({boxId:e,list:t.map(e=>e.id)})))}),function(e){return j.apply(this,arguments)})),e.tool("calculate_grid_layout","Calculate grid layout and pixel conversions for different device resolutions",{device_width:A.ai().describe("Device width in pixels"),device_height:A.ai().describe("Device height in pixels"),app_grid_width:A.ai().describe("Application grid width").optional().default(96),app_grid_height:A.ai().describe("Application grid height").optional().default(54)},(V=$(function*({device_width:e,device_height:i,app_grid_width:t,app_grid_height:n}){var a,o=(a=e/t,{deviceBrickWidth:e/a,deviceBrickHeight:i/a,deviceBrickUnit:a}),r=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 C({device_resolution:{width:e,height:i,aspect_ratio:(e/i).toFixed(2)},current_grid:{width:t,height:n,unit_size_px:o.deviceBrickUnit.toFixed(2),total_pixels:{width:o.deviceBrickWidth.toFixed(2),height:o.deviceBrickHeight.toFixed(2)}},recommended_grid:{width:r.deviceBrickWidth,height:r.deviceBrickHeight,unit_size_px:r.deviceBrickUnit.toFixed(2),note:"Optimized for device aspect ratio"}})}),function(e){return V.apply(this,arguments)})),e.tool("create_item","Use this tool to create new item that you can put in application configuration",{type:A.k5(["subspace","canvas","brick","generator","property_bank","property_bank_calc","property_bank_command","animation","state_group","automation_map"]).describe("Item type"),title:A.Yj().describe("Item title"),template_key:A.Yj().optional().describe("Template key for brick or generator")},tH),e.tool("getting_started","Get documentation content for getting started",{},$(function*(){return C(z)})),!n){var d,c,l,p,u,m,v,h,b,I,k,D,S,E,U,M,R,P,O,F,N,W,j,V,K,Y,G,L=()=>new tY(tL.activityLog,i.token);a({name:"activity_log_events",description:"Query activity log events. Returns raw events (general, data, local_sync) with filtering. Max 30-day range.",inputSchema:o({start_time:A.Yj().describe("Start time (ISO 8601)"),end_time:A.Yj().describe("End time (ISO 8601)"),device_id:A.Yj().optional().describe("Filter by device ID"),event_type:A.k5(["general","data","local_sync"]).optional().describe("Filter by event type"),event_name:A.Yj().optional().describe("Filter by event name (e.g. BRICK_xxx_ON_PRESS)"),subspace_id:A.Yj().optional().describe("Filter by subspace ID"),sender:A.Yj().optional().describe("Filter by sender"),limit:A.ai().optional().default(50).describe("Max events to return per page"),offset:A.ai().optional().default(0).describe("Number of events to skip (for pagination)")}),permission:"query_activity_log"},(K=$(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};return t&&(l.device_id=t),n&&(l.event_type=n),a&&(l.event_name=a),o&&(l.subspace_id=o),r&&(l.sender=r),C((yield c.events(l,{limit:s,offset:d})))}),function(e){return K.apply(this,arguments)})),a({name:"activity_log_screenshots",description:"List available screenshot timestamps for a device in a time range.",inputSchema:o({device_id:A.Yj().describe("Device ID (required)"),start_time:A.Yj().describe("Start time (ISO 8601)"),end_time:A.Yj().describe("End time (ISO 8601)")}),permission:"query_activity_log"},(Y=$(function*({device_id:e,start_time:i,end_time:t}){var n=L();return C((yield n.screenshots({device_id:e,start_time:i,end_time:t})))}),function(e){return Y.apply(this,arguments)})),a({name:"activity_log_screenshot",description:"Download a device screenshot at a specific timestamp. Returns JPEG image as blob.",inputSchema:o({device_id:A.Yj().describe("Device ID"),ts:A.Yj().describe("Screenshot timestamp (ISO 8601 or epoch ms)")}),permission:"query_activity_log"},(G=$(function*({workspace_id:e,device_id:t,ts:n}){var a=e||i.tokenInfo?.w_id;if(!a)throw Error("Could not determine workspace ID");var o=L(),r=/^\d+$/.test(n)?n:new Date(n).getTime();return C((yield o.downloadScreenshot(a,t,r)),{mimeType:"image/jpeg"})}),function(e){return G.apply(this,arguments)}))}a({name:"get_device_usage",description:"Get device usage metrics (uptime, memory, disk) for a date range. Data from BRICKS main server.",inputSchema:o({device_id:A.Yj().describe("Device ID"),start_date:A.Yj().optional().describe("Start date/time in ISO 8601 format (default: start of today)"),end_date:A.Yj().optional().describe("End date/time in ISO 8601 format (default: now)")}),permission:"query_device"},(t=$(function*({device_id:e,start_date:i,end_date:t}){var n=new Date,a=new Date(n.getFullYear(),n.getMonth(),n.getDate()).toISOString();return C((yield r.deviceUsage({deviceId:e,startDate:i?new Date(i).toISOString():a,endDate:t?new Date(t).toISOString():n.toISOString()})))}),function(e){return t.apply(this,arguments)}))}(a,o);var r=new h.S;try{yield a.connect(r),console.error("BRICKS MCP Server running on STDIO"),console.error(`Server: ${tG} v${tJ}`),console.error(`Token Type: ${n.tokenType}`),console.error(`Permissions: ${n.tokenInfo.permissions.join(", ")}`),console.error("Ready to accept requests...")}catch(e){throw console.error("Failed to start MCP server:",e),e}})).apply(this,arguments)}}};