@fugood/bricks-cli 2.26.0-beta.4 → 2.26.0-beta.41

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/9439.js ADDED
@@ -0,0 +1,2670 @@
1
+ export const __rspack_esm_id=9439;export const __rspack_esm_ids=[9439];export const __webpack_modules__={4376(e,i){i.k=(e,i,t)=>{let n=i/e;return{deviceBrickWidth:i/n,deviceBrickHeight:t/n,deviceBrickUnit:n}};let t=96;i.Y=(e,i,n=t)=>{let a=e/n;return i>e&&(a=i/n),{deviceBrickWidth:Math.round(e/a),deviceBrickHeight:Math.round(i/a),deviceBrickUnit:a}}},70114(e,i,t){t.r(i),t.d(i,{startStdioServer:()=>np});var n,a,o,r,s,d,c,l,p,u={};t.r(u),t.d(u,{applicationFragment:()=>ef,applicationShortFragment:()=>eD,deviceApplicationStatusFragment:()=>eu,deviceDetailFragment:()=>e_,deviceFragment:()=>em,deviceGroupFragment:()=>eg,deviceShortFragment:()=>ew,instanceVersionFragment:()=>eh,mediaBoxFragment:()=>eC,mediaFileFragment:()=>eT,mediaWorkspaceFragment:()=>eS,moduleFragment:()=>e$,moduleShortFragment:()=>ev,operationFragment:()=>eb,publicApplicationBasicInfoFragment:()=>ey,userFavoriteFragment:()=>eI,workspaceFragment:()=>ek,workspaceShortFragment:()=>eA});var m={};t.r(m),t.d(m,{application:()=>ez,applicationByDevice:()=>eq,applicationReleaseVersion:()=>eP,applicationReleaseVersions:()=>eR,applicationTestsByDevice:()=>ej,applications:()=>eL,checkBindDevicePasscode:()=>eW,deviceUsage:()=>eQ,devices:()=>eX,devicesByGroup:()=>eH,devicesByUniqueId:()=>eV,me:()=>eE,module:()=>eJ,moduleReleaseVersion:()=>eN,moduleReleaseVersions:()=>eF,modules:()=>eU,publicModules:()=>eO,publicModulesByIdList:()=>eM,workspace:()=>eK,workspacePricingPlans:()=>eY,workspaces:()=>eG});var _={};t.r(_),t.d(_,{addUserFavorite:()=>iB,assignGroupPermissions:()=>iS,bindApplication:()=>id,bindApplicationWithDeviceGroup:()=>ip,changeWorkspaceAdditionalLimitSpending:()=>iO,changeWorkspaceSubscriptionPlan:()=>iU,controlDevice:()=>e7,createApplication:()=>ir,createApplicationWithShareVersion:()=>is,createConfigChangeOperation:()=>ik,createDevice:()=>e6,createDeviceGroup:()=>ie,createDeviceGroupWithApp:()=>i_,createModule:()=>i$,createVirtualDevice:()=>e5,createWorkspace:()=>e0,createWorkspaceOTP:()=>iM,dispatchDeviceGroupAction:()=>it,doOperation:()=>iA,duplicateApplication:()=>ig,duplicateModule:()=>ib,forkApplication:()=>iF,moveApplication:()=>im,moveDevice:()=>e9,moveModule:()=>ih,registerFCMNotification:()=>iC,registerRemoteDebug:()=>iT,removeApplication:()=>iy,removeDevice:()=>e8,removeDeviceGroup:()=>ia,removeModule:()=>iI,removeOperation:()=>iw,removeUserFavorite:()=>iE,removeWorkspace:()=>io,revokeWorkspaceOTP:()=>iR,shareAccessToken:()=>ix,shareApplication:()=>iu,toggleShortEditApplication:()=>ic,updateApplication:()=>iP,updateApplicationViewportPreset:()=>il,updateDevice:()=>e2,updateDeviceGroup:()=>ii,updateModule:()=>iv,updateOperation:()=>iD,updateVirtualDevice:()=>e3,updateWorkspace:()=>e1,updateWorkspaceTokens:()=>e4});var g={};t.r(g),t.d(g,{application:()=>iH,applicationByDevice:()=>iY,applications:()=>iV,device:()=>iz,deviceUsage:()=>iX,devices:()=>iL,devicesByApplication:()=>iJ,mediaBox:()=>i0,mediaBoxes:()=>iZ,mediaFile:()=>i4,mediaFiles:()=>i1,mediaWorkspace:()=>iQ,module:()=>iG,modules:()=>iK,workspace:()=>iW});var f={};t.r(f),t.d(f,{bindApplication:()=>i9,copyMediaFiles:()=>ta,createApplication:()=>i6,createModule:()=>i8,deleteMediaBoxFiles:()=>tr,deleteMediaFiles:()=>to,forkApplication:()=>i2,requestFileUpload:()=>te,setMediaFileAsBoxPreview:()=>tn,unbindApplication:()=>i3,updateApplication:()=>i5,updateMediaFile:()=>ti,updateMediaFiles:()=>tt,updateModule:()=>i7});var y={};t.r(y),t.d(y,{mediaBox:()=>tM,mediaBoxes:()=>tU,mediaFile:()=>tP,mediaFiles:()=>tR,mediaWorkspace:()=>tO,mediaWorkspaces:()=>tE});var $={};t.r($),t.d($,{assignGroupPermissions:()=>tz,copyMediaFiles:()=>tG,createMediaBox:()=>tq,createMediaWorkspace:()=>tF,deleteMediaFiles:()=>tK,moveMediaBox:()=>tj,requestFileUpload:()=>tV,setMediaFileAsBoxPreview:()=>tL,updateMediaBox:()=>tW,updateMediaFile:()=>tH,updateMediaFiles:()=>tY,updateMediaWorkspace:()=>tN});var v={};t.r(v),t.d(v,{mediaBox:()=>tX,mediaFile:()=>tZ,mediaFiles:()=>tQ});var h={};t.r(h),t.d(h,{deleteMediaFiles:()=>t6,requestFileUpload:()=>t0,updateMediaFile:()=>t1,updateMediaFiles:()=>t4});var b=t(99436),I=t(42820),k=t(66029),A={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_blueprint:"qbp",write_blueprint:"wbp",query_media_flow:"qmf",write_media_flow:"wmf",access_unstable_feature:"UNSTABLE"},D=Object.entries(A).reduce((e,[i,t])=>(e[t]=i,e),{}),w=["HS256","RS256"],S=["https://auth0.bricks.tools/","https://mybigday.auth0.com/"],C=e=>S.includes(e?.iss),T=t(84867);let x='# 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 B=t(68832),E=t(20181),U=t(79657),O=t(79861),M=t(4376),R=t(46123),P=t(80211),F=t(45907),N=t(99548),q=t(96423),j=P.ajv.getSchema("http://display.bricks.tools/root.schema.json5"),W=(0,q.A)(["subspace_map.*.property_bank_calc_map.*.script_config"]),V=e=>e&&"object"==typeof e?e:{};function H(e){var i=[];try{var t=P(e);i.push(...(0,N.L)({errors:t,schema:j,data:e}).map(({path:e,message:i})=>`${e}: ${i}`));try{i.push(...F(e).map(({field:e,message:i})=>`${e}: ${i}`))}catch(e){i.push(`Component reference validation failed: ${e.message}`)}return W(e).forEach(t=>{var n=t.slice(0,-1),a=R(e,n),o=n.join("."),r=V(a?.map),s=V(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=V(d),m=V(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).flat().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 Y=t(49741),K=t(63981),G=(e,i="en-us")=>"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,"object"!=typeof t||null===t||Array.isArray(t)?t:t[i]??G(t,i)])):e,L=G(Y.t),z=Object.entries(Y.systemActions).map(([e,{propertyNameType:i,property:t}])=>` - \`${e}\`: ${L[e]}
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"),J=Object.keys(K.brickMapping).map(e=>`- \`${e}\``).join("\n"),X=Object.keys(K.generatorMapping).map(e=>`- \`${e}\``).join("\n");let Q=x.replace("[:SYSTEM_ACTIONS:]",z).replace("[:BRICK_IDS:]",J).replace("[:GENERATOR_IDS:]",X);var Z=(e,i={})=>({content:[E.Buffer.isBuffer(e)?{...i,data:e.toString("base64"),type:"image"}:{...i,text:"string"==typeof e?e:JSON.stringify(e,null,2),type:"text"}],isError:!1}),ee=e=>e?.tokenType==="user"||C(e?.tokenInfo),ei=t(44668),et=t(5018),en=t(63315),ea=t(30409),eo=t(40906),er=t(79760),es=t(22268),ed=t(7068),ec=t(26197),el=t(94370);let ep=(0,el.default)`
4
+ fragment workspaceArguments on Workspace {
5
+ __typename
6
+ _id
7
+ owner {
8
+ _id
9
+ id_from_user
10
+ }
11
+ name
12
+ description
13
+ bank {
14
+ enable_remote_update
15
+ spacename
16
+ keys
17
+ }
18
+ media_resource {
19
+ enable_media_workspace
20
+ workspace_id
21
+ system_media_box_id
22
+ system_media_box_passcode
23
+ editor_upload_binding {
24
+ box_id
25
+ box_passcode
26
+ }
27
+ }
28
+ emails {
29
+ address
30
+ verified
31
+ date
32
+ }
33
+ notification_messages {
34
+ _id
35
+ type
36
+ custom_message
37
+ id
38
+ name
39
+ date
40
+ read
41
+ }
42
+ auth {
43
+ tokens {
44
+ _id
45
+ name
46
+ enable_expired
47
+ expired_at
48
+ created_at
49
+ types
50
+ }
51
+ }
52
+ billing {
53
+ plan {
54
+ type
55
+ period
56
+ }
57
+ lock {
58
+ features
59
+ additional_resources
60
+ }
61
+ subscription {
62
+ status
63
+ last_active_at
64
+ billing_cycle_anchor
65
+ current_period_end
66
+ }
67
+ subscription_schedule {
68
+ status
69
+ next_plan_type
70
+ next_plan_period
71
+ next_plan_start_date
72
+ }
73
+ additional_subscription {
74
+ status
75
+ last_active_at
76
+ billing_cycle_anchor
77
+ current_period_end
78
+ }
79
+ additional_limit_spending {
80
+ devices
81
+ media
82
+ group
83
+ }
84
+ }
85
+ create_datetime
86
+ last_modify_datetime
87
+ last_modify_records {
88
+ type
89
+ query_name
90
+ instance_id
91
+ token_name
92
+ meta
93
+ updated_at
94
+ }
95
+ }
96
+ `,eu=(0,el.default)`
97
+ fragment deviceApplicationStatusArguments on DeviceApplicationStatus {
98
+ status
99
+ reason
100
+ assigned {
101
+ application_id
102
+ name
103
+ config_timestamp
104
+ commit_id
105
+ lazy_update
106
+ }
107
+ reported {
108
+ _id
109
+ name
110
+ config_timestamp
111
+ commit_id
112
+ state
113
+ error_stage
114
+ error_code
115
+ error_message
116
+ ready {
117
+ config_timestamp
118
+ commit_id
119
+ }
120
+ }
121
+ reported_at
122
+ confirmed_at
123
+ }
124
+ `,em=(0,el.default)`
125
+ fragment deviceArguments on Device {
126
+ __typename
127
+ _id
128
+ create_datetime
129
+ last_modify_datetime
130
+ last_modify_records {
131
+ type
132
+ query_name
133
+ instance_id
134
+ token_name
135
+ meta
136
+ updated_at
137
+ }
138
+ name
139
+ device_name
140
+ description
141
+ tags
142
+ entry_detail {
143
+ unique_id
144
+ operation_version
145
+ type
146
+ operation_mode
147
+ update {
148
+ current_version
149
+ last_update_at
150
+ }
151
+ watch_dog_timer {
152
+ alive
153
+ last_launch_time
154
+ prev_last_launch_time
155
+ last_alive_time
156
+ threshold
157
+ }
158
+ screen {
159
+ title
160
+ master
161
+ orientation
162
+ resolution {
163
+ width
164
+ height
165
+ scale
166
+ fontScale
167
+ }
168
+ touch {
169
+ available
170
+ touch_point
171
+ }
172
+ }
173
+ local_sync {
174
+ is_main
175
+ peer_count
176
+ mean_latency
177
+ }
178
+ application {
179
+ _id
180
+ name
181
+ config_timestamp
182
+ }
183
+ memory_usage
184
+ disk_usage
185
+ }
186
+ owner {
187
+ _id
188
+ id_from_user
189
+ }
190
+ used_workspace {
191
+ _id
192
+ name
193
+ emails {
194
+ address
195
+ verified
196
+ }
197
+ billing {
198
+ plan {
199
+ type
200
+ period
201
+ }
202
+ lock {
203
+ features
204
+ }
205
+ }
206
+ }
207
+ bound_application {
208
+ _id
209
+ name
210
+ }
211
+ alert {
212
+ enabled
213
+ time_range
214
+ days_of_week {
215
+ sun
216
+ mon
217
+ tues
218
+ weds
219
+ thurs
220
+ fri
221
+ satur
222
+ }
223
+ }
224
+ activity_log {
225
+ enabled
226
+ filter
227
+ screenshot_enabled
228
+ }
229
+ local_sync {
230
+ enabled
231
+ priority_as_main
232
+ disable_dynamic_latency
233
+ latency_offset
234
+ }
235
+ preload {
236
+ disabled
237
+ skip_on_failure
238
+ force_md5_match
239
+ retry_attempt_for_failure
240
+ skip_integrity_check
241
+ }
242
+ auth {
243
+ type
244
+ tokens {
245
+ _id
246
+ name
247
+ enable_expired
248
+ expired_at
249
+ created_at
250
+ allowed_in_url_query
251
+ types
252
+ }
253
+ ip_address_allowlist
254
+ ip_address_blocklist
255
+ access_accounts {
256
+ username
257
+ }
258
+ }
259
+ application_update {
260
+ lazy_update
261
+ }
262
+ lock {
263
+ enabled
264
+ }
265
+ enable_web_lan_discovery
266
+ env {
267
+ variables
268
+ virtual_dev_url_query {
269
+ env_prefix
270
+ enable_unsafe_encryption
271
+ encryption_algorithm
272
+ encryption_key
273
+ encryption_iv
274
+ }
275
+ }
276
+ }
277
+ `,e_=(0,el.default)`
278
+ fragment deviceDetailArguments on Device {
279
+ advanced_setting {
280
+ offline_indicator
281
+ }
282
+ application_status {
283
+ ...deviceApplicationStatusArguments
284
+ }
285
+ }
286
+ ${eu}
287
+ `,eg=(0,el.default)`
288
+ fragment deviceGroupArguments on DeviceGroup {
289
+ __typename
290
+ _id
291
+ create_datetime
292
+ last_modify_datetime
293
+ last_modify_records {
294
+ type
295
+ query_name
296
+ instance_id
297
+ token_name
298
+ meta
299
+ updated_at
300
+ }
301
+ name
302
+ description
303
+ owner {
304
+ _id
305
+ id_from_user
306
+ }
307
+ used_workspace {
308
+ _id
309
+ billing {
310
+ plan {
311
+ type
312
+ period
313
+ }
314
+ lock {
315
+ features
316
+ }
317
+ }
318
+ }
319
+ tags
320
+ devices {
321
+ device_id
322
+ device_target_name
323
+ }
324
+ }
325
+ `,ef=(0,el.default)`
326
+ fragment applicationArguments on Application {
327
+ __typename
328
+ _id
329
+ owner {
330
+ _id
331
+ id_from_user
332
+ }
333
+ lock {
334
+ enabled
335
+ }
336
+ id_for_devices
337
+ devices {
338
+ device_id
339
+ frame
340
+ run_test
341
+ cron_tests {
342
+ test_id
343
+ update_screenshot
344
+ cron
345
+ date_range {
346
+ start
347
+ end
348
+ }
349
+ bind_id
350
+ }
351
+ # The App page keeps this response as the App, and its next Bind devices save sends these
352
+ # flags back: a flag not read here would be sent as the default (true)
353
+ short_edit
354
+ canvas_control
355
+ device_control
356
+ env
357
+ }
358
+ secrets {
359
+ _id
360
+ property_id
361
+ name
362
+ description
363
+ date
364
+ }
365
+ viewport_presets {
366
+ _id
367
+ name
368
+ viewports {
369
+ detail
370
+ device_target_name
371
+ run_test
372
+ cron_tests {
373
+ test_id
374
+ update_screenshot
375
+ }
376
+ }
377
+ run_test
378
+ cron_tests {
379
+ test_id
380
+ update_screenshot
381
+ }
382
+ sync_key
383
+ separate_local_sync
384
+ }
385
+ used_workspace {
386
+ _id
387
+ name
388
+ billing {
389
+ plan {
390
+ type
391
+ period
392
+ }
393
+ lock {
394
+ features
395
+ }
396
+ }
397
+ }
398
+ dev_ref {
399
+ is_dev
400
+ parent_application
401
+ }
402
+ name
403
+ description
404
+ config
405
+ short_edit {
406
+ enabled
407
+ use_unstable_features
408
+ }
409
+ canvas_control {
410
+ enabled
411
+ use_unstable_features
412
+ }
413
+ device_control {
414
+ enabled
415
+ use_unstable_features
416
+ }
417
+ has_unreleased_changes
418
+ create_datetime
419
+ last_modify_datetime
420
+ last_modify_records {
421
+ type
422
+ query_name
423
+ instance_id
424
+ token_name
425
+ meta
426
+ updated_at
427
+ }
428
+ current_version
429
+ share {
430
+ description
431
+ tags
432
+ type
433
+ usage
434
+ create_records {
435
+ total_count
436
+ # records
437
+ }
438
+ favorite {
439
+ enabled
440
+ total_count
441
+ }
442
+ preview {
443
+ enabled
444
+ }
445
+ selected_releases {
446
+ _id
447
+ version
448
+ name
449
+ note
450
+ date
451
+ used_modules
452
+ used_media_flow_generators
453
+ used_global_remote_property_bank
454
+ used_secrets
455
+ }
456
+ screenshot {
457
+ type
458
+ screenshot_payload
459
+ last_screenshot_id
460
+ }
461
+ create_settings {
462
+ module_auto_destructure
463
+ }
464
+ }
465
+ screenshot {
466
+ type
467
+ screenshot_payload
468
+ last_screenshot_id
469
+ }
470
+ ai_filters {
471
+ name
472
+ description
473
+ instruction
474
+ variable_keys
475
+ model_provider
476
+ scope
477
+ }
478
+ }
479
+ `,ey=(0,el.default)`
480
+ fragment publicApplicationBasicInfoArguments on PublicApplicationBasicInfo {
481
+ _id
482
+ owner {
483
+ _id
484
+ id_from_user
485
+ }
486
+ name
487
+ description
488
+ share {
489
+ description
490
+ tags
491
+ type
492
+ usage
493
+ preview {
494
+ enabled
495
+ }
496
+ create_records {
497
+ total_count
498
+ # records
499
+ }
500
+ favorite {
501
+ enabled
502
+ total_count
503
+ }
504
+ selected_releases {
505
+ _id
506
+ version
507
+ name
508
+ note
509
+ date
510
+ used_modules
511
+ used_media_flow_generators
512
+ used_global_remote_property_bank
513
+ used_secrets
514
+ }
515
+ screenshot {
516
+ last_screenshot_id
517
+ }
518
+ create_settings {
519
+ module_auto_destructure
520
+ }
521
+ }
522
+ }
523
+ `,e$=(0,el.default)`
524
+ fragment moduleArguments on Module {
525
+ __typename
526
+ _id
527
+ create_datetime
528
+ last_modify_datetime
529
+ last_modify_records {
530
+ type
531
+ query_name
532
+ instance_id
533
+ token_name
534
+ meta
535
+ updated_at
536
+ }
537
+ owner {
538
+ _id
539
+ id_from_user
540
+ }
541
+ name
542
+ description
543
+ tags
544
+ config
545
+ current_version
546
+ expose_properties
547
+ is_allow_modify
548
+ is_public
549
+ used_workspace {
550
+ _id
551
+ billing {
552
+ plan {
553
+ type
554
+ period
555
+ }
556
+ lock {
557
+ features
558
+ }
559
+ }
560
+ }
561
+ screenshot {
562
+ type
563
+ screenshot_payload
564
+ last_screenshot_id
565
+ }
566
+ }
567
+ `,ev=(0,el.default)`
568
+ fragment moduleShortArguments on Module {
569
+ __typename
570
+ _id
571
+ create_datetime
572
+ last_modify_datetime
573
+ owner {
574
+ _id
575
+ id_from_user
576
+ }
577
+ name
578
+ description
579
+ tags
580
+ current_version
581
+ expose_properties
582
+ is_allow_modify
583
+ is_public
584
+ used_workspace {
585
+ _id
586
+ }
587
+ screenshot {
588
+ last_screenshot_id
589
+ }
590
+ }
591
+ `,eh=(0,el.default)`
592
+ fragment instanceVersionArguments on ConfigVersion {
593
+ __typename
594
+ _id
595
+ create_datetime
596
+ last_modify_datetime
597
+ version
598
+ note
599
+ instance_id
600
+ entry
601
+ }
602
+ `,eb=(0,el.default)`
603
+ fragment operationArguments on Operation {
604
+ __typename
605
+ _id
606
+ creator
607
+ application
608
+ create_datetime
609
+ last_modify_datetime
610
+ passcode
611
+ type
612
+ expired_datetime
613
+ payload
614
+ }
615
+ `,eI=(0,el.default)`
616
+ fragment userFavoriteArguments on UserFavorite {
617
+ _id
618
+ instance_type
619
+ instance {
620
+ _id
621
+ name
622
+ description
623
+ }
624
+ last_modify_datetime
625
+ }
626
+ `;var ek=(0,el.default)`
627
+ fragment mcpWorkspaceArguments on Workspace {
628
+ __typename
629
+ _id
630
+ owner {
631
+ _id
632
+ id_from_user
633
+ }
634
+ name
635
+ description
636
+ bank {
637
+ enable_remote_update
638
+ spacename
639
+ keys
640
+ }
641
+ media_resource {
642
+ enable_media_workspace
643
+ workspace_id
644
+ system_media_box_id
645
+ system_media_box_passcode
646
+ editor_upload_binding {
647
+ box_id
648
+ box_passcode
649
+ }
650
+ }
651
+ emails {
652
+ address
653
+ verified
654
+ date
655
+ }
656
+ notification_messages {
657
+ _id
658
+ type
659
+ custom_message
660
+ id
661
+ name
662
+ date
663
+ read
664
+ }
665
+ billing {
666
+ plan {
667
+ type
668
+ period
669
+ }
670
+ lock {
671
+ features
672
+ additional_resources
673
+ }
674
+ subscription {
675
+ status
676
+ last_active_at
677
+ billing_cycle_anchor
678
+ current_period_end
679
+ }
680
+ subscription_schedule {
681
+ status
682
+ next_plan_type
683
+ next_plan_period
684
+ next_plan_start_date
685
+ }
686
+ additional_subscription {
687
+ status
688
+ last_active_at
689
+ billing_cycle_anchor
690
+ current_period_end
691
+ }
692
+ additional_limit_spending {
693
+ devices
694
+ media
695
+ group
696
+ }
697
+ }
698
+ create_datetime
699
+ last_modify_datetime
700
+ last_modify_records {
701
+ type
702
+ query_name
703
+ instance_id
704
+ token_name
705
+ meta
706
+ updated_at
707
+ }
708
+ }
709
+ `,eA=(0,el.default)`
710
+ fragment mcpWorkspaceShortArguments on Workspace {
711
+ _id
712
+ name
713
+ description
714
+ }
715
+ `,eD=(0,el.default)`
716
+ fragment mcpApplicationShortArguments on Application {
717
+ _id
718
+ name
719
+ description
720
+ }
721
+ `,ew=(0,el.default)`
722
+ fragment mcpDeviceShortArguments on Device {
723
+ _id
724
+ name
725
+ description
726
+ }
727
+ `,eS=(0,el.default)`
728
+ fragment workspaceMediaWorkspaceArguments on MediaFlowWorkspace {
729
+ id
730
+ name
731
+ description
732
+ owner
733
+ serviceBinding
734
+ createdAt
735
+ updatedAt
736
+ size
737
+ sizeLimit
738
+ }
739
+ `,eC=(0,el.default)`
740
+ fragment workspaceMediaBoxArguments on MediaFlowBox {
741
+ id
742
+ name
743
+ description
744
+ tags
745
+ owner
746
+ workspaceId
747
+ serviceBinding
748
+ serviceBindingType
749
+ passcodes {
750
+ id
751
+ name
752
+ code
753
+ enableExpired
754
+ expiredAt
755
+ permissions
756
+ }
757
+ createdAt
758
+ updatedAt
759
+ size
760
+ }
761
+ `,eT=(0,el.default)`
762
+ fragment workspaceMediaFileArguments on MediaFlowFile {
763
+ id
764
+ name
765
+ description
766
+ owner
767
+ boxId
768
+ fileType
769
+ fileSize
770
+ originalKey
771
+ userTags
772
+ versions {
773
+ key
774
+ width
775
+ height
776
+ strategy
777
+ version
778
+ etag
779
+ content_type
780
+ size
781
+ left
782
+ top
783
+ rotate
784
+ metadata
785
+ copypreview
786
+ }
787
+ previewId
788
+ isPreview
789
+ createdAt
790
+ updatedAt
791
+ meta {
792
+ parentFileId
793
+ storageEndpoint
794
+ originalFileUploaded
795
+ originalFileKey
796
+ originalFileSize
797
+ originalFileEtag
798
+ originalFileContentType
799
+ originalWidth
800
+ originalHeight
801
+ convertedFileUploaded
802
+ convertedFileKey
803
+ convertedFileSize
804
+ convertedFileEtag
805
+ convertedFileContentType
806
+ convertedFileHlsSegmentCount
807
+ videoThumbOriginalFileEtag
808
+ videoThumbOriginalFileContentType
809
+ videoThumbOriginalWidth
810
+ videoThumbOriginalHeight
811
+ videoThumbOriginalFileUploaded
812
+ videoThumbOriginalFileKey
813
+ videoThumbOriginalFileSize
814
+ uploadInfo
815
+ imageVersionRequests {
816
+ strategy
817
+ left
818
+ top
819
+ width
820
+ height
821
+ rotate
822
+ metadata
823
+ copypreview
824
+ }
825
+ allowedBiggerImageVersion
826
+ imageVersionType
827
+ videoTransformedByClient
828
+ videoTransformType
829
+ videoTransformed
830
+ customVideoWidth
831
+ customVideoHeight
832
+
833
+ updateUploadAllowSizeRange
834
+ enableAiAnalysis
835
+ aiCustomInstruction
836
+ aiDescription
837
+ aiTags
838
+ aiAnalysisStatus
839
+ aiAnalyzedAt
840
+ systemTags
841
+ }
842
+ }
843
+ `,ex={query:"query",mutation:"mutate"},eB=ei(function e(i,t,n,a,o){var r,s,d=this;et(this,e),this.baseUrl=i,this.auth="string"==typeof t?{token:t,getHeaders:(r=b(function*(){return{authorization:`Bearer ${t}`}}),function(){return r.apply(this,arguments)})}:t,this.token=this.auth?.token,this.endpoint=n;var c=(0,er.$)({uri:`${i}${n}`}),l=(0,ec.o)((s=b(function*(e,{headers:i}){return{headers:{...i,...d.auth?yield d.auth.getHeaders():{}}}}),function(e,i){return s.apply(this,arguments)}));this.apolloClient=new es.R({link:l.concat(c),cache:new ed.D,defaultOptions:{watchQuery:{errorPolicy:"all",fetchPolicy:"no-cache"},query:{errorPolicy:"all",fetchPolicy:"no-cache"}}}),this.fragments=u,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]=b(function*(a={},o={}){try{var r=e.apolloClient[ex[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=b(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=b(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 eE=(0,el.default)`
844
+ query ControllerClient_me {
845
+ me {
846
+ _id
847
+ id_from_user
848
+ }
849
+ }
850
+ `;(0,el.default)`
851
+ query ControllerClient_module($id: ID!) {
852
+ module(id: $id) {
853
+ ...moduleArguments
854
+ }
855
+ }
856
+ ${e$}
857
+ `;let eU=(0,el.default)`
858
+ query ControllerClient_modules($workspaceId: ID, $limit: Int) {
859
+ modules(workspaceId: $workspaceId, paginate: { limit: $limit }) {
860
+ ...moduleShortArguments
861
+ }
862
+ }
863
+ ${ev}
864
+ `,eO=(0,el.default)`
865
+ query ControllerClient_publicModules($keyword: String!, $limit: Int) {
866
+ publicModules(keyword: $keyword, paginate: { limit: $limit }) {
867
+ ...moduleShortArguments
868
+ }
869
+ }
870
+ ${ev}
871
+ `,eM=(0,el.default)`
872
+ query ControllerClient_publicModulesByIdList($idList: [ID]) {
873
+ publicModulesByIdList(idList: $idList) {
874
+ ...moduleShortArguments
875
+ }
876
+ }
877
+ ${ev}
878
+ `,eR=(0,el.default)`
879
+ query ControllerClient_applicationReleaseVersions($id: ID!) {
880
+ applicationReleaseVersions(id: $id) {
881
+ ...instanceVersionArguments
882
+ }
883
+ }
884
+ ${eh}
885
+ `,eP=(0,el.default)`
886
+ query ControllerClient_applicationReleaseVersion($id: ID!, $versionId: ID!) {
887
+ applicationReleaseVersion(id: $id, versionId: $versionId) {
888
+ ...applicationReleaseVersionArguments
889
+ }
890
+ }
891
+ ${eh}
892
+ `,eF=(0,el.default)`
893
+ query ControllerClient_moduleReleaseVersions($id: ID!) {
894
+ moduleReleaseVersions(id: $id) {
895
+ ...instanceVersionArguments
896
+ }
897
+ }
898
+ ${eh}
899
+ `,eN=(0,el.default)`
900
+ query ControllerClient_moduleReleaseVersion($id: ID!, $versionId: ID!) {
901
+ moduleReleaseVersion(id: $id, versionId: $versionId) {
902
+ ...instanceVersionArguments
903
+ }
904
+ }
905
+ ${eh}
906
+ `,eq=(0,el.default)`
907
+ query ControllerClient_applicationByDevice(
908
+ $deviceId: ID!
909
+ $debug: Boolean
910
+ $composeModule: Boolean
911
+ $bankRemoteConfig: Boolean
912
+ ) {
913
+ applicationByDevice(
914
+ deviceId: $deviceId
915
+ debug: $debug
916
+ composeModule: $composeModule
917
+ bankRemoteConfig: $bankRemoteConfig
918
+ ) {
919
+ ...applicationArguments
920
+ config_tests
921
+ }
922
+ }
923
+ ${ef}
924
+ `,ej=(0,el.default)`
925
+ query ControllerClient_applicationTestsByDevice($deviceId: ID!) {
926
+ applicationTestsByDevice: applicationByDevice(
927
+ deviceId: $deviceId
928
+ debug: true
929
+ composeModule: false
930
+ bankRemoteConfig: false
931
+ ) {
932
+ _id
933
+ name
934
+ config_tests
935
+ }
936
+ }
937
+ `,eW=(0,el.default)`
938
+ query ControllerClient_checkBindDevicePasscode($passcode: String!) {
939
+ checkBindDevicePasscode(passcode: $passcode)
940
+ }
941
+ `,eV=(0,el.default)`
942
+ query ControllerClient_devicesByUniqueId($uniqueID: String!, $unbindApplication: Boolean) {
943
+ devicesByUniqueId(uniqueID: $uniqueID, unbindApplication: $unbindApplication) {
944
+ ...deviceArguments
945
+ }
946
+ }
947
+ ${em}
948
+ `,eH=(0,el.default)`
949
+ query ControllerClient_devicesByGroup($id: ID!) {
950
+ devicesByGroup(id: $id) {
951
+ device {
952
+ __typename
953
+ _id
954
+ used_workspace {
955
+ _id
956
+ billing {
957
+ plan {
958
+ type
959
+ }
960
+ lock {
961
+ features
962
+ additional_resources
963
+ }
964
+ }
965
+ }
966
+ create_datetime
967
+ last_modify_datetime
968
+ name
969
+ device_name
970
+ description
971
+ tags
972
+ entry_detail {
973
+ unique_id
974
+ operation_version
975
+ type
976
+ operation_mode
977
+ watch_dog_timer {
978
+ alive
979
+ last_launch_time
980
+ last_alive_time
981
+ threshold
982
+ }
983
+ }
984
+ owner {
985
+ _id
986
+ id_from_user
987
+ }
988
+ bound_application {
989
+ _id
990
+ name
991
+ }
992
+ auth {
993
+ type
994
+ }
995
+ }
996
+ target_name
997
+ }
998
+ }
999
+ `,eY=(0,el.default)`
1000
+ query ControllerClient_workspacePricingPlans {
1001
+ workspacePricingPlans
1002
+ }
1003
+ `;var eK=(0,el.default)`
1004
+ query User_workspace($id: ID!) {
1005
+ workspace(id: $id) {
1006
+ ...mcpWorkspaceArguments
1007
+ }
1008
+ }
1009
+ ${ek}
1010
+ `,eG=(0,el.default)`
1011
+ query User_workspaces($paginate: Paginate) {
1012
+ workspaces(paginate: $paginate) {
1013
+ ...mcpWorkspaceShortArguments
1014
+ }
1015
+ }
1016
+ ${eA}
1017
+ `,eL=(0,el.default)`
1018
+ query User_applications {
1019
+ applications {
1020
+ ...mcpApplicationShortArguments
1021
+ }
1022
+ }
1023
+ ${eD}
1024
+ `,ez=(0,el.default)`
1025
+ query User_application($id: ID!) {
1026
+ application(id: $id) {
1027
+ ...applicationArguments
1028
+ bricks_project_last_commit_id
1029
+ }
1030
+ }
1031
+ ${ef}
1032
+ `,eJ=(0,el.default)`
1033
+ query User_module($id: ID!) {
1034
+ module(id: $id) {
1035
+ ...moduleArguments
1036
+ bricks_project_last_commit_id
1037
+ }
1038
+ }
1039
+ ${e$}
1040
+ `,eX=(0,el.default)`
1041
+ query User_devices {
1042
+ devices {
1043
+ ...mcpDeviceShortArguments
1044
+ }
1045
+ }
1046
+ ${ew}
1047
+ `,eQ=(0,el.default)`
1048
+ query User_deviceUsage($deviceId: ID, $startDate: Date, $endDate: Date) {
1049
+ deviceUsage(deviceId: $deviceId, startDate: $startDate, endDate: $endDate) {
1050
+ _id
1051
+ device_id
1052
+ date
1053
+ uptime {
1054
+ timestamp
1055
+ }
1056
+ memory_usage {
1057
+ values
1058
+ timestamp
1059
+ }
1060
+ disk_usage {
1061
+ values
1062
+ timestamp
1063
+ }
1064
+ }
1065
+ }
1066
+ `;let eZ=e=>(e.needResetStore=!0,e),e0=eZ((0,el.default)`
1067
+ mutation ControllerClient_createWorkspace($name: String, $description: String) {
1068
+ createWorkspace(name: $name, description: $description) {
1069
+ ...workspaceArguments
1070
+ }
1071
+ }
1072
+ ${ep}
1073
+ `),e1=eZ((0,el.default)`
1074
+ mutation ControllerClient_updateWorkspace(
1075
+ $id: ID!
1076
+ $name: String
1077
+ $description: String
1078
+ $addVerifyEmail: String
1079
+ $removeVerifyEmail: String
1080
+ $enableBankRemoteUpdate: Boolean
1081
+ $newBankKey: BankKeyInput
1082
+ $revokeBankKey: String
1083
+ $enableMediaWorkspace: Boolean
1084
+ $refreshBindingBoxKey: String
1085
+ ) {
1086
+ updateWorkspace(
1087
+ id: $id
1088
+ name: $name
1089
+ description: $description
1090
+ addVerifyEmail: $addVerifyEmail
1091
+ removeVerifyEmail: $removeVerifyEmail
1092
+ enableBankRemoteUpdate: $enableBankRemoteUpdate
1093
+ newBankKey: $newBankKey
1094
+ revokeBankKey: $revokeBankKey
1095
+ enableMediaWorkspace: $enableMediaWorkspace
1096
+ refreshBindingBoxKey: $refreshBindingBoxKey
1097
+ ) {
1098
+ ...workspaceArguments
1099
+ }
1100
+ }
1101
+ ${ep}
1102
+ `),e4=eZ((0,el.default)`
1103
+ mutation ControllerClient_updateWorkspaceTokens(
1104
+ $id: ID!
1105
+ $tokens: [WorkspaceTokenInput]
1106
+ $revokeTokens: [ID!]
1107
+ ) {
1108
+ updateWorkspaceTokens(id: $id, tokens: $tokens, revokeTokens: $revokeTokens) {
1109
+ workspace {
1110
+ ...workspaceArguments
1111
+ }
1112
+ newTokens {
1113
+ name
1114
+ token
1115
+ }
1116
+ }
1117
+ }
1118
+ ${ep}
1119
+ `),e6=eZ((0,el.default)`
1120
+ mutation ControllerClient_createDevice(
1121
+ $workspaceId: ID
1122
+ $name: String
1123
+ $deviceName: String
1124
+ $entry: JSON!
1125
+ $forceMoveExistingDeviceIfAllowed: Boolean
1126
+ $bindPasscode: String
1127
+ $bindRefreshTokenLegacy: String
1128
+ ) {
1129
+ createDevice(
1130
+ workspaceId: $workspaceId
1131
+ name: $name
1132
+ deviceName: $deviceName
1133
+ entry: $entry
1134
+ forceMoveExistingDeviceIfAllowed: $forceMoveExistingDeviceIfAllowed
1135
+ bindPasscode: $bindPasscode
1136
+ bindRefreshTokenLegacy: $bindRefreshTokenLegacy
1137
+ ) {
1138
+ ...deviceArguments
1139
+ }
1140
+ }
1141
+ ${em}
1142
+ `),e5=eZ((0,el.default)`
1143
+ mutation ControllerClient_createVirtualDevice(
1144
+ $workspaceId: ID
1145
+ $name: String
1146
+ $deviceName: String
1147
+ $entry: JSON!
1148
+ ) {
1149
+ createVirtualDevice(
1150
+ workspaceId: $workspaceId
1151
+ name: $name
1152
+ deviceName: $deviceName
1153
+ entry: $entry
1154
+ ) {
1155
+ ...deviceArguments
1156
+ }
1157
+ }
1158
+ ${em}
1159
+ `),e2=eZ((0,el.default)`
1160
+ mutation ControllerClient_updateDevice(
1161
+ $id: ID!
1162
+ $name: String
1163
+ $deviceName: String
1164
+ $description: String
1165
+ $tags: [String]
1166
+ $alert: DeviceAlertInput
1167
+ $activityLog: ActivityLogInput
1168
+ $localSync: LocalSyncInput
1169
+ $preload: PreloadInput
1170
+ $applicationUpdate: ApplicationUpdateInput
1171
+ $lock: DeviceLockInput
1172
+ $advancedSetting: AdvancedSettingInput
1173
+ $enableWebLanDiscovery: Boolean
1174
+ $env: DeviceEnvInput
1175
+ $accessControl: DeviceAccessControlInput
1176
+ $forceNotifyDevice: Boolean
1177
+ ) {
1178
+ updateDevice(
1179
+ id: $id
1180
+ name: $name
1181
+ deviceName: $deviceName
1182
+ description: $description
1183
+ tags: $tags
1184
+ alert: $alert
1185
+ activityLog: $activityLog
1186
+ localSync: $localSync
1187
+ preload: $preload
1188
+ applicationUpdate: $applicationUpdate
1189
+ lock: $lock
1190
+ advancedSetting: $advancedSetting
1191
+ enableWebLanDiscovery: $enableWebLanDiscovery
1192
+ env: $env
1193
+ accessControl: $accessControl
1194
+ forceNotifyDevice: $forceNotifyDevice
1195
+ ) {
1196
+ ...deviceArguments
1197
+ ...deviceDetailArguments
1198
+ }
1199
+ }
1200
+ ${em}
1201
+ ${e_}
1202
+ `),e9=eZ((0,el.default)`
1203
+ mutation ControllerClient_moveDevice(
1204
+ $id: ID!
1205
+ $workspaceId: ID!
1206
+ $forceNotifyDevice: Boolean
1207
+ $forceUnbindApplicationIfNeeded: Boolean
1208
+ $forceRemoveInDeviceGroupsIfNeeded: Boolean
1209
+ ) {
1210
+ moveDevice(
1211
+ id: $id
1212
+ workspaceId: $workspaceId
1213
+ forceNotifyDevice: $forceNotifyDevice
1214
+ forceUnbindApplicationIfNeeded: $forceUnbindApplicationIfNeeded
1215
+ forceRemoveInDeviceGroupsIfNeeded: $forceRemoveInDeviceGroupsIfNeeded
1216
+ ) {
1217
+ ...deviceArguments
1218
+ }
1219
+ }
1220
+ ${em}
1221
+ `),e3=eZ((0,el.default)`
1222
+ mutation ControllerClient_updateVirtualDevice(
1223
+ $id: ID!
1224
+ $tokens: [DeviceTokenInput]
1225
+ $revokeTokens: [ID!]
1226
+ ) {
1227
+ updateVirtualDevice(id: $id, tokens: $tokens, revokeTokens: $revokeTokens) {
1228
+ device {
1229
+ ...deviceArguments
1230
+ ...deviceDetailArguments
1231
+ }
1232
+ newTokens {
1233
+ name
1234
+ token
1235
+ }
1236
+ }
1237
+ }
1238
+ ${em}
1239
+ ${e_}
1240
+ `),e8=eZ((0,el.default)`
1241
+ mutation ControllerClient_removeDevice($id: ID!) {
1242
+ removeDevice(id: $id)
1243
+ }
1244
+ `),e7=eZ((0,el.default)`
1245
+ mutation ControllerClient_controlDevice($id: ID!, $type: String!, $eventPayload: JSON) {
1246
+ controlDevice(id: $id, type: $type, eventPayload: $eventPayload) {
1247
+ ...deviceArguments
1248
+ }
1249
+ }
1250
+ ${em}
1251
+ `),ie=eZ((0,el.default)`
1252
+ mutation ControllerClient_createDeviceGroup(
1253
+ $workspaceId: ID!
1254
+ $name: String!
1255
+ $description: String
1256
+ ) {
1257
+ createDeviceGroup(workspaceId: $workspaceId, name: $name, description: $description) {
1258
+ ...deviceGroupArguments
1259
+ }
1260
+ }
1261
+ ${eg}
1262
+ `),ii=eZ((0,el.default)`
1263
+ mutation ControllerClient_updateDeviceGroup(
1264
+ $id: ID!
1265
+ $name: String
1266
+ $description: String
1267
+ $tags: [String]
1268
+ $upsertDevices: [DeviceInGroupInput]
1269
+ $removeDevices: [ID!]
1270
+ $deployDeviceSetting: DeviceSettingInGroup
1271
+ $deployDeviceAdvancedSetting: DeviceAdvancedSettingInGroup
1272
+ ) {
1273
+ updateDeviceGroup(
1274
+ id: $id
1275
+ name: $name
1276
+ description: $description
1277
+ tags: $tags
1278
+ upsertDevices: $upsertDevices
1279
+ removeDevices: $removeDevices
1280
+ deployDeviceSetting: $deployDeviceSetting
1281
+ deployDeviceAdvancedSetting: $deployDeviceAdvancedSetting
1282
+ ) {
1283
+ ...deviceGroupArguments
1284
+ }
1285
+ }
1286
+ ${eg}
1287
+ `),it=eZ((0,el.default)`
1288
+ mutation ControllerClient_dispatchDeviceGroupAction($id: ID!, $action: String!) {
1289
+ dispatchDeviceGroupAction(id: $id, action: $action) {
1290
+ devices
1291
+ dispatched
1292
+ }
1293
+ }
1294
+ `),ia=eZ((0,el.default)`
1295
+ mutation ControllerClient_removeDeviceGroup($id: ID!) {
1296
+ removeDeviceGroup(id: $id)
1297
+ }
1298
+ `),io=eZ((0,el.default)`
1299
+ mutation ControllerClient_removeWorkspace($id: ID!) {
1300
+ removeWorkspace(id: $id)
1301
+ }
1302
+ `),ir=eZ((0,el.default)`
1303
+ mutation ControllerClient_createApplication(
1304
+ $workspaceId: ID
1305
+ $name: String
1306
+ $description: String
1307
+ $layoutWidth: Int
1308
+ $layoutHeight: Int
1309
+ $createExampleKey: String
1310
+ ) {
1311
+ createApplication(
1312
+ workspaceId: $workspaceId
1313
+ name: $name
1314
+ description: $description
1315
+ layoutWidth: $layoutWidth
1316
+ layoutHeight: $layoutHeight
1317
+ createExampleKey: $createExampleKey
1318
+ ) {
1319
+ ...applicationArguments
1320
+ }
1321
+ }
1322
+ ${ef}
1323
+ `),is=eZ((0,el.default)`
1324
+ mutation ControllerClient_createApplicationWithShareVersion(
1325
+ $workspaceId: ID
1326
+ $name: String
1327
+ $description: String
1328
+ $shareVersionId: ID
1329
+ ) {
1330
+ createApplicationWithShareVersion(
1331
+ workspaceId: $workspaceId
1332
+ name: $name
1333
+ description: $description
1334
+ shareVersionId: $shareVersionId
1335
+ ) {
1336
+ ...applicationArguments
1337
+ }
1338
+ }
1339
+ ${ef}
1340
+ `);eZ((0,el.default)`
1341
+ mutation ControllerClient_updateApplication(
1342
+ $id: ID!
1343
+ $name: String
1344
+ $description: String
1345
+ $tags: [String]
1346
+ $config: String
1347
+ $validateConfig: Boolean
1348
+ $runtimeEdit: RuntimeEditInput
1349
+ $canvasControlEdit: CanvasControlEditInput
1350
+ $deviceControlEdit: DeviceControlEditInput
1351
+ $releaseCurrentVersion: String
1352
+ $releaseCurrentVersionNote: String
1353
+ $useReleaseVersion: ID
1354
+ $parentUseThisVersion: Boolean
1355
+ $syncParent: Boolean
1356
+ $newSecrets: [ApplicationSecretInput]
1357
+ $updateSecrets: [ApplicationSecretUpdateInput]
1358
+ $removeSecrets: [ID!]
1359
+ $lock: ApplicationLockInput
1360
+ $aiFilters: [ApplicationAiFilterInput]
1361
+ ) {
1362
+ updateApplication(
1363
+ id: $id
1364
+ name: $name
1365
+ description: $description
1366
+ tags: $tags
1367
+ config: $config
1368
+ validateConfig: $validateConfig
1369
+ runtimeEdit: $runtimeEdit
1370
+ canvasControlEdit: $canvasControlEdit
1371
+ deviceControlEdit: $deviceControlEdit
1372
+ releaseCurrentVersion: $releaseCurrentVersion
1373
+ releaseCurrentVersionNote: $releaseCurrentVersionNote
1374
+ useReleaseVersion: $useReleaseVersion
1375
+ parentUseThisVersion: $parentUseThisVersion
1376
+ syncParent: $syncParent
1377
+ newSecrets: $newSecrets
1378
+ updateSecrets: $updateSecrets
1379
+ removeSecrets: $removeSecrets
1380
+ lock: $lock
1381
+ aiFilters: $aiFilters
1382
+ ) {
1383
+ ...applicationArguments
1384
+ }
1385
+ }
1386
+ ${ef}
1387
+ `);let id=eZ((0,el.default)`
1388
+ mutation ControllerClient_bindApplication(
1389
+ $id: ID!
1390
+ $devices: [ID]
1391
+ $bindDevices: [ID]
1392
+ $unbindDevices: [ID]
1393
+ $deviceFrames: JSON
1394
+ $deviceSettings: [DeviceSettingInput]
1395
+ $forceUnbindDevicesIfNeeded: Boolean
1396
+ ) {
1397
+ bindApplication(
1398
+ id: $id
1399
+ devices: $devices
1400
+ bindDevices: $bindDevices
1401
+ unbindDevices: $unbindDevices
1402
+ deviceFrames: $deviceFrames
1403
+ deviceSettings: $deviceSettings
1404
+ forceUnbindDevicesIfNeeded: $forceUnbindDevicesIfNeeded
1405
+ ) {
1406
+ ...applicationArguments
1407
+ }
1408
+ }
1409
+ ${ef}
1410
+ `),ic=eZ((0,el.default)`
1411
+ mutation ControllerClient_toggleShortEditApplication($id: ID!, $enabled: Boolean!) {
1412
+ toggleShortEditApplication(id: $id, enabled: $enabled)
1413
+ }
1414
+ `),il=eZ((0,el.default)`
1415
+ mutation ControllerClient_updateApplicationViewportPreset(
1416
+ $id: ID!
1417
+ $newViewportPresets: [ApplicationViewportPresetInput]
1418
+ $updateViewportPresets: [ApplicationViewportPresetUpdateInput]
1419
+ $removeViewportPresets: [ID!]
1420
+ ) {
1421
+ updateApplicationViewportPreset(
1422
+ id: $id
1423
+ newViewportPresets: $newViewportPresets
1424
+ updateViewportPresets: $updateViewportPresets
1425
+ removeViewportPresets: $removeViewportPresets
1426
+ ) {
1427
+ ...applicationArguments
1428
+ }
1429
+ }
1430
+ ${ef}
1431
+ `),ip=eZ((0,el.default)`
1432
+ mutation ControllerClient_bindApplicationWithDeviceGroup(
1433
+ $id: ID!
1434
+ $bindDeviceGroup: ApplicationBindDeviceGroupInput
1435
+ $unbindDeviceGroup: ApplicationUnbindDeviceGroupInput
1436
+ $forceUnbindDevicesIfNeeded: Boolean
1437
+ ) {
1438
+ bindApplicationWithDeviceGroup(
1439
+ id: $id
1440
+ bindDeviceGroup: $bindDeviceGroup
1441
+ unbindDeviceGroup: $unbindDeviceGroup
1442
+ forceUnbindDevicesIfNeeded: $forceUnbindDevicesIfNeeded
1443
+ ) {
1444
+ ...applicationArguments
1445
+ }
1446
+ }
1447
+ ${ef}
1448
+ `),iu=eZ((0,el.default)`
1449
+ mutation ControllerClient_shareApplication(
1450
+ $id: ID!
1451
+ $shareSetting: ApplicationShareSettingInput
1452
+ $favoriteSetting: ApplicationFavoriteSettingInput
1453
+ $previewSetting: ApplicationPreviewSettingInput
1454
+ $releaseVersion: ApplicationReleaseVersionInput
1455
+ $screenshotSetting: ApplicationScreenshotSettingInput
1456
+ ) {
1457
+ shareApplication(
1458
+ id: $id
1459
+ shareSetting: $shareSetting
1460
+ favoriteSetting: $favoriteSetting
1461
+ previewSetting: $previewSetting
1462
+ releaseVersion: $releaseVersion
1463
+ screenshotSetting: $screenshotSetting
1464
+ ) {
1465
+ ...applicationArguments
1466
+ }
1467
+ }
1468
+ ${ef}
1469
+ `),im=eZ((0,el.default)`
1470
+ mutation ControllerClient_moveApplication($id: ID!, $workspaceId: ID!) {
1471
+ moveApplication(id: $id, workspaceId: $workspaceId) {
1472
+ ...applicationArguments
1473
+ }
1474
+ }
1475
+ ${ef}
1476
+ `),i_=eZ((0,el.default)`
1477
+ mutation ControllerClient_createDeviceGroupWithApp(
1478
+ $applicationId: ID!
1479
+ $name: String!
1480
+ $description: String
1481
+ $targetDeviceFields: [TargetDeviceField]
1482
+ $presetName: String
1483
+ ) {
1484
+ createDeviceGroupWithApp(
1485
+ applicationId: $applicationId
1486
+ name: $name
1487
+ description: $description
1488
+ targetDeviceFields: $targetDeviceFields
1489
+ presetName: $presetName
1490
+ ) {
1491
+ deviceGroup {
1492
+ _id
1493
+ name
1494
+ description
1495
+ }
1496
+ application {
1497
+ ...applicationArguments
1498
+ }
1499
+ }
1500
+ }
1501
+ ${ef}
1502
+ `);eZ((0,el.default)`
1503
+ mutation ControllerClient_forkApplication($id: ID!) {
1504
+ forkApplication(id: $id) {
1505
+ ...applicationArguments
1506
+ }
1507
+ }
1508
+ ${ef}
1509
+ `);let ig=eZ((0,el.default)`
1510
+ mutation ControllerClient_duplicateApplication(
1511
+ $id: ID!
1512
+ $includeVersions: Boolean
1513
+ $includeSecrets: Boolean
1514
+ ) {
1515
+ duplicateApplication(
1516
+ id: $id
1517
+ includeVersions: $includeVersions
1518
+ includeSecrets: $includeSecrets
1519
+ ) {
1520
+ ...applicationArguments
1521
+ }
1522
+ }
1523
+ ${ef}
1524
+ `),iy=eZ((0,el.default)`
1525
+ mutation ControllerClient_removeApplication($id: ID!) {
1526
+ removeApplication(id: $id)
1527
+ }
1528
+ `),i$=eZ((0,el.default)`
1529
+ mutation ControllerClient_createModule(
1530
+ $workspaceId: ID
1531
+ $name: String
1532
+ $description: String
1533
+ $exposeProperties: [String]
1534
+ $isAllowModify: Boolean
1535
+ $isPublic: Boolean
1536
+ $layoutWidth: Int
1537
+ $layoutHeight: Int
1538
+ $config: String
1539
+ ) {
1540
+ createModule(
1541
+ workspaceId: $workspaceId
1542
+ name: $name
1543
+ description: $description
1544
+ exposeProperties: $exposeProperties
1545
+ isAllowModify: $isAllowModify
1546
+ isPublic: $isPublic
1547
+ layoutWidth: $layoutWidth
1548
+ layoutHeight: $layoutHeight
1549
+ config: $config
1550
+ ) {
1551
+ ...moduleArguments
1552
+ }
1553
+ }
1554
+ ${e$}
1555
+ `),iv=eZ((0,el.default)`
1556
+ mutation ControllerClient_updateModule(
1557
+ $id: ID!
1558
+ $name: String
1559
+ $description: String
1560
+ $tags: [String]
1561
+ $exposeProperties: [String]
1562
+ $isAllowModify: Boolean
1563
+ $isPublic: Boolean
1564
+ $config: String
1565
+ $validateConfig: Boolean
1566
+ $useReleaseVersion: ID
1567
+ $releaseCurrentVersion: String
1568
+ $releaseCurrentVersionNote: String
1569
+ ) {
1570
+ updateModule(
1571
+ id: $id
1572
+ name: $name
1573
+ description: $description
1574
+ tags: $tags
1575
+ exposeProperties: $exposeProperties
1576
+ isAllowModify: $isAllowModify
1577
+ isPublic: $isPublic
1578
+ config: $config
1579
+ validateConfig: $validateConfig
1580
+ useReleaseVersion: $useReleaseVersion
1581
+ releaseCurrentVersion: $releaseCurrentVersion
1582
+ releaseCurrentVersionNote: $releaseCurrentVersionNote
1583
+ ) {
1584
+ ...moduleArguments
1585
+ }
1586
+ }
1587
+ ${e$}
1588
+ `),ih=eZ((0,el.default)`
1589
+ mutation ControllerClient_moveModule($id: ID!, $workspaceId: ID!) {
1590
+ moveModule(id: $id, workspaceId: $workspaceId) {
1591
+ ...moduleArguments
1592
+ }
1593
+ }
1594
+ ${e$}
1595
+ `),ib=eZ((0,el.default)`
1596
+ mutation ControllerClient_duplicateModule($id: ID!) {
1597
+ duplicateModule(id: $id) {
1598
+ ...moduleArguments
1599
+ }
1600
+ }
1601
+ ${e$}
1602
+ `),iI=eZ((0,el.default)`
1603
+ mutation ControllerClient_removeModule($id: ID!) {
1604
+ removeModule(id: $id)
1605
+ }
1606
+ `),ik=eZ((0,el.default)`
1607
+ mutation ControllerClient_createConfigChangeOperation(
1608
+ $applicationId: ID!
1609
+ $config: JSON!
1610
+ $expires: Int
1611
+ ) {
1612
+ createConfigChangeOperation(applicationId: $applicationId, config: $config, expires: $expires) {
1613
+ ...operationArguments
1614
+ }
1615
+ }
1616
+ ${eb}
1617
+ `),iA=eZ((0,el.default)`
1618
+ mutation ControllerClient_doOperation($id: ID!, $applicationId: ID!) {
1619
+ doOperation(id: $id, applicationId: $applicationId)
1620
+ }
1621
+ `),iD=eZ((0,el.default)`
1622
+ mutation ControllerClient_updateOperation(
1623
+ $id: ID!
1624
+ $applicationId: ID!
1625
+ $config: JSON!
1626
+ $expires: Int
1627
+ ) {
1628
+ updateOperation(id: $id, applicationId: $applicationId, config: $config, expires: $expires) {
1629
+ ...operationArguments
1630
+ }
1631
+ }
1632
+ ${eb}
1633
+ `),iw=eZ((0,el.default)`
1634
+ mutation ControllerClient_removeOperation($id: ID!, $applicationId: ID!) {
1635
+ removeOperation(id: $id, applicationId: $applicationId)
1636
+ }
1637
+ `),iS=eZ((0,el.default)`
1638
+ mutation ControllerClient_assignGroupPermissions(
1639
+ $roleId: String!
1640
+ $instanceType: String!
1641
+ $instanceId: ID!
1642
+ $permissions: [String]!
1643
+ ) {
1644
+ assignGroupPermissions(
1645
+ roleId: $roleId
1646
+ instanceType: $instanceType
1647
+ instanceId: $instanceId
1648
+ permissions: $permissions
1649
+ )
1650
+ }
1651
+ `),iC=(0,el.default)`
1652
+ mutation ControllerClient_registerFCMNotification($workspaceId: ID!, $token: String!) {
1653
+ registerFCMNotification(workspaceId: $workspaceId, token: $token)
1654
+ }
1655
+ `,iT=(0,el.default)`
1656
+ mutation ControllerClient_registerRemoteDebug($deviceId: ID!) {
1657
+ registerRemoteDebug(deviceId: $deviceId) {
1658
+ deviceId
1659
+ token
1660
+ }
1661
+ }
1662
+ `,ix=(0,el.default)`
1663
+ mutation ControllerClient_shareAccessToken(
1664
+ $workspaceId: ID
1665
+ $passcode: String!
1666
+ $refreshToken: String!
1667
+ ) {
1668
+ shareAccessToken(workspaceId: $workspaceId, passcode: $passcode, refreshToken: $refreshToken)
1669
+ }
1670
+ `,iB=eZ((0,el.default)`
1671
+ mutation ControllerClient_addUserFavorite($instanceType: InstanceType!, $instanceId: ID!) {
1672
+ addUserFavorite(instanceType: $instanceType, instanceId: $instanceId) {
1673
+ _id
1674
+ instance_type
1675
+ instance {
1676
+ _id
1677
+ name
1678
+ description
1679
+ }
1680
+ last_modify_datetime
1681
+ }
1682
+ }
1683
+ `),iE=eZ((0,el.default)`
1684
+ mutation ControllerClient_removeUserFavorite($instanceType: InstanceType!, $instanceId: ID!) {
1685
+ removeUserFavorite(instanceType: $instanceType, instanceId: $instanceId)
1686
+ }
1687
+ `),iU=eZ((0,el.default)`
1688
+ mutation ControllerClient_changeWorkspaceSubscriptionPlan(
1689
+ $workspaceId: ID!
1690
+ $type: String!
1691
+ $period: String!
1692
+ ) {
1693
+ changeWorkspaceSubscriptionPlan(workspaceId: $workspaceId, type: $type, period: $period)
1694
+ }
1695
+ `),iO=eZ((0,el.default)`
1696
+ mutation ControllerClient_changeWorkspaceAdditionalLimitSpending(
1697
+ $workspaceId: ID!
1698
+ $boundDevicesLimit: Float
1699
+ $groupMembersLimit: Float
1700
+ ) {
1701
+ changeWorkspaceAdditionalLimitSpending(
1702
+ workspaceId: $workspaceId
1703
+ boundDevicesLimit: $boundDevicesLimit
1704
+ groupMembersLimit: $groupMembersLimit
1705
+ )
1706
+ }
1707
+ `),iM=(0,el.default)`
1708
+ mutation ControllerClient_createWorkspaceOTP(
1709
+ $workspaceId: ID!
1710
+ $tokenTypes: [WorkspaceTokenType]!
1711
+ $tokenName: String
1712
+ ) {
1713
+ createWorkspaceOTP(workspaceId: $workspaceId, tokenTypes: $tokenTypes, tokenName: $tokenName) {
1714
+ _id
1715
+ passcode
1716
+ expired_datetime
1717
+ }
1718
+ }
1719
+ `,iR=(0,el.default)`
1720
+ mutation ControllerClient_revokeWorkspaceOTP($id: ID!) {
1721
+ revokeWorkspaceOTP(id: $id)
1722
+ }
1723
+ `;var iP=(0,el.default)`
1724
+ mutation User_updateApplication(
1725
+ $id: ID!
1726
+ $name: String
1727
+ $description: String
1728
+ $config: String
1729
+ $validateConfig: Boolean
1730
+ $lastCommitId: String
1731
+ ) {
1732
+ updateApplication(
1733
+ id: $id
1734
+ name: $name
1735
+ description: $description
1736
+ config: $config
1737
+ validateConfig: $validateConfig
1738
+ lastCommitId: $lastCommitId
1739
+ ) {
1740
+ ...applicationArguments
1741
+ bricks_project_last_commit_id
1742
+ }
1743
+ }
1744
+ ${ef}
1745
+ `,iF=(0,el.default)`
1746
+ mutation User_forkApplication($id: ID!) {
1747
+ forkApplication(id: $id) {
1748
+ ...mcpApplicationShortArguments
1749
+ dev_ref {
1750
+ is_dev
1751
+ parent_application
1752
+ }
1753
+ bricks_project_last_commit_id
1754
+ }
1755
+ }
1756
+ ${eD}
1757
+ `;function iN(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(iN=function(){return!!e})()}var iq=function(e){function i(e,t){var n,a,o;return et(this,i),a=i,o=[e,t,"/api/graphql",m,_],a=ea(a),(n=en(this,iN()?Reflect.construct(a,o||[],ea(this).constructor):a.apply(this,o))).tokenType="user",n}return eo(i,e),ei(i)}(eB),ij=t(90424),iW=(0,el.default)`
1758
+ query Workspace_workspace {
1759
+ workspace {
1760
+ ...mcpWorkspaceArguments
1761
+ }
1762
+ }
1763
+ ${ek}
1764
+ `,iV=(0,el.default)`
1765
+ query Workspace_applications($keyword: String, $paginate: Paginate) {
1766
+ applications(keyword: $keyword, paginate: $paginate) {
1767
+ ...mcpApplicationShortArguments
1768
+ }
1769
+ }
1770
+ ${eD}
1771
+ `,iH=(0,el.default)`
1772
+ query Workspace_application($id: ID!, $composed: Boolean, $debug: Boolean) {
1773
+ application(id: $id, composed: $composed, debug: $debug) {
1774
+ ...applicationArguments
1775
+ bricks_project_last_commit_id
1776
+ }
1777
+ }
1778
+ ${ef}
1779
+ `,iY=(0,el.default)`
1780
+ query Workspace_applicationByDevice(
1781
+ $deviceId: ID!
1782
+ $composeModule: Boolean
1783
+ $bankRemoteConfig: Boolean
1784
+ $debug: Boolean
1785
+ ) {
1786
+ applicationByDevice(
1787
+ deviceId: $deviceId
1788
+ composeModule: $composeModule
1789
+ bankRemoteConfig: $bankRemoteConfig
1790
+ debug: $debug
1791
+ ) {
1792
+ ...applicationArguments
1793
+ }
1794
+ }
1795
+ ${ef}
1796
+ `,iK=(0,el.default)`
1797
+ query Workspace_modules($keyword: String, $paginate: Paginate) {
1798
+ modules(keyword: $keyword, paginate: $paginate) {
1799
+ ...moduleShortArguments
1800
+ }
1801
+ }
1802
+ ${ev}
1803
+ `,iG=(0,el.default)`
1804
+ query Workspace_module($id: ID!) {
1805
+ module(id: $id) {
1806
+ ...moduleArguments
1807
+ bricks_project_last_commit_id
1808
+ }
1809
+ }
1810
+ ${e$}
1811
+ `,iL=(0,el.default)`
1812
+ query Workspace_devices($keyword: String, $paginate: Paginate) {
1813
+ devices(keyword: $keyword, paginate: $paginate) {
1814
+ ...deviceArguments
1815
+ }
1816
+ }
1817
+ ${em}
1818
+ `,iz=(0,el.default)`
1819
+ query Workspace_device($id: ID) {
1820
+ device(id: $id) {
1821
+ ...deviceArguments
1822
+ }
1823
+ }
1824
+ ${em}
1825
+ `,iJ=(0,el.default)`
1826
+ query Workspace_devicesByApplication($id: ID!) {
1827
+ devicesByApplication(id: $id) {
1828
+ ...deviceArguments
1829
+ }
1830
+ }
1831
+ ${em}
1832
+ `,iX=(0,el.default)`
1833
+ query Workspace_deviceUsage($deviceId: ID, $startDate: Date, $endDate: Date) {
1834
+ deviceUsage(deviceId: $deviceId, startDate: $startDate, endDate: $endDate) {
1835
+ _id
1836
+ device_id
1837
+ date
1838
+ uptime {
1839
+ timestamp
1840
+ }
1841
+ memory_usage {
1842
+ values
1843
+ timestamp
1844
+ }
1845
+ disk_usage {
1846
+ values
1847
+ timestamp
1848
+ }
1849
+ }
1850
+ }
1851
+ `,iQ=(0,el.default)`
1852
+ query Workspace_mediaWorkspace {
1853
+ mediaWorkspace {
1854
+ ...workspaceMediaWorkspaceArguments
1855
+ }
1856
+ }
1857
+ ${eS}
1858
+ `,iZ=(0,el.default)`
1859
+ query Workspace_mediaBoxes {
1860
+ mediaBoxes {
1861
+ ...workspaceMediaBoxArguments
1862
+ }
1863
+ }
1864
+ ${eC}
1865
+ `,i0=(0,el.default)`
1866
+ query Workspace_mediaBox($boxId: ID!) {
1867
+ mediaBox(id: $boxId) {
1868
+ ...workspaceMediaBoxArguments
1869
+ }
1870
+ }
1871
+ ${eC}
1872
+ `,i1=(0,el.default)`
1873
+ query Workspace_mediaFiles(
1874
+ $boxId: ID!
1875
+ $includeTypes: [String]
1876
+ $userTags: [String]
1877
+ $limit: Int
1878
+ $offset: Int
1879
+ ) {
1880
+ mediaFiles(
1881
+ boxId: $boxId
1882
+ includeTypes: $includeTypes
1883
+ userTags: $userTags
1884
+ limit: $limit
1885
+ offset: $offset
1886
+ ) {
1887
+ ...workspaceMediaFileArguments
1888
+ }
1889
+ }
1890
+ ${eT}
1891
+ `,i4=(0,el.default)`
1892
+ query Workspace_mediaFile($id: ID!) {
1893
+ mediaFile(id: $id) {
1894
+ ...workspaceMediaFileArguments
1895
+ }
1896
+ }
1897
+ ${eT}
1898
+ `,i6=(0,el.default)`
1899
+ mutation Workspace_createApplication(
1900
+ $name: String
1901
+ $description: String
1902
+ $layoutWidth: Int
1903
+ $layoutHeight: Int
1904
+ ) {
1905
+ createApplication(
1906
+ name: $name
1907
+ description: $description
1908
+ layoutWidth: $layoutWidth
1909
+ layoutHeight: $layoutHeight
1910
+ ) {
1911
+ ...mcpApplicationShortArguments
1912
+ config
1913
+ }
1914
+ }
1915
+ ${eD}
1916
+ `,i5=(0,el.default)`
1917
+ mutation Workspace_updateApplication(
1918
+ $id: ID!
1919
+ $config: String
1920
+ $name: String
1921
+ $description: String
1922
+ $validateConfig: Boolean
1923
+ $lastCommitId: String
1924
+ ) {
1925
+ updateApplication(
1926
+ id: $id
1927
+ config: $config
1928
+ name: $name
1929
+ description: $description
1930
+ validateConfig: $validateConfig
1931
+ lastCommitId: $lastCommitId
1932
+ ) {
1933
+ ...mcpApplicationShortArguments
1934
+ config
1935
+ has_unreleased_changes
1936
+ bricks_project_last_commit_id
1937
+ }
1938
+ }
1939
+ ${eD}
1940
+ `,i2=(0,el.default)`
1941
+ mutation Workspace_forkApplication($id: ID!) {
1942
+ forkApplication(id: $id) {
1943
+ ...mcpApplicationShortArguments
1944
+ dev_ref {
1945
+ is_dev
1946
+ parent_application
1947
+ }
1948
+ bricks_project_last_commit_id
1949
+ }
1950
+ }
1951
+ ${eD}
1952
+ `,i9=(0,el.default)`
1953
+ mutation Workspace_bindApplication(
1954
+ $id: ID!
1955
+ $bindDevices: [ID]
1956
+ $unbindDevices: [ID]
1957
+ $deviceFrames: JSON
1958
+ ) {
1959
+ bindApplication(
1960
+ id: $id
1961
+ bindDevices: $bindDevices
1962
+ unbindDevices: $unbindDevices
1963
+ deviceFrames: $deviceFrames
1964
+ ) {
1965
+ _id
1966
+ devices {
1967
+ device_id
1968
+ status
1969
+ frame
1970
+ }
1971
+ }
1972
+ }
1973
+ `,i3=(0,el.default)`
1974
+ mutation Workspace_unbindApplication($id: ID!, $unbindDevices: [ID]) {
1975
+ bindApplication(id: $id, unbindDevices: $unbindDevices) {
1976
+ _id
1977
+ devices {
1978
+ device_id
1979
+ status
1980
+ frame
1981
+ }
1982
+ }
1983
+ }
1984
+ `,i8=(0,el.default)`
1985
+ mutation Workspace_createModule(
1986
+ $name: String
1987
+ $description: String
1988
+ $exposeProperties: [String]
1989
+ $isAllowModify: Boolean
1990
+ $isPublic: Boolean
1991
+ $layoutWidth: Int
1992
+ $layoutHeight: Int
1993
+ ) {
1994
+ createModule(
1995
+ name: $name
1996
+ description: $description
1997
+ exposeProperties: $exposeProperties
1998
+ isAllowModify: $isAllowModify
1999
+ isPublic: $isPublic
2000
+ layoutWidth: $layoutWidth
2001
+ layoutHeight: $layoutHeight
2002
+ ) {
2003
+ ...moduleArguments
2004
+ }
2005
+ }
2006
+ ${e$}
2007
+ `,i7=(0,el.default)`
2008
+ mutation Workspace_updateModule(
2009
+ $id: ID!
2010
+ $config: String
2011
+ $name: String
2012
+ $description: String
2013
+ $validateConfig: Boolean
2014
+ $lastCommitId: String
2015
+ ) {
2016
+ updateModule(
2017
+ id: $id
2018
+ config: $config
2019
+ name: $name
2020
+ description: $description
2021
+ validateConfig: $validateConfig
2022
+ lastCommitId: $lastCommitId
2023
+ ) {
2024
+ ...moduleArguments
2025
+ bricks_project_last_commit_id
2026
+ }
2027
+ }
2028
+ ${e$}
2029
+ `,te=(0,el.default)`
2030
+ mutation Workspace_createMediaFileUploadRequest(
2031
+ $name: String!
2032
+ $description: String!
2033
+ $boxId: ID!
2034
+ $fileType: String!
2035
+ $contentType: String!
2036
+ $userTags: [String]
2037
+ $meta: RequestUploadMetaInput!
2038
+ ) {
2039
+ createMediaFileUploadRequest(
2040
+ name: $name
2041
+ description: $description
2042
+ boxId: $boxId
2043
+ fileType: $fileType
2044
+ contentType: $contentType
2045
+ userTags: $userTags
2046
+ meta: $meta
2047
+ ) {
2048
+ id
2049
+ name
2050
+ description
2051
+ boxId
2052
+ fileType
2053
+ userTags
2054
+ meta {
2055
+ uploadInfo
2056
+ }
2057
+ }
2058
+ }
2059
+ `,ti=(0,el.default)`
2060
+ mutation Workspace_updateMediaFile(
2061
+ $id: ID!
2062
+ $name: String
2063
+ $description: String
2064
+ $userTags: [String]
2065
+ $requestUploadAgain: Boolean!
2066
+ ) {
2067
+ updateMediaFile(
2068
+ id: $id
2069
+ name: $name
2070
+ description: $description
2071
+ userTags: $userTags
2072
+ requestUploadAgain: $requestUploadAgain
2073
+ ) {
2074
+ id
2075
+ name
2076
+ description
2077
+ userTags
2078
+ updatedAt
2079
+ }
2080
+ }
2081
+ `,tt=(0,el.default)`
2082
+ mutation Workspace_updateMediaFiles(
2083
+ $fileIds: [ID!]!
2084
+ $name: String
2085
+ $description: String
2086
+ $userTags: [String]
2087
+ ) {
2088
+ updateMediaFiles(fileIds: $fileIds, name: $name, description: $description, userTags: $userTags)
2089
+ }
2090
+ `,tn=(0,el.default)`
2091
+ mutation Workspace_setMediaFileAsBoxPreview($id: ID!) {
2092
+ setMediaFileAsBoxPreview(id: $id)
2093
+ }
2094
+ `,ta=(0,el.default)`
2095
+ mutation Workspace_copyMediaFiles($fromBoxId: ID!, $toBoxId: ID!, $fileIds: [ID!]!) {
2096
+ copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, fileIds: $fileIds)
2097
+ }
2098
+ `,to=(0,el.default)`
2099
+ mutation Workspace_deleteMediaFiles($boxId: ID!, $fileIds: [ID!]!) {
2100
+ deleteMediaFiles(boxId: $boxId, fileIds: $fileIds)
2101
+ }
2102
+ `,tr=(0,el.default)`
2103
+ mutation Workspace_deleteMediaBoxFiles($boxId: ID!, $includeTypes: [String]) {
2104
+ deleteMediaBoxFiles(boxId: $boxId, includeTypes: $includeTypes)
2105
+ }
2106
+ `;function ts(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ts=function(){return!!e})()}var td=["_id","name"],tc=e=>Object.fromEntries(Object.entries(e).map(([e,i])=>[e,(0,ij.YR)(i,{Field(e){if("used_workspace"===e.name.value)return{...e,selectionSet:{...e.selectionSet,selections:e.selectionSet.selections.filter(e=>td.includes(e.name?.value))}}}})])),tl=tc(g),tp=tc(f),tu=function(e){function i(e,t){var n,a,o;return et(this,i),a=i,o=[e,t,"/api/graphql-workspace",tl,tp],a=ea(a),(n=en(this,ts()?Reflect.construct(a,o||[],ea(this).constructor):a.apply(this,o))).tokenType="workspace",n}return eo(i,e),ei(i)}(eB);let tm={query:"query",mutation:"mutate"},t_=(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[tm[i]](c);({data:s,errors:d}=t||{})}if(d)throw Error(d.map(e=>e.message).join("\n"));return s?s[n]:null}},tg=[429],tf=[403];var ty=t(19074),t$=t(36054),tv=t(78342),th=t(74114),tb=t(42028),tI=t(99815),tk=t(79556),tA=t(17681),tD=t.n(tA),tw=t(10655);let tS=[403,429],tC=(0,el.default)`
2107
+ fragment mediaWorkspaceArguments on MediaWorkspace {
2108
+ __typename
2109
+ id
2110
+ name
2111
+ description
2112
+ owner
2113
+ serviceBinding
2114
+ createdAt
2115
+ updatedAt
2116
+ size
2117
+ sizeLimit
2118
+ aiFeaturesEnabled
2119
+ }
2120
+ `,tT=(0,el.default)`
2121
+ fragment boxArguments on MediaBox {
2122
+ __typename
2123
+ id
2124
+ name
2125
+ description
2126
+ tags
2127
+ owner
2128
+ workspaceId
2129
+ serviceBinding
2130
+ serviceBindingType
2131
+ passcodes {
2132
+ id
2133
+ name
2134
+ code
2135
+ enableExpired
2136
+ expiredAt
2137
+ removeable
2138
+ permissions
2139
+ }
2140
+ createdAt
2141
+ updatedAt
2142
+ previewUrl
2143
+ size
2144
+ }
2145
+ `,tx=(0,el.default)`
2146
+ fragment fileArguments on MediaFile {
2147
+ __typename
2148
+ id
2149
+ name
2150
+ description
2151
+ boxId
2152
+ owner
2153
+ userTags
2154
+ fileType
2155
+ meta {
2156
+ storageEndpoint
2157
+ originalFileUploaded
2158
+ originalFileKey
2159
+ originalFileSize
2160
+ originalFileEtag
2161
+ originalFileContentType
2162
+ originalWidth
2163
+ originalHeight
2164
+ convertedFileUploaded
2165
+ convertedFileKey
2166
+ convertedFileSize
2167
+ convertedFileEtag
2168
+ convertedFileContentType
2169
+ videoThumbOriginalFileUploaded
2170
+ videoThumbOriginalFileKey
2171
+ videoThumbOriginalFileSize
2172
+ videoThumbOriginalFileEtag
2173
+ videoThumbOriginalFileContentType
2174
+ videoThumbOriginalWidth
2175
+ videoThumbOriginalHeight
2176
+ uploadInfo
2177
+ imageVersions {
2178
+ key
2179
+ version
2180
+ etag
2181
+ contentType
2182
+ width
2183
+ height
2184
+ strategy
2185
+ }
2186
+ videoTransformed
2187
+ videoTransformedByClient
2188
+ videoTransformType
2189
+ customVideoWidth
2190
+ customVideoHeight
2191
+
2192
+ enableAiAnalysis
2193
+ aiCustomInstruction
2194
+ aiDescription
2195
+ aiTags
2196
+ aiAnalysisStatus
2197
+ aiAnalyzedAt
2198
+ }
2199
+ createdAt
2200
+ updatedAt
2201
+ }
2202
+ `,tB=(0,el.default)`
2203
+ fragment fileShortArguments on MediaFile {
2204
+ __typename
2205
+ id
2206
+ name
2207
+ description
2208
+ boxId
2209
+ owner
2210
+ userTags
2211
+ fileType
2212
+ meta {
2213
+ storageEndpoint
2214
+ originalFileKey
2215
+ originalFileSize
2216
+ originalFileContentType
2217
+ originalFileEtag
2218
+ originalWidth
2219
+ originalHeight
2220
+ convertedFileKey
2221
+ convertedFileSize
2222
+ convertedFileContentType
2223
+ convertedFileEtag
2224
+ videoThumbOriginalFileKey
2225
+ videoThumbOriginalFileSize
2226
+ videoThumbOriginalFileContentType
2227
+ videoThumbOriginalFileEtag
2228
+ videoThumbOriginalWidth
2229
+ videoThumbOriginalHeight
2230
+ imageVersions {
2231
+ key
2232
+ version
2233
+ etag
2234
+ size
2235
+ contentType
2236
+ width
2237
+ height
2238
+ strategy
2239
+ }
2240
+ enableAiAnalysis
2241
+ aiCustomInstruction
2242
+ aiDescription
2243
+ aiTags
2244
+ aiAnalysisStatus
2245
+ aiAnalyzedAt
2246
+ }
2247
+ createdAt
2248
+ updatedAt
2249
+ }
2250
+ `,tE=(0,el.default)`
2251
+ query MediaClient_workspaces {
2252
+ mediaWorkspaces {
2253
+ ...mediaWorkspaceArguments
2254
+ }
2255
+ }
2256
+ ${tC}
2257
+ `,tU=(0,el.default)`
2258
+ query MediaClient_boxes($workspaceId: UUID, $filter: String) {
2259
+ mediaBoxes(workspaceId: $workspaceId, filter: $filter) {
2260
+ ...boxArguments
2261
+ }
2262
+ }
2263
+ ${tT}
2264
+ `,tO=(0,el.default)`
2265
+ query MediaClient_workspace($workspaceId: UUID!) {
2266
+ mediaWorkspace(id: $workspaceId) {
2267
+ ...mediaWorkspaceArguments
2268
+ }
2269
+ }
2270
+ ${tC}
2271
+ `,tM=(0,el.default)`
2272
+ query MediaClient_box($boxId: UUID!) {
2273
+ mediaBox(boxId: $boxId) {
2274
+ ...boxArguments
2275
+ }
2276
+ }
2277
+ ${tT}
2278
+ `,tR=(0,el.default)`
2279
+ query MediaClient_files(
2280
+ $boxId: UUID!
2281
+ $includeTypes: [FileType!]
2282
+ $userTags: [String!]
2283
+ $limit: Int
2284
+ $offset: Int
2285
+ ) {
2286
+ mediaFiles(
2287
+ boxId: $boxId
2288
+ includeTypes: $includeTypes
2289
+ userTags: $userTags
2290
+ limit: $limit
2291
+ offset: $offset
2292
+ ) {
2293
+ ...fileShortArguments
2294
+ }
2295
+ }
2296
+ ${tB}
2297
+ `,tP=(0,el.default)`
2298
+ query MediaClient_file($fileId: UUID!) {
2299
+ mediaFile(fileId: $fileId) {
2300
+ ...fileArguments
2301
+ }
2302
+ }
2303
+ ${tx}
2304
+ `,tF=(0,el.default)`
2305
+ mutation MediaClient_createMediaWorkspace($name: String!, $description: String!) {
2306
+ createMediaWorkspace(name: $name, description: $description) {
2307
+ ...mediaWorkspaceArguments
2308
+ }
2309
+ }
2310
+ ${tC}
2311
+ `,tN=(0,el.default)`
2312
+ mutation MediaClient_updateMediaWorkspace($id: UUID!, $name: String, $description: String) {
2313
+ updateMediaWorkspace(id: $id, name: $name, description: $description) {
2314
+ ...mediaWorkspaceArguments
2315
+ }
2316
+ }
2317
+ ${tC}
2318
+ `,tq=(0,el.default)`
2319
+ mutation MediaClient_createMediaBox(
2320
+ $name: String!
2321
+ $description: String!
2322
+ $newPasscodes: [InputNewBoxPasscode!]!
2323
+ $workspaceId: UUID
2324
+ $tags: [String!]
2325
+ ) {
2326
+ createMediaBox(
2327
+ name: $name
2328
+ description: $description
2329
+ newPasscodes: $newPasscodes
2330
+ workspaceId: $workspaceId
2331
+ tags: $tags
2332
+ ) {
2333
+ ...boxArguments
2334
+ }
2335
+ }
2336
+ ${tT}
2337
+ `,tj=(0,el.default)`
2338
+ mutation MediaClient_moveMediaBox($id: UUID!, $workspaceId: UUID) {
2339
+ moveMediaBox(id: $id, workspaceId: $workspaceId) {
2340
+ ...boxArguments
2341
+ }
2342
+ }
2343
+ ${tT}
2344
+ `,tW=(0,el.default)`
2345
+ mutation MediaClient_updateMediaBox(
2346
+ $id: UUID!
2347
+ $name: String
2348
+ $description: String
2349
+ $newPasscodes: [InputNewBoxPasscode!]
2350
+ $removePasscodes: [UUID!]
2351
+ $tags: [String!]
2352
+ ) {
2353
+ updateMediaBox(
2354
+ id: $id
2355
+ name: $name
2356
+ description: $description
2357
+ newPasscodes: $newPasscodes
2358
+ removePasscodes: $removePasscodes
2359
+ tags: $tags
2360
+ ) {
2361
+ ...boxArguments
2362
+ }
2363
+ }
2364
+ ${tT}
2365
+ `,tV=(0,el.default)`
2366
+ mutation MediaClient_requestFileUpload(
2367
+ $name: String!
2368
+ $description: String!
2369
+ $boxId: UUID!
2370
+ $fileType: FileType!
2371
+ $contentType: String!
2372
+ $userTags: [String!]
2373
+ $meta: RequestUploadMeta!
2374
+ ) {
2375
+ requestFileUpload(
2376
+ name: $name
2377
+ description: $description
2378
+ boxId: $boxId
2379
+ fileType: $fileType
2380
+ contentType: $contentType
2381
+ userTags: $userTags
2382
+ meta: $meta
2383
+ ) {
2384
+ ...fileArguments
2385
+ }
2386
+ }
2387
+ ${tx}
2388
+ `,tH=(0,el.default)`
2389
+ mutation MediaClient_updateMediaFile(
2390
+ $fileId: UUID!
2391
+ $name: String!
2392
+ $description: String!
2393
+ $userTags: [String!]
2394
+ $requestUploadAgain: Boolean!
2395
+ ) {
2396
+ updateMediaFile(
2397
+ fileId: $fileId
2398
+ name: $name
2399
+ description: $description
2400
+ userTags: $userTags
2401
+ requestUploadAgain: $requestUploadAgain
2402
+ ) {
2403
+ ...fileArguments
2404
+ }
2405
+ }
2406
+ ${tx}
2407
+ `,tY=(0,el.default)`
2408
+ mutation MediaClient_updateMediaFiles(
2409
+ $fileIds: [UUID!]!
2410
+ $name: String
2411
+ $description: String
2412
+ $userTags: [String!]
2413
+ ) {
2414
+ updateMediaFiles(fileIds: $fileIds, name: $name, description: $description, userTags: $userTags)
2415
+ }
2416
+ `,tK=(0,el.default)`
2417
+ mutation MediaClient_deleteMediaFiles($boxId: UUID!, $list: [UUID!]!) {
2418
+ deleteMediaFiles(boxId: $boxId, list: $list)
2419
+ }
2420
+ `,tG=(0,el.default)`
2421
+ mutation MediaClient_copyMediaFiles($fromBoxId: UUID!, $toBoxId: UUID!, $list: [UUID!]!) {
2422
+ copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, list: $list)
2423
+ }
2424
+ `,tL=(0,el.default)`
2425
+ mutation MediaClient_setMediaFileAsBoxPreview($id: UUID!) {
2426
+ setMediaFileAsBoxPreview(id: $id)
2427
+ }
2428
+ `,tz=(0,el.default)`
2429
+ mutation MediaClient_assignGroupPermissions(
2430
+ $roleId: String!
2431
+ $instanceType: InstanceType!
2432
+ $instanceId: UUID!
2433
+ $permissions: [String!]!
2434
+ ) {
2435
+ assignGroupPermissions(
2436
+ roleId: $roleId
2437
+ instanceType: $instanceType
2438
+ instanceId: $instanceId
2439
+ permissions: $permissions
2440
+ )
2441
+ }
2442
+ `,tJ=(0,el.default)`
2443
+ subscription MediaClient_listenBoxChanged($boxId: UUID!, $types: [ChangeType!]) {
2444
+ mediaBoxChanged(boxId: $boxId, types: $types) {
2445
+ createType
2446
+ id
2447
+ file {
2448
+ ...fileArguments
2449
+ }
2450
+ boxPayload {
2451
+ fileList
2452
+ includeTypes
2453
+ }
2454
+ }
2455
+ }
2456
+ ${tx}
2457
+ `,tX=(0,el.default)`
2458
+ query MediaClient_box($boxId: UUID!, $passcode: String!) {
2459
+ mediaBox(boxId: $boxId, passcode: $passcode) {
2460
+ ...boxArguments
2461
+ }
2462
+ }
2463
+ ${tT}
2464
+ `,tQ=(0,el.default)`
2465
+ query MediaClient_files(
2466
+ $boxId: UUID!
2467
+ $passcode: String!
2468
+ $includeTypes: [FileType!]
2469
+ $userTags: [String!]
2470
+ $limit: Int
2471
+ $offset: Int
2472
+ ) {
2473
+ mediaFiles(
2474
+ boxId: $boxId
2475
+ passcode: $passcode
2476
+ includeTypes: $includeTypes
2477
+ userTags: $userTags
2478
+ limit: $limit
2479
+ offset: $offset
2480
+ ) {
2481
+ ...fileShortArguments
2482
+ }
2483
+ }
2484
+ ${tB}
2485
+ `,tZ=(0,el.default)`
2486
+ query MediaClient_file($fileId: UUID!, $passcode: String!) {
2487
+ mediaFile(fileId: $fileId, passcode: $passcode) {
2488
+ ...fileArguments
2489
+ }
2490
+ }
2491
+ ${tx}
2492
+ `,t0=(0,el.default)`
2493
+ mutation MediaClient_requestFileUpload(
2494
+ $name: String!
2495
+ $description: String!
2496
+ $boxId: UUID!
2497
+ $passcode: String!
2498
+ $fileType: FileType!
2499
+ $contentType: String!
2500
+ $userTags: [String!]
2501
+ $meta: RequestUploadMeta!
2502
+ ) {
2503
+ requestFileUpload(
2504
+ name: $name
2505
+ description: $description
2506
+ boxId: $boxId
2507
+ passcode: $passcode
2508
+ fileType: $fileType
2509
+ contentType: $contentType
2510
+ userTags: $userTags
2511
+ meta: $meta
2512
+ ) {
2513
+ ...fileArguments
2514
+ }
2515
+ }
2516
+ ${tx}
2517
+ `,t1=(0,el.default)`
2518
+ mutation MediaClient_updateMediaFile(
2519
+ $boxId: UUID!
2520
+ $passcode: String!
2521
+ $fileId: UUID!
2522
+ $name: String
2523
+ $description: String
2524
+ $userTags: [String!]
2525
+ $requestUploadAgain: Boolean!
2526
+ ) {
2527
+ updateMediaFile(
2528
+ boxId: $boxId
2529
+ passcode: $passcode
2530
+ fileId: $fileId
2531
+ name: $name
2532
+ description: $description
2533
+ userTags: $userTags
2534
+ requestUploadAgain: $requestUploadAgain
2535
+ ) {
2536
+ ...fileArguments
2537
+ }
2538
+ }
2539
+ ${tx}
2540
+ `,t4=(0,el.default)`
2541
+ mutation MediaClient_updateMediaFiles(
2542
+ $boxId: UUID!
2543
+ $passcode: String!
2544
+ $fileIds: [UUID!]!
2545
+ $name: String
2546
+ $description: String
2547
+ $userTags: [String!]
2548
+ ) {
2549
+ updateMediaFiles(
2550
+ boxId: $boxId
2551
+ passcode: $passcode
2552
+ fileIds: $fileIds
2553
+ name: $name
2554
+ description: $description
2555
+ userTags: $userTags
2556
+ )
2557
+ }
2558
+ `,t6=(0,el.default)`
2559
+ mutation MediaClient_deleteMediaFiles($boxId: UUID!, $passcode: String!, $list: [UUID!]!) {
2560
+ deleteMediaFiles(boxId: $boxId, passcode: $passcode, list: $list)
2561
+ }
2562
+ `,t5=(0,el.default)`
2563
+ subscription MediaClient_listenBoxChanged(
2564
+ $boxId: UUID!
2565
+ $passcode: String!
2566
+ $types: [ChangeType!]
2567
+ ) {
2568
+ mediaBoxChanged(boxId: $boxId, passcode: $passcode, types: $types) {
2569
+ createType
2570
+ id
2571
+ file {
2572
+ ...fileArguments
2573
+ }
2574
+ boxPayload {
2575
+ fileList
2576
+ includeTypes
2577
+ }
2578
+ }
2579
+ }
2580
+ ${tx}
2581
+ `,t2=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 t9=t(67996),t3=["authorization"],t8=`
2582
+ query AL_events($filter: EventsFilter!) {
2583
+ events(filter: $filter) {
2584
+ device_id
2585
+ event_type
2586
+ event_name
2587
+ subspace_id
2588
+ sender
2589
+ payload
2590
+ timestamp
2591
+ }
2592
+ }
2593
+ `,t7=`
2594
+ query AL_screenshots($filter: ScreenshotFilter!) {
2595
+ screenshots(filter: $filter) {
2596
+ timestamp
2597
+ }
2598
+ }
2599
+ `,ne=ei(function e(i,t){var n;et(this,e),this.baseUrl=i,this.auth="string"==typeof t?{token:t,getHeaders:(n=b(function*(){return{authorization:`Bearer ${t}`}}),function(){return n.apply(this,arguments)})}:t,this.token=this.auth?.token,this.graphqlUrl=`${i}/api/graphql`},[{key:"authHeaders",value:(o=b(function*(){var e=yield this.auth.getHeaders();return{Authorization:e.authorization,...t9(e,t3)}}),function(){return o.apply(this,arguments)})},{key:"graphql",value:(r=b(function*(e,i){var t=yield(0,U.Ay)(this.graphqlUrl,{method:"POST",headers:{"Content-Type":"application/json",...yield this.authHeaders(),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 r.apply(this,arguments)})},{key:"events",value:(s=b(function*(e,{limit:i,offset:t}={}){var n={...e};return null!=i&&(n.limit=i),null!=t&&(n.offset=t),(yield this.graphql(t8,{filter:n})).events}),function(e){return s.apply(this,arguments)})},{key:"screenshots",value:(d=b(function*(e){return(yield this.graphql(t7,{filter:e})).screenshots}),function(e){return d.apply(this,arguments)})},{key:"downloadScreenshot",value:(c=b(function*(e,i,t){var n=`${this.baseUrl}/api/v1/${encodeURIComponent(e)}/${encodeURIComponent(i)}/screenshot?ts=${encodeURIComponent(t)}`,a=yield(0,U.Ay)(n,{headers:yield this.authHeaders()});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 c.apply(this,arguments)})}]);function ni(e,i,t){switch(t){case"user":return new iq(e,i);case"workspace":return new tu(e,i);default:throw Error(`Invalid token type: ${t}.`)}}process.env.STAGE,process.env.URL_BASE;var nt="bricks-mcp",nn={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 na=t(1639);let no=({type:e,title:i,template_key:t})=>{var n,a,o=(0,na.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=G(K.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,na.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=G(K.dK.Basic),d=G(K.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=G(K.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(K.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,na.M4)("property_bank_command"),u=(0,na.M4)("property_bank_command"),m=(0,na.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 Z({id:o,example:n,extraInfo:a})};var nr={readOnlyHint:!0,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1},ns=(l=b(function*(e,i){var t=new AbortController,n=setTimeout(()=>t.abort(),15e3);try{var a=yield(0,U.Ay)(e,{agent:i,size:0x6400000,signal:t.signal});if(!a.ok)throw Error(`source_url responded with HTTP ${a.status}`);var o=Number(a.headers.get("content-length"));if(Number.isFinite(o)&&o>0x6400000)throw Error("source_url response exceeds the 100 MiB download limit");var r=a.headers.get("content-type")||"application/octet-stream";return{data:yield a.blob(),contentType:r}}catch(e){if(e?.name==="AbortError")throw Error("source_url download exceeded the 15s time limit");throw e}finally{clearTimeout(n),t.abort()}}),function(e,i){return l.apply(this,arguments)}),nd="The `bricks_project_last_commit_id` returned when you read it. The server refuses the write if someone saved in between, instead of overwriting their change.",nc=(p=b(function*(e,i){try{return yield i()}catch(i){if(!/config conflict: lastCommitId mismatch/.test(i?.message))throw i;throw Error(`${i.message} Someone else saved after you read it. Call ${e} again, apply your change to the config it returns, and retry with its bricks_project_last_commit_id as last_commit_id.`)}}),function(e,i){return p.apply(this,arguments)}),nl="2.26.0-beta.41";function np(){return nu.apply(this,arguments)}function nu(){return(nu=b(function*(e={}){var i,t,n=e.baseUrl||nn.bricks,a=e.activityLogBaseUrl||nn.activityLog,o=!e.token&&!!e.getAuthHeaders,r=e.token||!e.getAuthHeaders&&process.env.BRICKS_API_TOKEN,s=null;if(!r&&e.getAuthHeaders){var d=yield e.getAuthHeaders();r=d.authorization?.replace(/^Bearer /,""),s=d["x-bricks-workspace-id"]||null}if(!r)throw console.error("Error: API token is required"),console.error(o?"OAuth sign-in did not produce credentials. Run `bricks auth login` again.":"Please provide a token via options or set BRICKS_API_TOKEN environment variable"),Error("API token is required");var c=function(e){try{var i,t,n=new Headers(e.headers||{}).get("authorization");if(null!==n?(i=n.match(/^(?:Bearer +)?([^\s]+)$/i)?.[1])&&!/^Bearer +/i.test(n)&&(t="raw_header"):(i=e.queryStringParameters?.token)&&(t="query"),t&&console.warn(JSON.stringify({event:"legacy_token_transport",transport:t})),!i)return{success:!1,message:"Authentication failed: No bearer token provided",...null!==n?{error:"invalid_token"}:{}};var a=function(e){try{var i=e.split(".");if(i.length<3)return null;var t=JSON.parse(Buffer.from(i[0],"base64url").toString());if(!w.includes(t?.alg))return null;var n=JSON.parse(Buffer.from(i[1],"base64url").toString());return n&&"object"==typeof n&&!Array.isArray(n)?n:null}catch{return null}}(i);if(!a)return{success:!1,message:"Authentication failed: Invalid token",error:"invalid_token"};if(void 0!==a.exp&&(!Number.isFinite(a.exp)||Date.now()/1e3>=a.exp+30))return{success:!1,message:"Authentication failed: Expired or invalid token expiry",error:"invalid_token"};var o=C(a)?"user":"workspace";if("workspace"===o){var r=Array.isArray(a.t)?a.t:[];a.permissions=r.reduce((e,i)=>{var t=D[i];return t&&e.push(t),e},[])}else a.permissions=Object.keys(A);return{success:!0,token:i,tokenInfo:a,tokenType:o}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}({headers:{Authorization:`Bearer ${r}`}});if(!c.success){var l=o?"Invalid OAuth session credentials — run `bricks auth login` again":"Invalid BRICKS_API_TOKEN";throw console.error(`Error: ${l}`),console.error(c.message),Error(l)}var p=new I._({name:nt,version:nl});if(e.getAuthHeaders&&s){var u={token:r,getHeaders:e.getAuthHeaders};t={...c,tokenType:"workspace",tokenInfo:{...c.tokenInfo,w_id:s,permissions:Object.keys(A)},auth:u,client:ni(n,u,"workspace")}}else t={...c,client:ni(n,c.token,c.tokenType)};p.prompt("getting-started","Getting started with BRICKS",{},b(function*(){return{messages:[{role:"user",content:{type:"text",text:`Welcome to BRICKS — start here.
2600
+
2601
+ Before doing any complex work (application design, deployments, etc.),
2602
+ always consult the official docs rather than guessing.
2603
+
2604
+ IMPORTANT: BRICKS users interact through a GUI editor, not raw config files.
2605
+ Never show users JSON config details, schema fields, or technical implementation.
2606
+ Focus on user-friendly descriptions of what the app will do and how it will look.
2607
+
2608
+ Golden rules for working with BRICKS:
2609
+ 1) Read before you act
2610
+ - Open these resources first, then proceed:
2611
+ - \`getting-started\` — overview & architecture
2612
+ - \`config-schema\` — canonical schema for apps, subspaces, bricks, generators, etc.
2613
+ - \`components-index\` — available bricks/generators
2614
+ 2) Source of truth
2615
+ - Rely on the docs above; do not invent fields not present in the schema
2616
+ 3) No guessing
2617
+ - If names, constraints, or device details are missing, ask to fetch them first
2618
+ 4) Plan then execute
2619
+ - Propose a clear step-by-step plan and wait for approval before writing or mutating data
2620
+ 5) User-friendly communication
2621
+ - Describe features in terms of what users see and do, not technical config
2622
+ - Use visual/functional language: "text display", "button", "screen transition"
2623
+ - Avoid exposing JSON, IDs, or schema details to end users
2624
+
2625
+ BRICKS essentials:
2626
+ - Applications: interactive digital signage experiences
2627
+ - Devices: deployment targets (screens/players)
2628
+ - Modules: Reusable module across applications
2629
+ - Grid system: default 96\xd754; 1 unit = device_width/96 (e.g., 20px at 1920\xd71080)
2630
+ - Key primitives: Subspaces, Canvas, Bricks, Generators, Property Banks (Data)
2631
+
2632
+ Quick actions:
2633
+ - "Create a new application" → use the \`create-application\` prompt
2634
+ - "Deploy an application to a device" → use the \`deploy-to-device\` prompt
2635
+
2636
+ Try asking:
2637
+ - "Draft a plan to create an app with a text display and deploy it; ask any missing questions first"`}}]}})),p.prompt("create-application","Create a new BRICKS application with guided setup",{app_name:T.Yj().describe("Name for the new application"),description:T.Yj().describe("Short description for the new application").optional()},(i=b(function*(e){var i=e?.app_name||"New Application",t=e?.description||"";return{messages:[{role:"user",content:{type:"text",text:`Help me create a new BRICKS application called "${i}".
2638
+
2639
+ ${t?`Goal: ${t}`:""}
2640
+
2641
+ IMPORTANT: Users see a visual GUI editor, not raw config. Describe features in user-friendly terms:
2642
+ - "text display" not "BRICK_TEXT"
2643
+ - "image" not "BRICK_IMAGE"
2644
+ - "canvas name" not "CANVAS_xxx"
2645
+ - "data storage" not "PROPERTY_BANK"
2646
+ - Focus on what users see and do, not technical implementation
2647
+
2648
+ How we'll proceed (no guessing, schema-first):
2649
+ 1) Confirm intent
2650
+ - Restate objectives and success criteria in 1–3 bullets
2651
+ 2) Consult docs (as needed)
2652
+ - getting-started, config-schema, components-index
2653
+ - Ensure proposed fields exist in the schema
2654
+ 3) Ask missing questions before changes
2655
+ - Target device(s) and resolution(s)
2656
+ - Layout needs (pages/screens), content types, data sources
2657
+ - Localization, scheduling, or interaction needs
2658
+ 4) Propose a minimal viable design (After confirming intent)
2659
+ - App structure: screens → visual elements
2660
+ - Initial component selection with rationale
2661
+ - Grid usage: default 96\xd754 (≈20px at 1920\xd71080)
2662
+ 5) Produce a schema-valid skeleton (no side effects yet)
2663
+ - Include only fields defined by config-schema
2664
+ - Use clear placeholders for text/assets/URLs/ids
2665
+
2666
+ What I'll produce first:
2667
+ - Short recap of requirements
2668
+ - Clarifying questions (only what's necessary)
2669
+ - High-level architecture plan
2670
+ - Minimal config skeleton that validates against the schema`}}]}}),function(e){return i.apply(this,arguments)})),p.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"},b(function*(){return{contents:[{uri:"file://docs/getting-started.md",mimeType:"text/markdown",text:x}]}})),function(e,i,{activityLogBaseUrl:t=nn.activityLog}={}){var n,a="user"===i.tokenType,o=ee(i),r=((e,i=null)=>({name:t,description:n,inputSchema:a,annotations:o,permission:r,workspaceTokenOnly:s=!1},d)=>{!(s&&ee(i))&&(!r||i.tokenInfo.permissions?.includes(r)||0)&&e.tool(t,n,a,o,d)})(e,i),s=e=>({...e,...a?{workspace_id:T.Yj().describe("Workspace ID")}:{}}),d=i.client,c=a?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={};o&&(u.origin=o),n&&a||(u.authorization=`Bearer ${t}`);let m=new th.z({uri:e,headers:u});if(r){let e,t,n;l=(0,tI.UU)({url:i,lazy:!0,connectionParams:u,retryAttempts:1/0,shouldRetry:()=>!0,keepAlive:1e4,on:{error:e=>{n(),d?.(e)},opened:i=>{d?.(),e=i,n()},ping:i=>{i||(n(),t=setTimeout(()=>{e&&e.readyState===WebSocket.OPEN&&e.close(4205,"Client Restart")},5e3))},pong:e=>{e&&n()},closed:n=()=>{t&&(clearTimeout(t),t=void 0)}}}),p=new tb.c(l)}let _=ty.C.from([(0,tk.S)(({networkError:e,operation:i})=>{if(e){let t;if(c(e,i),!1===i.getContext().suppressExpectedErrors)return;let n=e?.message||"";if("Aborted"===(t=e?.message)||e?.name==="AbortError"||"Timeout exceeded"===t||e?.timeout||e?.statusCode===403||e?.status===403||n.includes("Too many requests")||e?.response?.status===429||e?.statusCode===429||e?.status===429)return new t$.c(e=>e.complete())}}),s&&new tv.z({attempts:{max:3,retryIf:e=>(function(e,{nonRetryableResponseStatusCodes:i=tg,nonRetryableStatusCodes:t=tf}={}){if(!e)return!1;let n="string"==typeof e?.message?e.message:"string"==typeof e?e:"";return!(n.includes("Too many requests")||i.includes(e?.response?.status)||t.includes(e?.statusCode)||t.includes(e?.status)||e?.timeout||"Timeout exceeded"===n)&&"Aborted"!==n&&e?.name!=="AbortError"})(e,{nonRetryableStatusCodes:tS})}}),new(tD())(3e4),r?ty.C.split(({query:e})=>{let{kind:i,operation:t}=(0,tw.Vn)(e);return"OperationDefinition"===i&&"subscription"===t},p,m):m].filter(Boolean));return _.closeSubscriptionClient=()=>r&&l.dispose().catch(e=>{if(1e3!==e.code)throw e}),_}({endpointURL:u,subscriptionEndpointURL:u.replace(/^http/,"ws"),accessToken:i,enableSubscription:!p&&a,enableRetry:o,subscriptionOnConnectionOrError:r,onNetworkError:s}),c=new ed.D,(l=new es.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=v,i.mutations=h;let t={boxId:e.boxId,passcode:e.passcode};Object.entries(v).forEach(t_(i,"query",t)),Object.entries(h).forEach(t_(i,"mutation",t)),i.listenBoxChanged=(e,n)=>i.subscribe({query:t5,variables:{...t,...e}}).subscribe({next:t2(n),error(e){n(e)}})}else i.accessToken=e.accessToken,i.type="token",i.queries=y,i.mutations=$,Object.entries(y).forEach(t_(i,"query")),Object.entries($).forEach(t_(i,"mutation")),i.listenBoxChanged=(e,t)=>i.subscribe({query:tJ,variables:e}).subscribe({next:t2(t),error(e){t(e)}});return i})({endpoint:i,accessToken:t,enableSubscription:!1,enableRetry:!0})}({endpoint:nn.media,accessToken:i.token}):d,l=e=>a?{fileId:e}:{id:e},p=e=>a?{list:e}:{fileIds:e},u=e=>e.toUpperCase(),m=e=>e?.map(u);if(a&&e.tool("list_workspaces","List all workspaces",{},nr,b(function*(){return Z((yield d.workspaces()))})),r({name:"get_workspace_overview",annotations:nr,description:"Get comprehensive overview of the BRICKS workspace including stats and summary",inputSchema:s({}),permission:"info"},(_=b(function*({workspace_id:e}){var i=B((yield Promise.all([d.workspace({id:e}),d.applications({workspaceId:e,paginate:{limit:50,offset:0}}),d.modules({workspaceId:e,paginate:{limit:50,offset:0}}),d.devices({workspaceId:e,paginate:{limit:50,offset:0}}),a?c.mediaWorkspace({workspaceId:e}).catch(()=>null):c.mediaWorkspace().catch(()=>null),a?c.mediaBoxes({workspaceId:e}).catch(()=>[]):c.mediaBoxes().catch(()=>[])])),6),t=i[0],n=i[1],o=i[2],r=i[3],s=i[4],l=i[5];if(!t)throw Error("Authentication failed, please check your token");return Z({workspace:t,stats:{applications:n?.length??"No permission",modules:o?.length??"No permission",devices:r?.length??"No permission",running_apps:n?.filter(e=>e.status?.running).length??"No permission",media_boxes:l?.length??"No permission",media_enabled:!!s,notes:"Note: The stats are based on the first 50 applications, modules, and devices in the workspace."},recent_activity:{latest_apps:n?.slice(0,5).map(e=>({id:e._id,name:e.name,status:e.status?.running?"running":"stopped",last_update:e.last_modify_datetime}))||[]},media_info:s?{workspace_id:s.id,name:s.name,size_used:s.size,size_limit:s.sizeLimit,boxes: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 _.apply(this,arguments)})),r({name:"get_applications",annotations:nr,description:"List all applications in the workspace",inputSchema:s({limit:T.ai().describe("Maximum number of applications to return").optional().default(50),offset:T.ai().describe("Number of applications to skip").optional().default(0)}),permission:"query_application"},(g=b(function*({workspace_id:e,limit:i=50,offset:t=0}){return Z((yield d.applications({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return g.apply(this,arguments)})),r({name:"get_application",annotations:nr,description:"Get detailed info and config of a specific application. `bricks_project_last_commit_id` is the config revision to pass to update_application_config, and `dev_ref.is_dev` tells whether the application is a dev fork.",inputSchema:s({id:T.Yj().describe("Application ID")}),permission:"query_application"},(f=b(function*({workspace_id:e,id:i}){return Z((yield d.application({workspaceId:e,id:i})))}),function(e){return f.apply(this,arguments)})),r({name:"get_modules",annotations:nr,description:"List all modules in the workspace",inputSchema:s({limit:T.ai().describe("Maximum number of modules to return").optional().default(50),offset:T.ai().describe("Number of modules to skip").optional().default(0)}),permission:"query_module"},(I=b(function*({workspace_id:e,limit:i=50,offset:t=0}){return Z((yield d.modules({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return I.apply(this,arguments)})),r({name:"get_module",annotations:nr,description:"Get detailed info and config of a specific module. `bricks_project_last_commit_id` is the config revision to pass to update_module_config.",inputSchema:s({id:T.Yj().describe("Module ID")}),permission:"query_module"},(k=b(function*({workspace_id:e,id:i}){return Z((yield d.module({workspaceId:e,id:i})))}),function(e){return k.apply(this,arguments)})),r({name:"update_module_info",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},description:"Update a specific module info",inputSchema:s({id:T.Yj().describe("Module ID"),name:T.Yj().describe("Module name"),description:T.Yj().describe("Module description")}),permission:"update_module"},(A=b(function*({workspace_id:e,id:i,name:t,description:n}){return Z((yield d.updateModule({workspaceId:e,id:i,name:t,description:n})))}),function(e){return A.apply(this,arguments)})),r({name:"update_module_config",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},description:"Update a specific module configuration. Applications that use the module get the change at once.",inputSchema:s({id:T.Yj().describe("Module ID"),config:T.Ik({}).passthrough().describe("New configuration object, see file://docs/config-schema.md for schema reference"),last_commit_id:T.Yj().optional().describe(nd)}),permission:"update_module",workspaceTokenOnly:!0},(D=b(function*({workspace_id:e,id:i,config:t,last_commit_id:n}){var a=yield H(t);if(!a.valid)throw Error(`Config validation failed: ${a.errors.join(", ")}`);return Z((yield nc("get_module",()=>d.updateModule({workspaceId:e,id:i,config:JSON.stringify(t),validateConfig:!0,lastCommitId:n}))))}),function(e){return D.apply(this,arguments)})),r({name:"get_devices",annotations:nr,description:"List all devices in the workspace",inputSchema:s({limit:T.ai().describe("Maximum number of devices to return").optional().default(50),offset:T.ai().describe("Number of devices to skip").optional().default(0)}),permission:"query_device"},(w=b(function*({workspace_id:e,limit:i=50,offset:t=0}){return Z((yield d.devices({workspaceId:e,paginate:{limit:i,offset:t}})))}),function(e){return w.apply(this,arguments)})),r({name:"create_application",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},description:"Create a new BRICKS application with default grid layout",inputSchema:s({name:T.Yj().describe("Application name"),description:T.Yj().describe("Application description").optional(),grid_width:T.ai().describe("Grid width in units").optional().default(96),grid_height:T.ai().describe("Grid height in units").optional().default(54)}),permission:"create_application"},(S=b(function*({workspace_id:e,name:i,description:t,grid_width:n,grid_height:a}){return Z((yield d.createApplication({workspaceId:e,name:i,description:t,gridWidth:n,gridHeight:a})))}),function(e){return S.apply(this,arguments)})),r({name:"update_application_info",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},description:"Update application info",inputSchema:{id:T.Yj().describe("Application ID"),name:T.Yj().describe("Application name"),description:T.Yj().describe("Application description")},permission:"update_application"},(C=b(function*({id:e,name:i,description:t}){return Z((yield d.updateApplication({id:e,name:i,description:t})))}),function(e){return C.apply(this,arguments)})),r({name:"fork_application",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},description:"Create a dev fork of an application: a copy with no bound devices. Changes to the fork do not reach the devices of the original application.",inputSchema:{id:T.Yj().describe("ID of the application to fork (not a dev fork itself)")},permission:"create_application"},(x=b(function*({id:e}){return Z((yield d.forkApplication({id:e})))}),function(e){return x.apply(this,arguments)})),r({name:"update_application_config",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},description:o?"Update the configuration of a dev fork application with validation. Only a dev fork (see fork_application) can be written in an OAuth session; publishing the fork to the original application is done by a person in BRICKS Controller.":"Update application configuration with validation. Devices bound to the application get the change at once.",inputSchema:{id:T.Yj().describe("Application ID"),config:T.Ik({}).passthrough().describe("New application configuration. Please read `getting-started` for BRICKS concepts before changing"),last_commit_id:T.Yj().optional().describe(nd)},permission:"update_application"},(R=b(function*({id:e,config:i,last_commit_id:t}){if(o){var n=yield d.application({id:e});if(!n?.dev_ref?.is_dev)throw Error(`Application ${e} is not a dev fork. An OAuth session cannot change an application that may run on devices. Call fork_application, then update the fork.`)}var a=yield H(i);if(!a.valid)throw Error(`Config validation failed: ${a.errors.join(", ")}`);return Z((yield nc("get_application",()=>d.updateApplication({id:e,config:JSON.stringify(i),validateConfig:!0,lastCommitId:t}))))}),function(e){return R.apply(this,arguments)})),r({name:"bind_application",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},description:"Bind application to device with viewport configuration",inputSchema:{app_id:T.Yj().describe("Application ID"),viewports:T.YO(T.Ik({device_id:T.Yj().describe("Device ID"),x:T.ai().describe("X coordinate"),y:T.ai().describe("Y coordinate"),width:T.ai().describe("Width"),height:T.ai().describe("Height"),rotate:T.ai().describe("Rotation"),rotateType:T.Yj().describe("Rotation type")})).describe("Viewport configuration")},permission:"bind_application",workspaceTokenOnly:!0},(P=b(function*({app_id:e,viewports:i}){return Z((yield d.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 P.apply(this,arguments)})),r({name:"unbind_application",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!1,openWorldHint:!0},description:"Unbind application from device",inputSchema:{app_id:T.Yj().describe("Application ID"),device_id:T.Yj().describe("Device ID")},permission:"bind_application",workspaceTokenOnly:!0},(F=b(function*({app_id:e,device_id:i}){return Z((yield d.bindApplication({id:e,unbindDevices:[i]})))}),function(e){return F.apply(this,arguments)})),a&&r({name:"list_media_workspaces",annotations:nr,description:"List all media workspaces",inputSchema:{},permission:"query_media_flow"},b(function*(){return Z((yield c.mediaWorkspaces()))})),r({name:"get_media_workspace",annotations:nr,description:"Get media workspace information and status",inputSchema:s({}),permission:"query_media_flow"},(N=b(function*({workspace_id:e}){return Z((yield c.mediaWorkspace({workspaceId:e})))}),function(e){return N.apply(this,arguments)})),r({name:"list_media_boxes",annotations:nr,description:"List all media boxes in the workspace",inputSchema:s({}),permission:"query_media_flow"},(q=b(function*({workspace_id:e}){return Z((yield c.mediaBoxes({workspaceId:e})))}),function(e){return q.apply(this,arguments)})),r({name:"get_media_box",annotations:nr,description:"Get detailed information about a specific media box",inputSchema:{box_id:T.Yj().describe("Media box ID")},permission:"query_media_flow"},(j=b(function*({box_id:e}){return Z((yield c.mediaBox({boxId:e})))}),function(e){return j.apply(this,arguments)})),r({name:"list_media_files",annotations:nr,description:"List media files in a specific box with filtering options",inputSchema:{box_id:T.Yj().describe("Media box ID"),include_types:T.YO(T.Yj()).optional().describe('Filter by file types (e.g., ["image", "video", "audio"])'),user_tags:T.YO(T.Yj()).optional().describe("Filter by user tags"),limit:T.ai().optional().default(50).describe("Maximum number of files to return"),offset:T.ai().optional().default(0).describe("Number of files to skip")},permission:"query_media_flow"},(W=b(function*({box_id:e,include_types:i,user_tags:t,limit:n,offset:a}){return Z((yield c.mediaFiles({boxId:e,includeTypes:m(i),userTags:t,limit:n,offset:a})))}),function(e){return W.apply(this,arguments)})),r({name:"get_media_file_meta",annotations:nr,description:"Get detailed information about a specific media file",inputSchema:{file_id:T.Yj().describe("Media file ID")},permission:"query_media_flow"},(V=b(function*({file_id:e}){return Z((yield c.mediaFile(l(e))))}),function(e){return V.apply(this,arguments)})),r({name:"media_box_upload",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0},description:"Upload a file to a media box from URL or base64 data",inputSchema:{box_id:T.Yj().describe("Target media box ID"),name:T.Yj().describe("File name"),description:T.Yj().optional().default("").describe("File description"),file_type:T.k5(["image","video","audio","file"]).describe("File type"),source_url:T.Yj().optional().describe("URL to download the file from (maximum 100 MiB)"),base64_data:T.Yj().optional().describe("Base64 encoded file data"),user_tags:T.YO(T.Yj()).optional().default([]).describe("User-defined tags for the file")},permission:"write_media_flow"},(Y=b(function*({box_id:e,name:i,description:t,source_url:n,base64_data:a,file_type:o,user_tags:r}){if(!n&&!a)throw Error("Either source_url or base64_data must be provided");if(n&&a)throw Error("Provide either source_url OR base64_data, not both");var s,d="application/octet-stream";if(n){var l=yield ns(n,(0,O.fJ)(n));s=l.data,d=l.contentType}else s=new Blob([E.Buffer.from(a,"base64")],{type:d});var p=yield c.requestFileUpload({name:i,description:t,boxId:e,fileType:u(o),contentType:d,userTags:r,meta:{}}),m=!1;try{var _=JSON.parse(p?.meta.uploadInfo),g=new FormData;g.append("file",s),g.append("Content-Type",d),g.append("AWSAccessKeyId",_.AWSAccessKeyId),g.append("Signature",_.Signature),g.append("Policy",_.Policy),g.append("acl",_.acl),g.append("key",_.key),m=yield(0,U.Ay)(_.url,{method:"POST",body:g}).then(e=>e.ok).catch(()=>!1)}catch{m=!1}return Z({file_id:p.id,upload_success:m,upload_info:{content_type:d,file_type:o,source_type:n?"url":"base64",processing_note:"File will be processed automatically. Use get_media_file to check processing status."}})}),function(e){return Y.apply(this,arguments)})),r({name:"update_media_file_meta",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},description:"Update media file information",inputSchema:{file_id:T.Yj().describe("Media file ID"),name:T.Yj().optional().describe("New file name"),description:T.Yj().optional().describe("New file description"),user_tags:T.YO(T.Yj()).optional().describe("New user tags")},permission:"write_media_flow"},(K=b(function*({file_id:e,name:i,description:t,user_tags:n}){return Z((yield c.updateMediaFile({...l(e),name:i,description:t,userTags:n,requestUploadAgain:!1})))}),function(e){return K.apply(this,arguments)})),r({name:"copy_media_files",annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!1},description:"Copy media files from one box to another",inputSchema:{from_box_id:T.Yj().describe("Source media box ID"),to_box_id:T.Yj().describe("Target media box ID"),file_ids:T.YO(T.Yj()).describe("Array of media file IDs to copy")},permission:"write_media_flow"},(G=b(function*({from_box_id:e,to_box_id:i,file_ids:t}){return Z((yield c.copyMediaFiles({fromBoxId:e,toBoxId:i,...p(t)})))}),function(e){return G.apply(this,arguments)})),r({name:"delete_media_files",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},description:"Delete specific media files from a box",inputSchema:{box_id:T.Yj().describe("Media box ID"),file_ids:T.YO(T.Yj()).describe("Array of media file IDs to delete")},permission:"write_media_flow"},(L=b(function*({box_id:e,file_ids:i}){return Z((yield c.deleteMediaFiles({boxId:e,...p(i)})))}),function(e){return L.apply(this,arguments)})),r({name:"cleanup_media_box",annotations:{readOnlyHint:!1,destructiveHint:!0,idempotentHint:!0,openWorldHint:!1},description:"Delete all files in a media box, optionally filtered by type",inputSchema:{box_id:T.Yj().describe("Media box ID"),include_types:T.YO(T.Yj()).optional().describe('Only delete files of these types (e.g., ["image", "video"])')},permission:"write_media_flow"},(z=b(function*({box_id:e,include_types:i}){var t=m(i);if("deleteMediaBoxFiles"in c)return Z((yield c.deleteMediaBoxFiles({boxId:e,includeTypes:t})));var n=yield c.mediaFiles({boxId:e,includeTypes:t});return Z((yield c.deleteMediaFiles({boxId:e,list:n.map(e=>e.id)})))}),function(e){return z.apply(this,arguments)})),e.tool("calculate_grid_layout","Calculate grid layout and pixel conversions for different device resolutions",{device_width:T.ai().describe("Device width in pixels"),device_height:T.ai().describe("Device height in pixels"),app_grid_width:T.ai().describe("Application grid width").optional().default(96),app_grid_height:T.ai().describe("Application grid height").optional().default(54)},nr,(J=b(function*({device_width:e,device_height:i,app_grid_width:t,app_grid_height:n}){var a=(0,M.k)(t,e,i),o=(0,M.Y)(e,i,t);return Z({device_resolution:{width:e,height:i,aspect_ratio:(e/i).toFixed(2)},current_grid:{width:t,height:n,unit_size_px:a.deviceBrickUnit.toFixed(2),total_pixels:{width:a.deviceBrickWidth.toFixed(2),height:a.deviceBrickHeight.toFixed(2)}},recommended_grid:{width:o.deviceBrickWidth,height:o.deviceBrickHeight,unit_size_px:o.deviceBrickUnit.toFixed(2),note:"Optimized for device aspect ratio"}})}),function(e){return J.apply(this,arguments)})),e.tool("create_item","Use this tool to create new item that you can put in application configuration",{type:T.k5(["subspace","canvas","brick","generator","property_bank","property_bank_calc","property_bank_command","animation","state_group","automation_map"]).describe("Item type"),title:T.Yj().describe("Item title"),template_key:T.Yj().optional().describe("Template key for brick or generator")},nr,no),e.tool("getting_started","Get documentation content for getting started",{},nr,b(function*(){return Z(Q)})),!a){var _,g,f,I,k,A,D,w,S,C,x,R,P,F,N,q,j,W,V,Y,K,G,L,z,J,X,ei,et,en=()=>new ne(t,i.auth||i.token);r({name:"activity_log_events",annotations:nr,description:"Query activity log events. Returns raw events (general, data, local_sync) with filtering. Max 30-day range.",inputSchema:s({start_time:T.Yj().describe("Start time (ISO 8601)"),end_time:T.Yj().describe("End time (ISO 8601)"),device_id:T.Yj().optional().describe("Filter by device ID"),event_type:T.k5(["general","data","local_sync"]).optional().describe("Filter by event type"),event_name:T.Yj().optional().describe("Filter by event name (e.g. BRICK_xxx_ON_PRESS)"),subspace_id:T.Yj().optional().describe("Filter by subspace ID"),sender:T.Yj().optional().describe("Filter by sender"),limit:T.ai().optional().default(50).describe("Max events to return per page"),offset:T.ai().optional().default(0).describe("Number of events to skip (for pagination)")}),permission:"query_activity_log"},(X=b(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=en(),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),Z((yield c.events(l,{limit:s,offset:d})))}),function(e){return X.apply(this,arguments)})),r({name:"activity_log_screenshots",annotations:nr,description:"List available screenshot timestamps for a device in a time range.",inputSchema:s({device_id:T.Yj().describe("Device ID (required)"),start_time:T.Yj().describe("Start time (ISO 8601)"),end_time:T.Yj().describe("End time (ISO 8601)")}),permission:"query_activity_log"},(ei=b(function*({device_id:e,start_time:i,end_time:t}){var n=en();return Z((yield n.screenshots({device_id:e,start_time:i,end_time:t})))}),function(e){return ei.apply(this,arguments)})),r({name:"activity_log_screenshot",annotations:nr,description:"Download a device screenshot at a specific timestamp. Returns a base64-encoded JPEG image.",inputSchema:s({device_id:T.Yj().describe("Device ID"),ts:T.Yj().describe("Screenshot timestamp (ISO 8601 or epoch ms)")}),permission:"query_activity_log"},(et=b(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=en(),r=/^\d+$/.test(n)?n:new Date(n).getTime();return Z((yield o.downloadScreenshot(a,t,r)),{mimeType:"image/jpeg"})}),function(e){return et.apply(this,arguments)}))}r({name:"get_device_usage",annotations:nr,description:"Get device usage metrics (uptime, memory, disk) for a date range. Data from BRICKS main server.",inputSchema:s({device_id:T.Yj().describe("Device ID"),start_date:T.Yj().optional().describe("Start date/time in ISO 8601 format (default: start of today)"),end_date:T.Yj().optional().describe("End date/time in ISO 8601 format (default: now)")}),permission:"query_device"},(n=b(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 Z((yield d.deviceUsage({deviceId:e,startDate:i?new Date(i).toISOString():a,endDate:t?new Date(t).toISOString():n.toISOString()})))}),function(e){return n.apply(this,arguments)}))}(p,t,{activityLogBaseUrl:a});var m=new k.S;try{yield p.connect(m),console.error("BRICKS MCP Server running on STDIO"),console.error(`Server: ${nt} v${nl}`),console.error(`Token Type: ${t.tokenType}${s?" (oauth)":""}`),console.error(`Permissions: ${t.tokenInfo.permissions.join(", ")}`),console.error("Ready to accept requests...")}catch(e){throw console.error("Failed to start MCP server:",e),e}})).apply(this,arguments)}}};