@fugood/bricks-cli 2.26.0-beta.3 → 2.26.0-beta.30

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,2668 @@
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:()=>nl});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:()=>eS,instanceVersionFragment:()=>eh,mediaBoxFragment:()=>eC,mediaFileFragment:()=>eT,mediaWorkspaceFragment:()=>ew,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:()=>eH,checkBindDevicePasscode:()=>eW,deviceUsage:()=>eQ,devices:()=>eX,devicesByGroup:()=>eY,devicesByUniqueId:()=>eV,me:()=>eE,module:()=>eJ,moduleReleaseVersion:()=>eN,moduleReleaseVersions:()=>eF,modules:()=>eU,publicModules:()=>eM,publicModulesByIdList:()=>eO,workspace:()=>eG,workspacePricingPlans:()=>eK,workspaces:()=>eL});var _={};t.r(_),t.d(_,{addUserFavorite:()=>iB,assignGroupPermissions:()=>iw,bindApplication:()=>id,bindApplicationWithDeviceGroup:()=>ip,changeWorkspaceAdditionalLimitSpending:()=>iM,changeWorkspaceSubscriptionPlan:()=>iU,controlDevice:()=>e7,createApplication:()=>ir,createApplicationWithShareVersion:()=>is,createConfigChangeOperation:()=>ik,createDevice:()=>e6,createDeviceGroup:()=>ie,createDeviceGroupWithApp:()=>i_,createModule:()=>i$,createVirtualDevice:()=>e2,createWorkspace:()=>e0,createWorkspaceOTP:()=>iO,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:()=>iS,removeUserFavorite:()=>iE,removeWorkspace:()=>io,revokeWorkspaceOTP:()=>iR,shareAccessToken:()=>ix,shareApplication:()=>iu,toggleShortEditApplication:()=>ic,updateApplication:()=>iP,updateApplicationViewportPreset:()=>il,updateDevice:()=>e5,updateDeviceGroup:()=>ii,updateModule:()=>iv,updateOperation:()=>iD,updateVirtualDevice:()=>e3,updateWorkspace:()=>e1,updateWorkspaceTokens:()=>e4});var g={};t.r(g),t.d(g,{application:()=>iY,applicationByDevice:()=>iK,applications:()=>iV,device:()=>iz,deviceUsage:()=>iX,devices:()=>iH,devicesByApplication:()=>iJ,mediaBox:()=>i0,mediaBoxes:()=>iZ,mediaFile:()=>i4,mediaFiles:()=>i1,mediaWorkspace:()=>iQ,module:()=>iL,modules:()=>iG,workspace:()=>iW});var f={};t.r(f),t.d(f,{bindApplication:()=>i9,copyMediaFiles:()=>ta,createApplication:()=>i6,createModule:()=>i8,deleteMediaBoxFiles:()=>tr,deleteMediaFiles:()=>to,forkApplication:()=>i5,requestFileUpload:()=>te,setMediaFileAsBoxPreview:()=>tn,unbindApplication:()=>i3,updateApplication:()=>i2,updateMediaFile:()=>ti,updateMediaFiles:()=>tt,updateModule:()=>i7});var y={};t.r(y),t.d(y,{mediaBox:()=>tO,mediaBoxes:()=>tU,mediaFile:()=>tP,mediaFiles:()=>tR,mediaWorkspace:()=>tM,mediaWorkspaces:()=>tE});var $={};t.r($),t.d($,{assignGroupPermissions:()=>tz,copyMediaFiles:()=>tL,createMediaBox:()=>tq,createMediaWorkspace:()=>tF,deleteMediaFiles:()=>tG,moveMediaBox:()=>tj,requestFileUpload:()=>tV,setMediaFileAsBoxPreview:()=>tH,updateMediaBox:()=>tW,updateMediaFile:()=>tY,updateMediaFiles:()=>tK,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),{}),S=["HS256","RS256"],w=["https://auth0.bricks.tools/","https://mybigday.auth0.com/"],C=e=>w.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),M=t(79861),O=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 Y(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 K=t(49741),G=t(63981),L=(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]??L(t,i)])):e,H=L(K.t),z=Object.entries(K.systemActions).map(([e,{propertyNameType:i,property:t}])=>` - \`${e}\`: ${H[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(G.brickMapping).map(e=>`- \`${e}\``).join("\n"),X=Object.keys(G.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
+ short_edit
352
+ env
353
+ }
354
+ secrets {
355
+ _id
356
+ property_id
357
+ name
358
+ description
359
+ date
360
+ }
361
+ viewport_presets {
362
+ _id
363
+ name
364
+ viewports {
365
+ detail
366
+ device_target_name
367
+ run_test
368
+ cron_tests {
369
+ test_id
370
+ update_screenshot
371
+ }
372
+ }
373
+ run_test
374
+ cron_tests {
375
+ test_id
376
+ update_screenshot
377
+ }
378
+ sync_key
379
+ separate_local_sync
380
+ }
381
+ used_workspace {
382
+ _id
383
+ name
384
+ billing {
385
+ plan {
386
+ type
387
+ period
388
+ }
389
+ lock {
390
+ features
391
+ }
392
+ }
393
+ }
394
+ dev_ref {
395
+ is_dev
396
+ parent_application
397
+ }
398
+ name
399
+ description
400
+ config
401
+ short_edit {
402
+ enabled
403
+ use_unstable_features
404
+ }
405
+ canvas_control {
406
+ enabled
407
+ use_unstable_features
408
+ }
409
+ device_control {
410
+ enabled
411
+ use_unstable_features
412
+ }
413
+ has_unreleased_changes
414
+ create_datetime
415
+ last_modify_datetime
416
+ last_modify_records {
417
+ type
418
+ query_name
419
+ instance_id
420
+ token_name
421
+ meta
422
+ updated_at
423
+ }
424
+ current_version
425
+ share {
426
+ description
427
+ tags
428
+ type
429
+ usage
430
+ create_records {
431
+ total_count
432
+ # records
433
+ }
434
+ favorite {
435
+ enabled
436
+ total_count
437
+ }
438
+ preview {
439
+ enabled
440
+ }
441
+ selected_releases {
442
+ _id
443
+ version
444
+ name
445
+ note
446
+ date
447
+ used_modules
448
+ used_media_flow_generators
449
+ used_global_remote_property_bank
450
+ used_secrets
451
+ }
452
+ screenshot {
453
+ type
454
+ screenshot_payload
455
+ last_screenshot_id
456
+ }
457
+ create_settings {
458
+ module_auto_destructure
459
+ }
460
+ }
461
+ screenshot {
462
+ type
463
+ screenshot_payload
464
+ last_screenshot_id
465
+ }
466
+ ai_filters {
467
+ name
468
+ description
469
+ instruction
470
+ variable_keys
471
+ model_provider
472
+ scope
473
+ }
474
+ }
475
+ `,ey=(0,el.default)`
476
+ fragment publicApplicationBasicInfoArguments on PublicApplicationBasicInfo {
477
+ _id
478
+ owner {
479
+ _id
480
+ id_from_user
481
+ }
482
+ name
483
+ description
484
+ share {
485
+ description
486
+ tags
487
+ type
488
+ usage
489
+ preview {
490
+ enabled
491
+ }
492
+ create_records {
493
+ total_count
494
+ # records
495
+ }
496
+ favorite {
497
+ enabled
498
+ total_count
499
+ }
500
+ selected_releases {
501
+ _id
502
+ version
503
+ name
504
+ note
505
+ date
506
+ used_modules
507
+ used_media_flow_generators
508
+ used_global_remote_property_bank
509
+ used_secrets
510
+ }
511
+ screenshot {
512
+ last_screenshot_id
513
+ }
514
+ create_settings {
515
+ module_auto_destructure
516
+ }
517
+ }
518
+ }
519
+ `,e$=(0,el.default)`
520
+ fragment moduleArguments on Module {
521
+ __typename
522
+ _id
523
+ create_datetime
524
+ last_modify_datetime
525
+ last_modify_records {
526
+ type
527
+ query_name
528
+ instance_id
529
+ token_name
530
+ meta
531
+ updated_at
532
+ }
533
+ owner {
534
+ _id
535
+ id_from_user
536
+ }
537
+ name
538
+ description
539
+ tags
540
+ config
541
+ current_version
542
+ expose_properties
543
+ is_allow_modify
544
+ is_public
545
+ used_workspace {
546
+ _id
547
+ billing {
548
+ plan {
549
+ type
550
+ period
551
+ }
552
+ lock {
553
+ features
554
+ }
555
+ }
556
+ }
557
+ screenshot {
558
+ type
559
+ screenshot_payload
560
+ last_screenshot_id
561
+ }
562
+ }
563
+ `,ev=(0,el.default)`
564
+ fragment moduleShortArguments on Module {
565
+ __typename
566
+ _id
567
+ create_datetime
568
+ last_modify_datetime
569
+ owner {
570
+ _id
571
+ id_from_user
572
+ }
573
+ name
574
+ description
575
+ tags
576
+ current_version
577
+ expose_properties
578
+ is_allow_modify
579
+ is_public
580
+ used_workspace {
581
+ _id
582
+ }
583
+ screenshot {
584
+ last_screenshot_id
585
+ }
586
+ }
587
+ `,eh=(0,el.default)`
588
+ fragment instanceVersionArguments on ConfigVersion {
589
+ __typename
590
+ _id
591
+ create_datetime
592
+ last_modify_datetime
593
+ version
594
+ note
595
+ instance_id
596
+ entry
597
+ }
598
+ `,eb=(0,el.default)`
599
+ fragment operationArguments on Operation {
600
+ __typename
601
+ _id
602
+ creator
603
+ application
604
+ create_datetime
605
+ last_modify_datetime
606
+ passcode
607
+ type
608
+ expired_datetime
609
+ payload
610
+ }
611
+ `,eI=(0,el.default)`
612
+ fragment userFavoriteArguments on UserFavorite {
613
+ _id
614
+ instance_type
615
+ instance {
616
+ _id
617
+ name
618
+ description
619
+ }
620
+ last_modify_datetime
621
+ }
622
+ `;var ek=(0,el.default)`
623
+ fragment mcpWorkspaceArguments on Workspace {
624
+ __typename
625
+ _id
626
+ owner {
627
+ _id
628
+ id_from_user
629
+ }
630
+ name
631
+ description
632
+ bank {
633
+ enable_remote_update
634
+ spacename
635
+ keys
636
+ }
637
+ media_resource {
638
+ enable_media_workspace
639
+ workspace_id
640
+ system_media_box_id
641
+ system_media_box_passcode
642
+ editor_upload_binding {
643
+ box_id
644
+ box_passcode
645
+ }
646
+ }
647
+ emails {
648
+ address
649
+ verified
650
+ date
651
+ }
652
+ notification_messages {
653
+ _id
654
+ type
655
+ custom_message
656
+ id
657
+ name
658
+ date
659
+ read
660
+ }
661
+ billing {
662
+ plan {
663
+ type
664
+ period
665
+ }
666
+ lock {
667
+ features
668
+ additional_resources
669
+ }
670
+ subscription {
671
+ status
672
+ last_active_at
673
+ billing_cycle_anchor
674
+ current_period_end
675
+ }
676
+ subscription_schedule {
677
+ status
678
+ next_plan_type
679
+ next_plan_period
680
+ next_plan_start_date
681
+ }
682
+ additional_subscription {
683
+ status
684
+ last_active_at
685
+ billing_cycle_anchor
686
+ current_period_end
687
+ }
688
+ additional_limit_spending {
689
+ devices
690
+ media
691
+ group
692
+ }
693
+ }
694
+ create_datetime
695
+ last_modify_datetime
696
+ last_modify_records {
697
+ type
698
+ query_name
699
+ instance_id
700
+ token_name
701
+ meta
702
+ updated_at
703
+ }
704
+ }
705
+ `,eA=(0,el.default)`
706
+ fragment mcpWorkspaceShortArguments on Workspace {
707
+ _id
708
+ name
709
+ description
710
+ }
711
+ `,eD=(0,el.default)`
712
+ fragment mcpApplicationShortArguments on Application {
713
+ _id
714
+ name
715
+ description
716
+ }
717
+ `,eS=(0,el.default)`
718
+ fragment mcpDeviceShortArguments on Device {
719
+ _id
720
+ name
721
+ description
722
+ }
723
+ `,ew=(0,el.default)`
724
+ fragment workspaceMediaWorkspaceArguments on MediaWorkspace {
725
+ id
726
+ name
727
+ description
728
+ owner
729
+ serviceBinding
730
+ createdAt
731
+ updatedAt
732
+ size
733
+ sizeLimit
734
+ }
735
+ `,eC=(0,el.default)`
736
+ fragment workspaceMediaBoxArguments on MediaBox {
737
+ id
738
+ name
739
+ description
740
+ tags
741
+ owner
742
+ workspaceId
743
+ serviceBinding
744
+ serviceBindingType
745
+ passcodes {
746
+ id
747
+ name
748
+ code
749
+ enableExpired
750
+ expiredAt
751
+ permissions
752
+ }
753
+ createdAt
754
+ updatedAt
755
+ size
756
+ }
757
+ `,eT=(0,el.default)`
758
+ fragment workspaceMediaFileArguments on MediaFile {
759
+ id
760
+ name
761
+ description
762
+ owner
763
+ boxId
764
+ fileType
765
+ contentType
766
+ fileSize
767
+ originalKey
768
+ userTags
769
+ versions {
770
+ key
771
+ width
772
+ height
773
+ strategy
774
+ version
775
+ etag
776
+ content_type
777
+ size
778
+ left
779
+ top
780
+ rotate
781
+ metadata
782
+ copypreview
783
+ }
784
+ previewId
785
+ isPreview
786
+ createdAt
787
+ updatedAt
788
+ meta {
789
+ parentFileId
790
+ storageEndpoint
791
+ originalFileUploaded
792
+ originalFileKey
793
+ originalFileSize
794
+ originalFileEtag
795
+ originalFileContentType
796
+ originalWidth
797
+ originalHeight
798
+ convertedFileUploaded
799
+ convertedFileKey
800
+ convertedFileSize
801
+ convertedFileEtag
802
+ convertedFileContentType
803
+ convertedFileHlsSegmentCount
804
+ videoThumbOriginalFileEtag
805
+ videoThumbOriginalFileContentType
806
+ videoThumbOriginalWidth
807
+ videoThumbOriginalHeight
808
+ videoThumbOriginalFileUploaded
809
+ videoThumbOriginalFileKey
810
+ videoThumbOriginalFileSize
811
+ uploadInfo
812
+ imageVersionRequests {
813
+ strategy
814
+ left
815
+ top
816
+ width
817
+ height
818
+ rotate
819
+ metadata
820
+ copypreview
821
+ }
822
+ allowedBiggerImageVersion
823
+ imageVersionType
824
+ videoTransformedByClient
825
+ videoTransformType
826
+ videoTransformed
827
+ customVideoWidth
828
+ customVideoHeight
829
+
830
+ updateUploadAllowSizeRange
831
+ enableAiAnalysis
832
+ aiCustomInstruction
833
+ aiDescription
834
+ aiTags
835
+ aiAnalysisStatus
836
+ aiAnalyzedAt
837
+ systemTags
838
+ }
839
+ }
840
+ `,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)`
841
+ query ControllerClient_me {
842
+ me {
843
+ _id
844
+ id_from_user
845
+ }
846
+ }
847
+ `;(0,el.default)`
848
+ query ControllerClient_module($id: ID!) {
849
+ module(id: $id) {
850
+ ...moduleArguments
851
+ }
852
+ }
853
+ ${e$}
854
+ `;let eU=(0,el.default)`
855
+ query ControllerClient_modules($workspaceId: ID, $limit: Int) {
856
+ modules(workspaceId: $workspaceId, paginate: { limit: $limit }) {
857
+ ...moduleShortArguments
858
+ }
859
+ }
860
+ ${ev}
861
+ `,eM=(0,el.default)`
862
+ query ControllerClient_publicModules($keyword: String!, $limit: Int) {
863
+ publicModules(keyword: $keyword, paginate: { limit: $limit }) {
864
+ ...moduleShortArguments
865
+ }
866
+ }
867
+ ${ev}
868
+ `,eO=(0,el.default)`
869
+ query ControllerClient_publicModulesByIdList($idList: [ID]) {
870
+ publicModulesByIdList(idList: $idList) {
871
+ ...moduleShortArguments
872
+ }
873
+ }
874
+ ${ev}
875
+ `,eR=(0,el.default)`
876
+ query ControllerClient_applicationReleaseVersions($id: ID!) {
877
+ applicationReleaseVersions(id: $id) {
878
+ ...instanceVersionArguments
879
+ }
880
+ }
881
+ ${eh}
882
+ `,eP=(0,el.default)`
883
+ query ControllerClient_applicationReleaseVersion($id: ID!, $versionId: ID!) {
884
+ applicationReleaseVersion(id: $id, versionId: $versionId) {
885
+ ...applicationReleaseVersionArguments
886
+ }
887
+ }
888
+ ${eh}
889
+ `,eF=(0,el.default)`
890
+ query ControllerClient_moduleReleaseVersions($id: ID!) {
891
+ moduleReleaseVersions(id: $id) {
892
+ ...instanceVersionArguments
893
+ }
894
+ }
895
+ ${eh}
896
+ `,eN=(0,el.default)`
897
+ query ControllerClient_moduleReleaseVersion($id: ID!, $versionId: ID!) {
898
+ moduleReleaseVersion(id: $id, versionId: $versionId) {
899
+ ...instanceVersionArguments
900
+ }
901
+ }
902
+ ${eh}
903
+ `,eq=(0,el.default)`
904
+ query ControllerClient_applicationByDevice(
905
+ $deviceId: ID!
906
+ $debug: Boolean
907
+ $composeModule: Boolean
908
+ $bankRemoteConfig: Boolean
909
+ ) {
910
+ applicationByDevice(
911
+ deviceId: $deviceId
912
+ debug: $debug
913
+ composeModule: $composeModule
914
+ bankRemoteConfig: $bankRemoteConfig
915
+ ) {
916
+ ...applicationArguments
917
+ config_tests
918
+ }
919
+ }
920
+ ${ef}
921
+ `,ej=(0,el.default)`
922
+ query ControllerClient_applicationTestsByDevice($deviceId: ID!) {
923
+ applicationTestsByDevice: applicationByDevice(
924
+ deviceId: $deviceId
925
+ debug: true
926
+ composeModule: false
927
+ bankRemoteConfig: false
928
+ ) {
929
+ _id
930
+ name
931
+ config_tests
932
+ }
933
+ }
934
+ `,eW=(0,el.default)`
935
+ query ControllerClient_checkBindDevicePasscode($passcode: String!) {
936
+ checkBindDevicePasscode(passcode: $passcode)
937
+ }
938
+ `,eV=(0,el.default)`
939
+ query ControllerClient_devicesByUniqueId($uniqueID: String!, $unbindApplication: Boolean) {
940
+ devicesByUniqueId(uniqueID: $uniqueID, unbindApplication: $unbindApplication) {
941
+ ...deviceArguments
942
+ }
943
+ }
944
+ ${em}
945
+ `,eY=(0,el.default)`
946
+ query ControllerClient_devicesByGroup($id: ID!) {
947
+ devicesByGroup(id: $id) {
948
+ device {
949
+ __typename
950
+ _id
951
+ used_workspace {
952
+ _id
953
+ billing {
954
+ plan {
955
+ type
956
+ }
957
+ lock {
958
+ features
959
+ additional_resources
960
+ }
961
+ }
962
+ }
963
+ create_datetime
964
+ last_modify_datetime
965
+ name
966
+ device_name
967
+ description
968
+ tags
969
+ entry_detail {
970
+ unique_id
971
+ operation_version
972
+ type
973
+ operation_mode
974
+ watch_dog_timer {
975
+ alive
976
+ last_launch_time
977
+ last_alive_time
978
+ threshold
979
+ }
980
+ }
981
+ owner {
982
+ _id
983
+ id_from_user
984
+ }
985
+ bound_application {
986
+ _id
987
+ name
988
+ }
989
+ auth {
990
+ type
991
+ }
992
+ }
993
+ target_name
994
+ }
995
+ }
996
+ `,eK=(0,el.default)`
997
+ query ControllerClient_workspacePricingPlans {
998
+ workspacePricingPlans
999
+ }
1000
+ `;var eG=(0,el.default)`
1001
+ query User_workspace($id: ID!) {
1002
+ workspace(id: $id) {
1003
+ ...mcpWorkspaceArguments
1004
+ }
1005
+ }
1006
+ ${ek}
1007
+ `,eL=(0,el.default)`
1008
+ query User_workspaces($paginate: Paginate) {
1009
+ workspaces(paginate: $paginate) {
1010
+ ...mcpWorkspaceShortArguments
1011
+ }
1012
+ }
1013
+ ${eA}
1014
+ `,eH=(0,el.default)`
1015
+ query User_applications {
1016
+ applications {
1017
+ ...mcpApplicationShortArguments
1018
+ }
1019
+ }
1020
+ ${eD}
1021
+ `,ez=(0,el.default)`
1022
+ query User_application($id: ID!) {
1023
+ application(id: $id) {
1024
+ ...applicationArguments
1025
+ bricks_project_last_commit_id
1026
+ }
1027
+ }
1028
+ ${ef}
1029
+ `,eJ=(0,el.default)`
1030
+ query User_module($id: ID!) {
1031
+ module(id: $id) {
1032
+ ...moduleArguments
1033
+ bricks_project_last_commit_id
1034
+ }
1035
+ }
1036
+ ${e$}
1037
+ `,eX=(0,el.default)`
1038
+ query User_devices {
1039
+ devices {
1040
+ ...mcpDeviceShortArguments
1041
+ }
1042
+ }
1043
+ ${eS}
1044
+ `,eQ=(0,el.default)`
1045
+ query User_deviceUsage($deviceId: ID, $startDate: Date, $endDate: Date) {
1046
+ deviceUsage(deviceId: $deviceId, startDate: $startDate, endDate: $endDate) {
1047
+ _id
1048
+ device_id
1049
+ date
1050
+ uptime {
1051
+ timestamp
1052
+ }
1053
+ memory_usage {
1054
+ values
1055
+ timestamp
1056
+ }
1057
+ disk_usage {
1058
+ values
1059
+ timestamp
1060
+ }
1061
+ }
1062
+ }
1063
+ `;let eZ=e=>(e.needResetStore=!0,e),e0=eZ((0,el.default)`
1064
+ mutation ControllerClient_createWorkspace($name: String, $description: String) {
1065
+ createWorkspace(name: $name, description: $description) {
1066
+ ...workspaceArguments
1067
+ }
1068
+ }
1069
+ ${ep}
1070
+ `),e1=eZ((0,el.default)`
1071
+ mutation ControllerClient_updateWorkspace(
1072
+ $id: ID!
1073
+ $name: String
1074
+ $description: String
1075
+ $addVerifyEmail: String
1076
+ $removeVerifyEmail: String
1077
+ $enableBankRemoteUpdate: Boolean
1078
+ $newBankKey: BankKeyInput
1079
+ $revokeBankKey: String
1080
+ $enableMediaWorkspace: Boolean
1081
+ $refreshBindingBoxKey: String
1082
+ ) {
1083
+ updateWorkspace(
1084
+ id: $id
1085
+ name: $name
1086
+ description: $description
1087
+ addVerifyEmail: $addVerifyEmail
1088
+ removeVerifyEmail: $removeVerifyEmail
1089
+ enableBankRemoteUpdate: $enableBankRemoteUpdate
1090
+ newBankKey: $newBankKey
1091
+ revokeBankKey: $revokeBankKey
1092
+ enableMediaWorkspace: $enableMediaWorkspace
1093
+ refreshBindingBoxKey: $refreshBindingBoxKey
1094
+ ) {
1095
+ ...workspaceArguments
1096
+ }
1097
+ }
1098
+ ${ep}
1099
+ `),e4=eZ((0,el.default)`
1100
+ mutation ControllerClient_updateWorkspaceTokens(
1101
+ $id: ID!
1102
+ $tokens: [WorkspaceTokenInput]
1103
+ $revokeTokens: [ID!]
1104
+ ) {
1105
+ updateWorkspaceTokens(id: $id, tokens: $tokens, revokeTokens: $revokeTokens) {
1106
+ workspace {
1107
+ ...workspaceArguments
1108
+ }
1109
+ newTokens {
1110
+ name
1111
+ token
1112
+ }
1113
+ }
1114
+ }
1115
+ ${ep}
1116
+ `),e6=eZ((0,el.default)`
1117
+ mutation ControllerClient_createDevice(
1118
+ $workspaceId: ID
1119
+ $name: String
1120
+ $deviceName: String
1121
+ $entry: JSON!
1122
+ $forceMoveExistingDeviceIfAllowed: Boolean
1123
+ $bindPasscode: String
1124
+ $bindRefreshTokenLegacy: String
1125
+ ) {
1126
+ createDevice(
1127
+ workspaceId: $workspaceId
1128
+ name: $name
1129
+ deviceName: $deviceName
1130
+ entry: $entry
1131
+ forceMoveExistingDeviceIfAllowed: $forceMoveExistingDeviceIfAllowed
1132
+ bindPasscode: $bindPasscode
1133
+ bindRefreshTokenLegacy: $bindRefreshTokenLegacy
1134
+ ) {
1135
+ ...deviceArguments
1136
+ }
1137
+ }
1138
+ ${em}
1139
+ `),e2=eZ((0,el.default)`
1140
+ mutation ControllerClient_createVirtualDevice(
1141
+ $workspaceId: ID
1142
+ $name: String
1143
+ $deviceName: String
1144
+ $entry: JSON!
1145
+ ) {
1146
+ createVirtualDevice(
1147
+ workspaceId: $workspaceId
1148
+ name: $name
1149
+ deviceName: $deviceName
1150
+ entry: $entry
1151
+ ) {
1152
+ ...deviceArguments
1153
+ }
1154
+ }
1155
+ ${em}
1156
+ `),e5=eZ((0,el.default)`
1157
+ mutation ControllerClient_updateDevice(
1158
+ $id: ID!
1159
+ $name: String
1160
+ $deviceName: String
1161
+ $description: String
1162
+ $tags: [String]
1163
+ $alert: DeviceAlertInput
1164
+ $activityLog: ActivityLogInput
1165
+ $localSync: LocalSyncInput
1166
+ $preload: PreloadInput
1167
+ $applicationUpdate: ApplicationUpdateInput
1168
+ $lock: DeviceLockInput
1169
+ $advancedSetting: AdvancedSettingInput
1170
+ $enableWebLanDiscovery: Boolean
1171
+ $env: DeviceEnvInput
1172
+ $accessControl: DeviceAccessControlInput
1173
+ $forceNotifyDevice: Boolean
1174
+ ) {
1175
+ updateDevice(
1176
+ id: $id
1177
+ name: $name
1178
+ deviceName: $deviceName
1179
+ description: $description
1180
+ tags: $tags
1181
+ alert: $alert
1182
+ activityLog: $activityLog
1183
+ localSync: $localSync
1184
+ preload: $preload
1185
+ applicationUpdate: $applicationUpdate
1186
+ lock: $lock
1187
+ advancedSetting: $advancedSetting
1188
+ enableWebLanDiscovery: $enableWebLanDiscovery
1189
+ env: $env
1190
+ accessControl: $accessControl
1191
+ forceNotifyDevice: $forceNotifyDevice
1192
+ ) {
1193
+ ...deviceArguments
1194
+ ...deviceDetailArguments
1195
+ }
1196
+ }
1197
+ ${em}
1198
+ ${e_}
1199
+ `),e9=eZ((0,el.default)`
1200
+ mutation ControllerClient_moveDevice(
1201
+ $id: ID!
1202
+ $workspaceId: ID!
1203
+ $forceNotifyDevice: Boolean
1204
+ $forceUnbindApplicationIfNeeded: Boolean
1205
+ $forceRemoveInDeviceGroupsIfNeeded: Boolean
1206
+ ) {
1207
+ moveDevice(
1208
+ id: $id
1209
+ workspaceId: $workspaceId
1210
+ forceNotifyDevice: $forceNotifyDevice
1211
+ forceUnbindApplicationIfNeeded: $forceUnbindApplicationIfNeeded
1212
+ forceRemoveInDeviceGroupsIfNeeded: $forceRemoveInDeviceGroupsIfNeeded
1213
+ ) {
1214
+ ...deviceArguments
1215
+ }
1216
+ }
1217
+ ${em}
1218
+ `),e3=eZ((0,el.default)`
1219
+ mutation ControllerClient_updateVirtualDevice(
1220
+ $id: ID!
1221
+ $tokens: [DeviceTokenInput]
1222
+ $revokeTokens: [ID!]
1223
+ ) {
1224
+ updateVirtualDevice(id: $id, tokens: $tokens, revokeTokens: $revokeTokens) {
1225
+ device {
1226
+ ...deviceArguments
1227
+ ...deviceDetailArguments
1228
+ }
1229
+ newTokens {
1230
+ name
1231
+ token
1232
+ }
1233
+ }
1234
+ }
1235
+ ${em}
1236
+ ${e_}
1237
+ `),e8=eZ((0,el.default)`
1238
+ mutation ControllerClient_removeDevice($id: ID!) {
1239
+ removeDevice(id: $id)
1240
+ }
1241
+ `),e7=eZ((0,el.default)`
1242
+ mutation ControllerClient_controlDevice($id: ID!, $type: String!, $eventPayload: JSON) {
1243
+ controlDevice(id: $id, type: $type, eventPayload: $eventPayload) {
1244
+ ...deviceArguments
1245
+ }
1246
+ }
1247
+ ${em}
1248
+ `),ie=eZ((0,el.default)`
1249
+ mutation ControllerClient_createDeviceGroup(
1250
+ $workspaceId: ID!
1251
+ $name: String!
1252
+ $description: String
1253
+ ) {
1254
+ createDeviceGroup(workspaceId: $workspaceId, name: $name, description: $description) {
1255
+ ...deviceGroupArguments
1256
+ }
1257
+ }
1258
+ ${eg}
1259
+ `),ii=eZ((0,el.default)`
1260
+ mutation ControllerClient_updateDeviceGroup(
1261
+ $id: ID!
1262
+ $name: String
1263
+ $description: String
1264
+ $tags: [String]
1265
+ $upsertDevices: [DeviceInGroupInput]
1266
+ $removeDevices: [ID!]
1267
+ $deployDeviceSetting: DeviceSettingInGroup
1268
+ $deployDeviceAdvancedSetting: DeviceAdvancedSettingInGroup
1269
+ ) {
1270
+ updateDeviceGroup(
1271
+ id: $id
1272
+ name: $name
1273
+ description: $description
1274
+ tags: $tags
1275
+ upsertDevices: $upsertDevices
1276
+ removeDevices: $removeDevices
1277
+ deployDeviceSetting: $deployDeviceSetting
1278
+ deployDeviceAdvancedSetting: $deployDeviceAdvancedSetting
1279
+ ) {
1280
+ ...deviceGroupArguments
1281
+ }
1282
+ }
1283
+ ${eg}
1284
+ `),it=eZ((0,el.default)`
1285
+ mutation ControllerClient_dispatchDeviceGroupAction($id: ID!, $action: String!) {
1286
+ dispatchDeviceGroupAction(id: $id, action: $action) {
1287
+ devices
1288
+ dispatched
1289
+ }
1290
+ }
1291
+ `),ia=eZ((0,el.default)`
1292
+ mutation ControllerClient_removeDeviceGroup($id: ID!) {
1293
+ removeDeviceGroup(id: $id)
1294
+ }
1295
+ `),io=eZ((0,el.default)`
1296
+ mutation ControllerClient_removeWorkspace($id: ID!) {
1297
+ removeWorkspace(id: $id)
1298
+ }
1299
+ `),ir=eZ((0,el.default)`
1300
+ mutation ControllerClient_createApplication(
1301
+ $workspaceId: ID
1302
+ $name: String
1303
+ $description: String
1304
+ $layoutWidth: Int
1305
+ $layoutHeight: Int
1306
+ $createExampleKey: String
1307
+ ) {
1308
+ createApplication(
1309
+ workspaceId: $workspaceId
1310
+ name: $name
1311
+ description: $description
1312
+ layoutWidth: $layoutWidth
1313
+ layoutHeight: $layoutHeight
1314
+ createExampleKey: $createExampleKey
1315
+ ) {
1316
+ ...applicationArguments
1317
+ }
1318
+ }
1319
+ ${ef}
1320
+ `),is=eZ((0,el.default)`
1321
+ mutation ControllerClient_createApplicationWithShareVersion(
1322
+ $workspaceId: ID
1323
+ $name: String
1324
+ $description: String
1325
+ $shareVersionId: ID
1326
+ ) {
1327
+ createApplicationWithShareVersion(
1328
+ workspaceId: $workspaceId
1329
+ name: $name
1330
+ description: $description
1331
+ shareVersionId: $shareVersionId
1332
+ ) {
1333
+ ...applicationArguments
1334
+ }
1335
+ }
1336
+ ${ef}
1337
+ `);eZ((0,el.default)`
1338
+ mutation ControllerClient_updateApplication(
1339
+ $id: ID!
1340
+ $name: String
1341
+ $description: String
1342
+ $tags: [String]
1343
+ $config: String
1344
+ $validateConfig: Boolean
1345
+ $runtimeEdit: RuntimeEditInput
1346
+ $canvasControlEdit: CanvasControlEditInput
1347
+ $deviceControlEdit: DeviceControlEditInput
1348
+ $releaseCurrentVersion: String
1349
+ $releaseCurrentVersionNote: String
1350
+ $useReleaseVersion: ID
1351
+ $parentUseThisVersion: Boolean
1352
+ $syncParent: Boolean
1353
+ $newSecrets: [ApplicationSecretInput]
1354
+ $updateSecrets: [ApplicationSecretUpdateInput]
1355
+ $removeSecrets: [ID!]
1356
+ $lock: ApplicationLockInput
1357
+ $aiFilters: [ApplicationAiFilterInput]
1358
+ ) {
1359
+ updateApplication(
1360
+ id: $id
1361
+ name: $name
1362
+ description: $description
1363
+ tags: $tags
1364
+ config: $config
1365
+ validateConfig: $validateConfig
1366
+ runtimeEdit: $runtimeEdit
1367
+ canvasControlEdit: $canvasControlEdit
1368
+ deviceControlEdit: $deviceControlEdit
1369
+ releaseCurrentVersion: $releaseCurrentVersion
1370
+ releaseCurrentVersionNote: $releaseCurrentVersionNote
1371
+ useReleaseVersion: $useReleaseVersion
1372
+ parentUseThisVersion: $parentUseThisVersion
1373
+ syncParent: $syncParent
1374
+ newSecrets: $newSecrets
1375
+ updateSecrets: $updateSecrets
1376
+ removeSecrets: $removeSecrets
1377
+ lock: $lock
1378
+ aiFilters: $aiFilters
1379
+ ) {
1380
+ ...applicationArguments
1381
+ }
1382
+ }
1383
+ ${ef}
1384
+ `);let id=eZ((0,el.default)`
1385
+ mutation ControllerClient_bindApplication(
1386
+ $id: ID!
1387
+ $devices: [ID]
1388
+ $bindDevices: [ID]
1389
+ $unbindDevices: [ID]
1390
+ $deviceFrames: JSON
1391
+ $deviceSettings: [DeviceSettingInput]
1392
+ $forceUnbindDevicesIfNeeded: Boolean
1393
+ ) {
1394
+ bindApplication(
1395
+ id: $id
1396
+ devices: $devices
1397
+ bindDevices: $bindDevices
1398
+ unbindDevices: $unbindDevices
1399
+ deviceFrames: $deviceFrames
1400
+ deviceSettings: $deviceSettings
1401
+ forceUnbindDevicesIfNeeded: $forceUnbindDevicesIfNeeded
1402
+ ) {
1403
+ ...applicationArguments
1404
+ }
1405
+ }
1406
+ ${ef}
1407
+ `),ic=eZ((0,el.default)`
1408
+ mutation ControllerClient_toggleShortEditApplication($id: ID!, $enabled: Boolean!) {
1409
+ toggleShortEditApplication(id: $id, enabled: $enabled)
1410
+ }
1411
+ `),il=eZ((0,el.default)`
1412
+ mutation ControllerClient_updateApplicationViewportPreset(
1413
+ $id: ID!
1414
+ $newViewportPresets: [ApplicationViewportPresetInput]
1415
+ $updateViewportPresets: [ApplicationViewportPresetUpdateInput]
1416
+ $removeViewportPresets: [ID!]
1417
+ ) {
1418
+ updateApplicationViewportPreset(
1419
+ id: $id
1420
+ newViewportPresets: $newViewportPresets
1421
+ updateViewportPresets: $updateViewportPresets
1422
+ removeViewportPresets: $removeViewportPresets
1423
+ ) {
1424
+ ...applicationArguments
1425
+ }
1426
+ }
1427
+ ${ef}
1428
+ `),ip=eZ((0,el.default)`
1429
+ mutation ControllerClient_bindApplicationWithDeviceGroup(
1430
+ $id: ID!
1431
+ $bindDeviceGroup: ApplicationBindDeviceGroupInput
1432
+ $unbindDeviceGroup: ApplicationUnbindDeviceGroupInput
1433
+ $forceUnbindDevicesIfNeeded: Boolean
1434
+ ) {
1435
+ bindApplicationWithDeviceGroup(
1436
+ id: $id
1437
+ bindDeviceGroup: $bindDeviceGroup
1438
+ unbindDeviceGroup: $unbindDeviceGroup
1439
+ forceUnbindDevicesIfNeeded: $forceUnbindDevicesIfNeeded
1440
+ ) {
1441
+ ...applicationArguments
1442
+ }
1443
+ }
1444
+ ${ef}
1445
+ `),iu=eZ((0,el.default)`
1446
+ mutation ControllerClient_shareApplication(
1447
+ $id: ID!
1448
+ $shareSetting: ApplicationShareSettingInput
1449
+ $favoriteSetting: ApplicationFavoriteSettingInput
1450
+ $previewSetting: ApplicationPreviewSettingInput
1451
+ $releaseVersion: ApplicationReleaseVersionInput
1452
+ $screenshotSetting: ApplicationScreenshotSettingInput
1453
+ ) {
1454
+ shareApplication(
1455
+ id: $id
1456
+ shareSetting: $shareSetting
1457
+ favoriteSetting: $favoriteSetting
1458
+ previewSetting: $previewSetting
1459
+ releaseVersion: $releaseVersion
1460
+ screenshotSetting: $screenshotSetting
1461
+ ) {
1462
+ ...applicationArguments
1463
+ }
1464
+ }
1465
+ ${ef}
1466
+ `),im=eZ((0,el.default)`
1467
+ mutation ControllerClient_moveApplication($id: ID!, $workspaceId: ID!) {
1468
+ moveApplication(id: $id, workspaceId: $workspaceId) {
1469
+ ...applicationArguments
1470
+ }
1471
+ }
1472
+ ${ef}
1473
+ `),i_=eZ((0,el.default)`
1474
+ mutation ControllerClient_createDeviceGroupWithApp(
1475
+ $applicationId: ID!
1476
+ $name: String!
1477
+ $description: String
1478
+ $targetDeviceFields: [TargetDeviceField]
1479
+ $presetName: String
1480
+ ) {
1481
+ createDeviceGroupWithApp(
1482
+ applicationId: $applicationId
1483
+ name: $name
1484
+ description: $description
1485
+ targetDeviceFields: $targetDeviceFields
1486
+ presetName: $presetName
1487
+ ) {
1488
+ deviceGroup {
1489
+ _id
1490
+ name
1491
+ description
1492
+ }
1493
+ application {
1494
+ ...applicationArguments
1495
+ }
1496
+ }
1497
+ }
1498
+ ${ef}
1499
+ `);eZ((0,el.default)`
1500
+ mutation ControllerClient_forkApplication($id: ID!) {
1501
+ forkApplication(id: $id) {
1502
+ ...applicationArguments
1503
+ }
1504
+ }
1505
+ ${ef}
1506
+ `);let ig=eZ((0,el.default)`
1507
+ mutation ControllerClient_duplicateApplication(
1508
+ $id: ID!
1509
+ $includeVersions: Boolean
1510
+ $includeSecrets: Boolean
1511
+ ) {
1512
+ duplicateApplication(
1513
+ id: $id
1514
+ includeVersions: $includeVersions
1515
+ includeSecrets: $includeSecrets
1516
+ ) {
1517
+ ...applicationArguments
1518
+ }
1519
+ }
1520
+ ${ef}
1521
+ `),iy=eZ((0,el.default)`
1522
+ mutation ControllerClient_removeApplication($id: ID!) {
1523
+ removeApplication(id: $id)
1524
+ }
1525
+ `),i$=eZ((0,el.default)`
1526
+ mutation ControllerClient_createModule(
1527
+ $workspaceId: ID
1528
+ $name: String
1529
+ $description: String
1530
+ $exposeProperties: [String]
1531
+ $isAllowModify: Boolean
1532
+ $isPublic: Boolean
1533
+ $layoutWidth: Int
1534
+ $layoutHeight: Int
1535
+ $config: String
1536
+ ) {
1537
+ createModule(
1538
+ workspaceId: $workspaceId
1539
+ name: $name
1540
+ description: $description
1541
+ exposeProperties: $exposeProperties
1542
+ isAllowModify: $isAllowModify
1543
+ isPublic: $isPublic
1544
+ layoutWidth: $layoutWidth
1545
+ layoutHeight: $layoutHeight
1546
+ config: $config
1547
+ ) {
1548
+ ...moduleArguments
1549
+ }
1550
+ }
1551
+ ${e$}
1552
+ `),iv=eZ((0,el.default)`
1553
+ mutation ControllerClient_updateModule(
1554
+ $id: ID!
1555
+ $name: String
1556
+ $description: String
1557
+ $tags: [String]
1558
+ $exposeProperties: [String]
1559
+ $isAllowModify: Boolean
1560
+ $isPublic: Boolean
1561
+ $config: String
1562
+ $validateConfig: Boolean
1563
+ $useReleaseVersion: ID
1564
+ $releaseCurrentVersion: String
1565
+ $releaseCurrentVersionNote: String
1566
+ ) {
1567
+ updateModule(
1568
+ id: $id
1569
+ name: $name
1570
+ description: $description
1571
+ tags: $tags
1572
+ exposeProperties: $exposeProperties
1573
+ isAllowModify: $isAllowModify
1574
+ isPublic: $isPublic
1575
+ config: $config
1576
+ validateConfig: $validateConfig
1577
+ useReleaseVersion: $useReleaseVersion
1578
+ releaseCurrentVersion: $releaseCurrentVersion
1579
+ releaseCurrentVersionNote: $releaseCurrentVersionNote
1580
+ ) {
1581
+ ...moduleArguments
1582
+ }
1583
+ }
1584
+ ${e$}
1585
+ `),ih=eZ((0,el.default)`
1586
+ mutation ControllerClient_moveModule($id: ID!, $workspaceId: ID!) {
1587
+ moveModule(id: $id, workspaceId: $workspaceId) {
1588
+ ...moduleArguments
1589
+ }
1590
+ }
1591
+ ${e$}
1592
+ `),ib=eZ((0,el.default)`
1593
+ mutation ControllerClient_duplicateModule($id: ID!) {
1594
+ duplicateModule(id: $id) {
1595
+ ...moduleArguments
1596
+ }
1597
+ }
1598
+ ${e$}
1599
+ `),iI=eZ((0,el.default)`
1600
+ mutation ControllerClient_removeModule($id: ID!) {
1601
+ removeModule(id: $id)
1602
+ }
1603
+ `),ik=eZ((0,el.default)`
1604
+ mutation ControllerClient_createConfigChangeOperation(
1605
+ $applicationId: ID!
1606
+ $config: JSON!
1607
+ $expires: Int
1608
+ ) {
1609
+ createConfigChangeOperation(applicationId: $applicationId, config: $config, expires: $expires) {
1610
+ ...operationArguments
1611
+ }
1612
+ }
1613
+ ${eb}
1614
+ `),iA=eZ((0,el.default)`
1615
+ mutation ControllerClient_doOperation($id: ID!, $applicationId: ID!) {
1616
+ doOperation(id: $id, applicationId: $applicationId)
1617
+ }
1618
+ `),iD=eZ((0,el.default)`
1619
+ mutation ControllerClient_updateOperation(
1620
+ $id: ID!
1621
+ $applicationId: ID!
1622
+ $config: JSON!
1623
+ $expires: Int
1624
+ ) {
1625
+ updateOperation(id: $id, applicationId: $applicationId, config: $config, expires: $expires) {
1626
+ ...operationArguments
1627
+ }
1628
+ }
1629
+ ${eb}
1630
+ `),iS=eZ((0,el.default)`
1631
+ mutation ControllerClient_removeOperation($id: ID!, $applicationId: ID!) {
1632
+ removeOperation(id: $id, applicationId: $applicationId)
1633
+ }
1634
+ `),iw=eZ((0,el.default)`
1635
+ mutation ControllerClient_assignGroupPermissions(
1636
+ $roleId: String!
1637
+ $instanceType: String!
1638
+ $instanceId: ID!
1639
+ $permissions: [String]!
1640
+ ) {
1641
+ assignGroupPermissions(
1642
+ roleId: $roleId
1643
+ instanceType: $instanceType
1644
+ instanceId: $instanceId
1645
+ permissions: $permissions
1646
+ )
1647
+ }
1648
+ `),iC=(0,el.default)`
1649
+ mutation ControllerClient_registerFCMNotification($workspaceId: ID!, $token: String!) {
1650
+ registerFCMNotification(workspaceId: $workspaceId, token: $token)
1651
+ }
1652
+ `,iT=(0,el.default)`
1653
+ mutation ControllerClient_registerRemoteDebug($deviceId: ID!) {
1654
+ registerRemoteDebug(deviceId: $deviceId) {
1655
+ deviceId
1656
+ token
1657
+ }
1658
+ }
1659
+ `,ix=(0,el.default)`
1660
+ mutation ControllerClient_shareAccessToken(
1661
+ $workspaceId: ID
1662
+ $passcode: String!
1663
+ $refreshToken: String!
1664
+ ) {
1665
+ shareAccessToken(workspaceId: $workspaceId, passcode: $passcode, refreshToken: $refreshToken)
1666
+ }
1667
+ `,iB=eZ((0,el.default)`
1668
+ mutation ControllerClient_addUserFavorite($instanceType: InstanceType!, $instanceId: ID!) {
1669
+ addUserFavorite(instanceType: $instanceType, instanceId: $instanceId) {
1670
+ _id
1671
+ instance_type
1672
+ instance {
1673
+ _id
1674
+ name
1675
+ description
1676
+ }
1677
+ last_modify_datetime
1678
+ }
1679
+ }
1680
+ `),iE=eZ((0,el.default)`
1681
+ mutation ControllerClient_removeUserFavorite($instanceType: InstanceType!, $instanceId: ID!) {
1682
+ removeUserFavorite(instanceType: $instanceType, instanceId: $instanceId)
1683
+ }
1684
+ `),iU=eZ((0,el.default)`
1685
+ mutation ControllerClient_changeWorkspaceSubscriptionPlan(
1686
+ $workspaceId: ID!
1687
+ $type: String!
1688
+ $period: String!
1689
+ ) {
1690
+ changeWorkspaceSubscriptionPlan(workspaceId: $workspaceId, type: $type, period: $period)
1691
+ }
1692
+ `),iM=eZ((0,el.default)`
1693
+ mutation ControllerClient_changeWorkspaceAdditionalLimitSpending(
1694
+ $workspaceId: ID!
1695
+ $boundDevicesLimit: Float
1696
+ $groupMembersLimit: Float
1697
+ ) {
1698
+ changeWorkspaceAdditionalLimitSpending(
1699
+ workspaceId: $workspaceId
1700
+ boundDevicesLimit: $boundDevicesLimit
1701
+ groupMembersLimit: $groupMembersLimit
1702
+ )
1703
+ }
1704
+ `),iO=(0,el.default)`
1705
+ mutation ControllerClient_createWorkspaceOTP(
1706
+ $workspaceId: ID!
1707
+ $tokenTypes: [WorkspaceTokenType]!
1708
+ $tokenName: String
1709
+ ) {
1710
+ createWorkspaceOTP(workspaceId: $workspaceId, tokenTypes: $tokenTypes, tokenName: $tokenName) {
1711
+ _id
1712
+ passcode
1713
+ expired_datetime
1714
+ }
1715
+ }
1716
+ `,iR=(0,el.default)`
1717
+ mutation ControllerClient_revokeWorkspaceOTP($id: ID!) {
1718
+ revokeWorkspaceOTP(id: $id)
1719
+ }
1720
+ `;var iP=(0,el.default)`
1721
+ mutation User_updateApplication(
1722
+ $id: ID!
1723
+ $name: String
1724
+ $description: String
1725
+ $config: String
1726
+ $validateConfig: Boolean
1727
+ $lastCommitId: String
1728
+ ) {
1729
+ updateApplication(
1730
+ id: $id
1731
+ name: $name
1732
+ description: $description
1733
+ config: $config
1734
+ validateConfig: $validateConfig
1735
+ lastCommitId: $lastCommitId
1736
+ ) {
1737
+ ...applicationArguments
1738
+ bricks_project_last_commit_id
1739
+ }
1740
+ }
1741
+ ${ef}
1742
+ `,iF=(0,el.default)`
1743
+ mutation User_forkApplication($id: ID!) {
1744
+ forkApplication(id: $id) {
1745
+ ...mcpApplicationShortArguments
1746
+ dev_ref {
1747
+ is_dev
1748
+ parent_application
1749
+ }
1750
+ bricks_project_last_commit_id
1751
+ }
1752
+ }
1753
+ ${eD}
1754
+ `;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)`
1755
+ query Workspace_workspace {
1756
+ workspace {
1757
+ ...mcpWorkspaceArguments
1758
+ }
1759
+ }
1760
+ ${ek}
1761
+ `,iV=(0,el.default)`
1762
+ query Workspace_applications($keyword: String, $paginate: Paginate) {
1763
+ applications(keyword: $keyword, paginate: $paginate) {
1764
+ ...mcpApplicationShortArguments
1765
+ }
1766
+ }
1767
+ ${eD}
1768
+ `,iY=(0,el.default)`
1769
+ query Workspace_application($id: ID!, $composed: Boolean, $debug: Boolean) {
1770
+ application(id: $id, composed: $composed, debug: $debug) {
1771
+ ...applicationArguments
1772
+ bricks_project_last_commit_id
1773
+ }
1774
+ }
1775
+ ${ef}
1776
+ `,iK=(0,el.default)`
1777
+ query Workspace_applicationByDevice(
1778
+ $deviceId: ID!
1779
+ $composeModule: Boolean
1780
+ $bankRemoteConfig: Boolean
1781
+ $debug: Boolean
1782
+ ) {
1783
+ applicationByDevice(
1784
+ deviceId: $deviceId
1785
+ composeModule: $composeModule
1786
+ bankRemoteConfig: $bankRemoteConfig
1787
+ debug: $debug
1788
+ ) {
1789
+ ...applicationArguments
1790
+ }
1791
+ }
1792
+ ${ef}
1793
+ `,iG=(0,el.default)`
1794
+ query Workspace_modules($keyword: String, $paginate: Paginate) {
1795
+ modules(keyword: $keyword, paginate: $paginate) {
1796
+ ...moduleShortArguments
1797
+ }
1798
+ }
1799
+ ${ev}
1800
+ `,iL=(0,el.default)`
1801
+ query Workspace_module($id: ID!) {
1802
+ module(id: $id) {
1803
+ ...moduleArguments
1804
+ bricks_project_last_commit_id
1805
+ }
1806
+ }
1807
+ ${e$}
1808
+ `,iH=(0,el.default)`
1809
+ query Workspace_devices($keyword: String, $paginate: Paginate) {
1810
+ devices(keyword: $keyword, paginate: $paginate) {
1811
+ ...deviceArguments
1812
+ }
1813
+ }
1814
+ ${em}
1815
+ `,iz=(0,el.default)`
1816
+ query Workspace_device($id: ID) {
1817
+ device(id: $id) {
1818
+ ...deviceArguments
1819
+ }
1820
+ }
1821
+ ${em}
1822
+ `,iJ=(0,el.default)`
1823
+ query Workspace_devicesByApplication($id: ID!) {
1824
+ devicesByApplication(id: $id) {
1825
+ ...deviceArguments
1826
+ }
1827
+ }
1828
+ ${em}
1829
+ `,iX=(0,el.default)`
1830
+ query Workspace_deviceUsage($deviceId: ID, $startDate: Date, $endDate: Date) {
1831
+ deviceUsage(deviceId: $deviceId, startDate: $startDate, endDate: $endDate) {
1832
+ _id
1833
+ device_id
1834
+ date
1835
+ uptime {
1836
+ timestamp
1837
+ }
1838
+ memory_usage {
1839
+ values
1840
+ timestamp
1841
+ }
1842
+ disk_usage {
1843
+ values
1844
+ timestamp
1845
+ }
1846
+ }
1847
+ }
1848
+ `,iQ=(0,el.default)`
1849
+ query Workspace_mediaWorkspace {
1850
+ mediaWorkspace {
1851
+ ...workspaceMediaWorkspaceArguments
1852
+ }
1853
+ }
1854
+ ${ew}
1855
+ `,iZ=(0,el.default)`
1856
+ query Workspace_mediaBoxes {
1857
+ mediaBoxes {
1858
+ ...workspaceMediaBoxArguments
1859
+ }
1860
+ }
1861
+ ${eC}
1862
+ `,i0=(0,el.default)`
1863
+ query Workspace_mediaBox($boxId: ID!) {
1864
+ mediaBox(id: $boxId) {
1865
+ ...workspaceMediaBoxArguments
1866
+ }
1867
+ }
1868
+ ${eC}
1869
+ `,i1=(0,el.default)`
1870
+ query Workspace_mediaFiles(
1871
+ $boxId: ID!
1872
+ $includeTypes: [String]
1873
+ $userTags: [String]
1874
+ $limit: Int
1875
+ $offset: Int
1876
+ ) {
1877
+ mediaFiles(
1878
+ boxId: $boxId
1879
+ includeTypes: $includeTypes
1880
+ userTags: $userTags
1881
+ limit: $limit
1882
+ offset: $offset
1883
+ ) {
1884
+ ...workspaceMediaFileArguments
1885
+ }
1886
+ }
1887
+ ${eT}
1888
+ `,i4=(0,el.default)`
1889
+ query Workspace_mediaFile($id: ID!) {
1890
+ mediaFile(id: $id) {
1891
+ ...workspaceMediaFileArguments
1892
+ }
1893
+ }
1894
+ ${eT}
1895
+ `,i6=(0,el.default)`
1896
+ mutation Workspace_createApplication(
1897
+ $name: String
1898
+ $description: String
1899
+ $layoutWidth: Int
1900
+ $layoutHeight: Int
1901
+ ) {
1902
+ createApplication(
1903
+ name: $name
1904
+ description: $description
1905
+ layoutWidth: $layoutWidth
1906
+ layoutHeight: $layoutHeight
1907
+ ) {
1908
+ ...mcpApplicationShortArguments
1909
+ config
1910
+ }
1911
+ }
1912
+ ${eD}
1913
+ `,i2=(0,el.default)`
1914
+ mutation Workspace_updateApplication(
1915
+ $id: ID!
1916
+ $config: String
1917
+ $name: String
1918
+ $description: String
1919
+ $validateConfig: Boolean
1920
+ $lastCommitId: String
1921
+ ) {
1922
+ updateApplication(
1923
+ id: $id
1924
+ config: $config
1925
+ name: $name
1926
+ description: $description
1927
+ validateConfig: $validateConfig
1928
+ lastCommitId: $lastCommitId
1929
+ ) {
1930
+ ...mcpApplicationShortArguments
1931
+ config
1932
+ has_unreleased_changes
1933
+ bricks_project_last_commit_id
1934
+ }
1935
+ }
1936
+ ${eD}
1937
+ `,i5=(0,el.default)`
1938
+ mutation Workspace_forkApplication($id: ID!) {
1939
+ forkApplication(id: $id) {
1940
+ ...mcpApplicationShortArguments
1941
+ dev_ref {
1942
+ is_dev
1943
+ parent_application
1944
+ }
1945
+ bricks_project_last_commit_id
1946
+ }
1947
+ }
1948
+ ${eD}
1949
+ `,i9=(0,el.default)`
1950
+ mutation Workspace_bindApplication(
1951
+ $id: ID!
1952
+ $bindDevices: [ID]
1953
+ $unbindDevices: [ID]
1954
+ $deviceFrames: JSON
1955
+ ) {
1956
+ bindApplication(
1957
+ id: $id
1958
+ bindDevices: $bindDevices
1959
+ unbindDevices: $unbindDevices
1960
+ deviceFrames: $deviceFrames
1961
+ ) {
1962
+ _id
1963
+ devices {
1964
+ device_id
1965
+ status
1966
+ frame
1967
+ }
1968
+ }
1969
+ }
1970
+ `,i3=(0,el.default)`
1971
+ mutation Workspace_unbindApplication($id: ID!, $unbindDevices: [ID]) {
1972
+ bindApplication(id: $id, unbindDevices: $unbindDevices) {
1973
+ _id
1974
+ devices {
1975
+ device_id
1976
+ status
1977
+ frame
1978
+ }
1979
+ }
1980
+ }
1981
+ `,i8=(0,el.default)`
1982
+ mutation Workspace_createModule(
1983
+ $name: String
1984
+ $description: String
1985
+ $exposeProperties: [String]
1986
+ $isAllowModify: Boolean
1987
+ $isPublic: Boolean
1988
+ $layoutWidth: Int
1989
+ $layoutHeight: Int
1990
+ ) {
1991
+ createModule(
1992
+ name: $name
1993
+ description: $description
1994
+ exposeProperties: $exposeProperties
1995
+ isAllowModify: $isAllowModify
1996
+ isPublic: $isPublic
1997
+ layoutWidth: $layoutWidth
1998
+ layoutHeight: $layoutHeight
1999
+ ) {
2000
+ ...moduleArguments
2001
+ }
2002
+ }
2003
+ ${e$}
2004
+ `,i7=(0,el.default)`
2005
+ mutation Workspace_updateModule(
2006
+ $id: ID!
2007
+ $config: String
2008
+ $name: String
2009
+ $description: String
2010
+ $validateConfig: Boolean
2011
+ $lastCommitId: String
2012
+ ) {
2013
+ updateModule(
2014
+ id: $id
2015
+ config: $config
2016
+ name: $name
2017
+ description: $description
2018
+ validateConfig: $validateConfig
2019
+ lastCommitId: $lastCommitId
2020
+ ) {
2021
+ ...moduleArguments
2022
+ bricks_project_last_commit_id
2023
+ }
2024
+ }
2025
+ ${e$}
2026
+ `,te=(0,el.default)`
2027
+ mutation Workspace_createMediaFileUploadRequest(
2028
+ $name: String!
2029
+ $description: String!
2030
+ $boxId: ID!
2031
+ $fileType: String!
2032
+ $contentType: String!
2033
+ $userTags: [String]
2034
+ $meta: RequestUploadMetaInput!
2035
+ ) {
2036
+ createMediaFileUploadRequest(
2037
+ name: $name
2038
+ description: $description
2039
+ boxId: $boxId
2040
+ fileType: $fileType
2041
+ contentType: $contentType
2042
+ userTags: $userTags
2043
+ meta: $meta
2044
+ ) {
2045
+ id
2046
+ name
2047
+ description
2048
+ boxId
2049
+ fileType
2050
+ contentType
2051
+ userTags
2052
+ meta {
2053
+ uploadInfo
2054
+ }
2055
+ }
2056
+ }
2057
+ `,ti=(0,el.default)`
2058
+ mutation Workspace_updateMediaFile(
2059
+ $id: ID!
2060
+ $name: String
2061
+ $description: String
2062
+ $userTags: [String]
2063
+ $requestUploadAgain: Boolean!
2064
+ ) {
2065
+ updateMediaFile(
2066
+ id: $id
2067
+ name: $name
2068
+ description: $description
2069
+ userTags: $userTags
2070
+ requestUploadAgain: $requestUploadAgain
2071
+ ) {
2072
+ id
2073
+ name
2074
+ description
2075
+ userTags
2076
+ updatedAt
2077
+ }
2078
+ }
2079
+ `,tt=(0,el.default)`
2080
+ mutation Workspace_updateMediaFiles(
2081
+ $fileIds: [ID!]!
2082
+ $name: String
2083
+ $description: String
2084
+ $userTags: [String]
2085
+ ) {
2086
+ updateMediaFiles(fileIds: $fileIds, name: $name, description: $description, userTags: $userTags)
2087
+ }
2088
+ `,tn=(0,el.default)`
2089
+ mutation Workspace_setMediaFileAsBoxPreview($id: ID!) {
2090
+ setMediaFileAsBoxPreview(id: $id)
2091
+ }
2092
+ `,ta=(0,el.default)`
2093
+ mutation Workspace_copyMediaFiles($fromBoxId: ID!, $toBoxId: ID!, $fileIds: [ID!]!) {
2094
+ copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, fileIds: $fileIds)
2095
+ }
2096
+ `,to=(0,el.default)`
2097
+ mutation Workspace_deleteMediaFiles($boxId: ID!, $fileIds: [ID!]!) {
2098
+ deleteMediaFiles(boxId: $boxId, fileIds: $fileIds)
2099
+ }
2100
+ `,tr=(0,el.default)`
2101
+ mutation Workspace_deleteMediaBoxFiles($boxId: ID!, $includeTypes: [String]) {
2102
+ deleteMediaBoxFiles(boxId: $boxId, includeTypes: $includeTypes)
2103
+ }
2104
+ `;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),tS=t(13036);let tw=[403,429],tC=(0,el.default)`
2105
+ fragment mediaWorkspaceArguments on MediaWorkspace {
2106
+ __typename
2107
+ id
2108
+ name
2109
+ description
2110
+ owner
2111
+ serviceBinding
2112
+ createdAt
2113
+ updatedAt
2114
+ size
2115
+ sizeLimit
2116
+ aiFeaturesEnabled
2117
+ }
2118
+ `,tT=(0,el.default)`
2119
+ fragment boxArguments on MediaBox {
2120
+ __typename
2121
+ id
2122
+ name
2123
+ description
2124
+ tags
2125
+ owner
2126
+ workspaceId
2127
+ serviceBinding
2128
+ serviceBindingType
2129
+ passcodes {
2130
+ id
2131
+ name
2132
+ code
2133
+ enableExpired
2134
+ expiredAt
2135
+ removeable
2136
+ permissions
2137
+ }
2138
+ createdAt
2139
+ updatedAt
2140
+ previewUrl
2141
+ size
2142
+ }
2143
+ `,tx=(0,el.default)`
2144
+ fragment fileArguments on MediaFile {
2145
+ __typename
2146
+ id
2147
+ name
2148
+ description
2149
+ boxId
2150
+ owner
2151
+ userTags
2152
+ fileType
2153
+ meta {
2154
+ storageEndpoint
2155
+ originalFileUploaded
2156
+ originalFileKey
2157
+ originalFileSize
2158
+ originalFileEtag
2159
+ originalFileContentType
2160
+ originalWidth
2161
+ originalHeight
2162
+ convertedFileUploaded
2163
+ convertedFileKey
2164
+ convertedFileSize
2165
+ convertedFileEtag
2166
+ convertedFileContentType
2167
+ videoThumbOriginalFileUploaded
2168
+ videoThumbOriginalFileKey
2169
+ videoThumbOriginalFileSize
2170
+ videoThumbOriginalFileEtag
2171
+ videoThumbOriginalFileContentType
2172
+ videoThumbOriginalWidth
2173
+ videoThumbOriginalHeight
2174
+ uploadInfo
2175
+ imageVersions {
2176
+ key
2177
+ version
2178
+ etag
2179
+ contentType
2180
+ width
2181
+ height
2182
+ strategy
2183
+ }
2184
+ videoTransformed
2185
+ videoTransformedByClient
2186
+ videoTransformType
2187
+ customVideoWidth
2188
+ customVideoHeight
2189
+
2190
+ enableAiAnalysis
2191
+ aiCustomInstruction
2192
+ aiDescription
2193
+ aiTags
2194
+ aiAnalysisStatus
2195
+ aiAnalyzedAt
2196
+ }
2197
+ createdAt
2198
+ updatedAt
2199
+ }
2200
+ `,tB=(0,el.default)`
2201
+ fragment fileShortArguments on MediaFile {
2202
+ __typename
2203
+ id
2204
+ name
2205
+ description
2206
+ boxId
2207
+ owner
2208
+ userTags
2209
+ fileType
2210
+ meta {
2211
+ storageEndpoint
2212
+ originalFileKey
2213
+ originalFileSize
2214
+ originalFileContentType
2215
+ originalFileEtag
2216
+ originalWidth
2217
+ originalHeight
2218
+ convertedFileKey
2219
+ convertedFileSize
2220
+ convertedFileContentType
2221
+ convertedFileEtag
2222
+ videoThumbOriginalFileKey
2223
+ videoThumbOriginalFileSize
2224
+ videoThumbOriginalFileContentType
2225
+ videoThumbOriginalFileEtag
2226
+ videoThumbOriginalWidth
2227
+ videoThumbOriginalHeight
2228
+ imageVersions {
2229
+ key
2230
+ version
2231
+ etag
2232
+ size
2233
+ contentType
2234
+ width
2235
+ height
2236
+ strategy
2237
+ }
2238
+ enableAiAnalysis
2239
+ aiCustomInstruction
2240
+ aiDescription
2241
+ aiTags
2242
+ aiAnalysisStatus
2243
+ aiAnalyzedAt
2244
+ }
2245
+ createdAt
2246
+ updatedAt
2247
+ }
2248
+ `,tE=(0,el.default)`
2249
+ query MediaClient_workspaces {
2250
+ mediaWorkspaces {
2251
+ ...mediaWorkspaceArguments
2252
+ }
2253
+ }
2254
+ ${tC}
2255
+ `,tU=(0,el.default)`
2256
+ query MediaClient_boxes($workspaceId: UUID, $filter: String) {
2257
+ mediaBoxes(workspaceId: $workspaceId, filter: $filter) {
2258
+ ...boxArguments
2259
+ }
2260
+ }
2261
+ ${tT}
2262
+ `,tM=(0,el.default)`
2263
+ query MediaClient_workspace($workspaceId: UUID!) {
2264
+ mediaWorkspace(id: $workspaceId) {
2265
+ ...mediaWorkspaceArguments
2266
+ }
2267
+ }
2268
+ ${tC}
2269
+ `,tO=(0,el.default)`
2270
+ query MediaClient_box($boxId: UUID!) {
2271
+ mediaBox(boxId: $boxId) {
2272
+ ...boxArguments
2273
+ }
2274
+ }
2275
+ ${tT}
2276
+ `,tR=(0,el.default)`
2277
+ query MediaClient_files(
2278
+ $boxId: UUID!
2279
+ $includeTypes: [FileType!]
2280
+ $userTags: [String!]
2281
+ $limit: Int
2282
+ $offset: Int
2283
+ ) {
2284
+ mediaFiles(
2285
+ boxId: $boxId
2286
+ includeTypes: $includeTypes
2287
+ userTags: $userTags
2288
+ limit: $limit
2289
+ offset: $offset
2290
+ ) {
2291
+ ...fileShortArguments
2292
+ }
2293
+ }
2294
+ ${tB}
2295
+ `,tP=(0,el.default)`
2296
+ query MediaClient_file($fileId: UUID!) {
2297
+ mediaFile(fileId: $fileId) {
2298
+ ...fileArguments
2299
+ }
2300
+ }
2301
+ ${tx}
2302
+ `,tF=(0,el.default)`
2303
+ mutation MediaClient_createMediaWorkspace($name: String!, $description: String!) {
2304
+ createMediaWorkspace(name: $name, description: $description) {
2305
+ ...mediaWorkspaceArguments
2306
+ }
2307
+ }
2308
+ ${tC}
2309
+ `,tN=(0,el.default)`
2310
+ mutation MediaClient_updateMediaWorkspace($id: UUID!, $name: String, $description: String) {
2311
+ updateMediaWorkspace(id: $id, name: $name, description: $description) {
2312
+ ...mediaWorkspaceArguments
2313
+ }
2314
+ }
2315
+ ${tC}
2316
+ `,tq=(0,el.default)`
2317
+ mutation MediaClient_createMediaBox(
2318
+ $name: String!
2319
+ $description: String!
2320
+ $newPasscodes: [InputNewBoxPasscode!]!
2321
+ $workspaceId: UUID
2322
+ $tags: [String!]
2323
+ ) {
2324
+ createMediaBox(
2325
+ name: $name
2326
+ description: $description
2327
+ newPasscodes: $newPasscodes
2328
+ workspaceId: $workspaceId
2329
+ tags: $tags
2330
+ ) {
2331
+ ...boxArguments
2332
+ }
2333
+ }
2334
+ ${tT}
2335
+ `,tj=(0,el.default)`
2336
+ mutation MediaClient_moveMediaBox($id: UUID!, $workspaceId: UUID) {
2337
+ moveMediaBox(id: $id, workspaceId: $workspaceId) {
2338
+ ...boxArguments
2339
+ }
2340
+ }
2341
+ ${tT}
2342
+ `,tW=(0,el.default)`
2343
+ mutation MediaClient_updateMediaBox(
2344
+ $id: UUID!
2345
+ $name: String
2346
+ $description: String
2347
+ $newPasscodes: [InputNewBoxPasscode!]
2348
+ $removePasscodes: [UUID!]
2349
+ $tags: [String!]
2350
+ ) {
2351
+ updateMediaBox(
2352
+ id: $id
2353
+ name: $name
2354
+ description: $description
2355
+ newPasscodes: $newPasscodes
2356
+ removePasscodes: $removePasscodes
2357
+ tags: $tags
2358
+ ) {
2359
+ ...boxArguments
2360
+ }
2361
+ }
2362
+ ${tT}
2363
+ `,tV=(0,el.default)`
2364
+ mutation MediaClient_requestFileUpload(
2365
+ $name: String!
2366
+ $description: String!
2367
+ $boxId: UUID!
2368
+ $fileType: FileType!
2369
+ $contentType: String!
2370
+ $userTags: [String!]
2371
+ $meta: RequestUploadMeta!
2372
+ ) {
2373
+ requestFileUpload(
2374
+ name: $name
2375
+ description: $description
2376
+ boxId: $boxId
2377
+ fileType: $fileType
2378
+ contentType: $contentType
2379
+ userTags: $userTags
2380
+ meta: $meta
2381
+ ) {
2382
+ ...fileArguments
2383
+ }
2384
+ }
2385
+ ${tx}
2386
+ `,tY=(0,el.default)`
2387
+ mutation MediaClient_updateMediaFile(
2388
+ $fileId: UUID!
2389
+ $name: String!
2390
+ $description: String!
2391
+ $userTags: [String!]
2392
+ $requestUploadAgain: Boolean!
2393
+ ) {
2394
+ updateMediaFile(
2395
+ fileId: $fileId
2396
+ name: $name
2397
+ description: $description
2398
+ userTags: $userTags
2399
+ requestUploadAgain: $requestUploadAgain
2400
+ ) {
2401
+ ...fileArguments
2402
+ }
2403
+ }
2404
+ ${tx}
2405
+ `,tK=(0,el.default)`
2406
+ mutation MediaClient_updateMediaFiles(
2407
+ $fileIds: [UUID!]!
2408
+ $name: String
2409
+ $description: String
2410
+ $userTags: [String!]
2411
+ ) {
2412
+ updateMediaFiles(fileIds: $fileIds, name: $name, description: $description, userTags: $userTags)
2413
+ }
2414
+ `,tG=(0,el.default)`
2415
+ mutation MediaClient_deleteMediaFiles($boxId: UUID!, $list: [UUID!]!) {
2416
+ deleteMediaFiles(boxId: $boxId, list: $list)
2417
+ }
2418
+ `,tL=(0,el.default)`
2419
+ mutation MediaClient_copyMediaFiles($fromBoxId: UUID!, $toBoxId: UUID!, $list: [UUID!]!) {
2420
+ copyMediaFiles(fromBoxId: $fromBoxId, toBoxId: $toBoxId, list: $list)
2421
+ }
2422
+ `,tH=(0,el.default)`
2423
+ mutation MediaClient_setMediaFileAsBoxPreview($id: UUID!) {
2424
+ setMediaFileAsBoxPreview(id: $id)
2425
+ }
2426
+ `,tz=(0,el.default)`
2427
+ mutation MediaClient_assignGroupPermissions(
2428
+ $roleId: String!
2429
+ $instanceType: InstanceType!
2430
+ $instanceId: UUID!
2431
+ $permissions: [String!]!
2432
+ ) {
2433
+ assignGroupPermissions(
2434
+ roleId: $roleId
2435
+ instanceType: $instanceType
2436
+ instanceId: $instanceId
2437
+ permissions: $permissions
2438
+ )
2439
+ }
2440
+ `,tJ=(0,el.default)`
2441
+ subscription MediaClient_listenBoxChanged($boxId: UUID!, $types: [ChangeType!]) {
2442
+ mediaBoxChanged(boxId: $boxId, types: $types) {
2443
+ createType
2444
+ id
2445
+ file {
2446
+ ...fileArguments
2447
+ }
2448
+ boxPayload {
2449
+ fileList
2450
+ includeTypes
2451
+ }
2452
+ }
2453
+ }
2454
+ ${tx}
2455
+ `,tX=(0,el.default)`
2456
+ query MediaClient_box($boxId: UUID!, $passcode: String!) {
2457
+ mediaBox(boxId: $boxId, passcode: $passcode) {
2458
+ ...boxArguments
2459
+ }
2460
+ }
2461
+ ${tT}
2462
+ `,tQ=(0,el.default)`
2463
+ query MediaClient_files(
2464
+ $boxId: UUID!
2465
+ $passcode: String!
2466
+ $includeTypes: [FileType!]
2467
+ $userTags: [String!]
2468
+ $limit: Int
2469
+ $offset: Int
2470
+ ) {
2471
+ mediaFiles(
2472
+ boxId: $boxId
2473
+ passcode: $passcode
2474
+ includeTypes: $includeTypes
2475
+ userTags: $userTags
2476
+ limit: $limit
2477
+ offset: $offset
2478
+ ) {
2479
+ ...fileShortArguments
2480
+ }
2481
+ }
2482
+ ${tB}
2483
+ `,tZ=(0,el.default)`
2484
+ query MediaClient_file($fileId: UUID!, $passcode: String!) {
2485
+ mediaFile(fileId: $fileId, passcode: $passcode) {
2486
+ ...fileArguments
2487
+ }
2488
+ }
2489
+ ${tx}
2490
+ `,t0=(0,el.default)`
2491
+ mutation MediaClient_requestFileUpload(
2492
+ $name: String!
2493
+ $description: String!
2494
+ $boxId: UUID!
2495
+ $passcode: String!
2496
+ $fileType: FileType!
2497
+ $contentType: String!
2498
+ $userTags: [String!]
2499
+ $meta: RequestUploadMeta!
2500
+ ) {
2501
+ requestFileUpload(
2502
+ name: $name
2503
+ description: $description
2504
+ boxId: $boxId
2505
+ passcode: $passcode
2506
+ fileType: $fileType
2507
+ contentType: $contentType
2508
+ userTags: $userTags
2509
+ meta: $meta
2510
+ ) {
2511
+ ...fileArguments
2512
+ }
2513
+ }
2514
+ ${tx}
2515
+ `,t1=(0,el.default)`
2516
+ mutation MediaClient_updateMediaFile(
2517
+ $boxId: UUID!
2518
+ $passcode: String!
2519
+ $fileId: UUID!
2520
+ $name: String
2521
+ $description: String
2522
+ $userTags: [String!]
2523
+ $requestUploadAgain: Boolean!
2524
+ ) {
2525
+ updateMediaFile(
2526
+ boxId: $boxId
2527
+ passcode: $passcode
2528
+ fileId: $fileId
2529
+ name: $name
2530
+ description: $description
2531
+ userTags: $userTags
2532
+ requestUploadAgain: $requestUploadAgain
2533
+ ) {
2534
+ ...fileArguments
2535
+ }
2536
+ }
2537
+ ${tx}
2538
+ `,t4=(0,el.default)`
2539
+ mutation MediaClient_updateMediaFiles(
2540
+ $boxId: UUID!
2541
+ $passcode: String!
2542
+ $fileIds: [UUID!]!
2543
+ $name: String
2544
+ $description: String
2545
+ $userTags: [String!]
2546
+ ) {
2547
+ updateMediaFiles(
2548
+ boxId: $boxId
2549
+ passcode: $passcode
2550
+ fileIds: $fileIds
2551
+ name: $name
2552
+ description: $description
2553
+ userTags: $userTags
2554
+ )
2555
+ }
2556
+ `,t6=(0,el.default)`
2557
+ mutation MediaClient_deleteMediaFiles($boxId: UUID!, $passcode: String!, $list: [UUID!]!) {
2558
+ deleteMediaFiles(boxId: $boxId, passcode: $passcode, list: $list)
2559
+ }
2560
+ `,t2=(0,el.default)`
2561
+ subscription MediaClient_listenBoxChanged(
2562
+ $boxId: UUID!
2563
+ $passcode: String!
2564
+ $types: [ChangeType!]
2565
+ ) {
2566
+ mediaBoxChanged(boxId: $boxId, passcode: $passcode, types: $types) {
2567
+ createType
2568
+ id
2569
+ file {
2570
+ ...fileArguments
2571
+ }
2572
+ boxPayload {
2573
+ fileList
2574
+ includeTypes
2575
+ }
2576
+ }
2577
+ }
2578
+ ${tx}
2579
+ `,t5=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=`
2580
+ query AL_events($filter: EventsFilter!) {
2581
+ events(filter: $filter) {
2582
+ device_id
2583
+ event_type
2584
+ event_name
2585
+ subspace_id
2586
+ sender
2587
+ payload
2588
+ timestamp
2589
+ }
2590
+ }
2591
+ `,t7=`
2592
+ query AL_screenshots($filter: ScreenshotFilter!) {
2593
+ screenshots(filter: $filter) {
2594
+ timestamp
2595
+ }
2596
+ }
2597
+ `,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=L(G.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=L(G.dK.Basic),d=L(G.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=L(G.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(G.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=(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)}),ns="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.",nd=(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)}),nc="2.26.0-beta.30";function nl(){return np.apply(this,arguments)}function np(){return(np=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=e.queryStringParameters?.token;if(!i){var t=new Headers(e.headers);i=t.get("authorization")?.replace("Bearer ","")}if(!i)return{success:!1,message:"Authentication failed: No token provided"};var n=function(e){try{var i=e.split(".");if(i.length<3)return null;var t=JSON.parse(Buffer.from(i[0],"base64url").toString());if(!S.includes(t?.alg))return null;return JSON.parse(Buffer.from(i[1],"base64url").toString())}catch{return null}}(i);if(!n)return{success:!1,message:"Authentication failed: Invalid token"};var a=C(n)?"user":"workspace";if("workspace"===a){var o=Array.isArray(n.t)?n.t:[];n.permissions=o.reduce((e,i)=>{var t=D[i];return t&&e.push(t),e},[])}else n.permissions=Object.keys(A);return{success:!0,token:i,tokenInfo:n,tokenType:a}}catch(e){return{success:!1,message:`Authentication failed: ${e.message}`}}}({queryStringParameters:{token: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:nc});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.
2598
+
2599
+ Before doing any complex work (application design, deployments, etc.),
2600
+ always consult the official docs rather than guessing.
2601
+
2602
+ IMPORTANT: BRICKS users interact through a GUI editor, not raw config files.
2603
+ Never show users JSON config details, schema fields, or technical implementation.
2604
+ Focus on user-friendly descriptions of what the app will do and how it will look.
2605
+
2606
+ Golden rules for working with BRICKS:
2607
+ 1) Read before you act
2608
+ - Open these resources first, then proceed:
2609
+ - \`getting-started\` — overview & architecture
2610
+ - \`config-schema\` — canonical schema for apps, subspaces, bricks, generators, etc.
2611
+ - \`components-index\` — available bricks/generators
2612
+ 2) Source of truth
2613
+ - Rely on the docs above; do not invent fields not present in the schema
2614
+ 3) No guessing
2615
+ - If names, constraints, or device details are missing, ask to fetch them first
2616
+ 4) Plan then execute
2617
+ - Propose a clear step-by-step plan and wait for approval before writing or mutating data
2618
+ 5) User-friendly communication
2619
+ - Describe features in terms of what users see and do, not technical config
2620
+ - Use visual/functional language: "text display", "button", "screen transition"
2621
+ - Avoid exposing JSON, IDs, or schema details to end users
2622
+
2623
+ BRICKS essentials:
2624
+ - Applications: interactive digital signage experiences
2625
+ - Devices: deployment targets (screens/players)
2626
+ - Modules: Reusable module across applications
2627
+ - Grid system: default 96\xd754; 1 unit = device_width/96 (e.g., 20px at 1920\xd71080)
2628
+ - Key primitives: Subspaces, Canvas, Bricks, Generators, Property Banks (Data)
2629
+
2630
+ Quick actions:
2631
+ - "Create a new application" → use the \`create-application\` prompt
2632
+ - "Deploy an application to a device" → use the \`deploy-to-device\` prompt
2633
+
2634
+ Try asking:
2635
+ - "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}".
2636
+
2637
+ ${t?`Goal: ${t}`:""}
2638
+
2639
+ IMPORTANT: Users see a visual GUI editor, not raw config. Describe features in user-friendly terms:
2640
+ - "text display" not "BRICK_TEXT"
2641
+ - "image" not "BRICK_IMAGE"
2642
+ - "canvas name" not "CANVAS_xxx"
2643
+ - "data storage" not "PROPERTY_BANK"
2644
+ - Focus on what users see and do, not technical implementation
2645
+
2646
+ How we'll proceed (no guessing, schema-first):
2647
+ 1) Confirm intent
2648
+ - Restate objectives and success criteria in 1–3 bullets
2649
+ 2) Consult docs (as needed)
2650
+ - getting-started, config-schema, components-index
2651
+ - Ensure proposed fields exist in the schema
2652
+ 3) Ask missing questions before changes
2653
+ - Target device(s) and resolution(s)
2654
+ - Layout needs (pages/screens), content types, data sources
2655
+ - Localization, scheduling, or interaction needs
2656
+ 4) Propose a minimal viable design (After confirming intent)
2657
+ - App structure: screens → visual elements
2658
+ - Initial component selection with rationale
2659
+ - Grid usage: default 96\xd754 (≈20px at 1920\xd71080)
2660
+ 5) Produce a schema-valid skeleton (no side effects yet)
2661
+ - Include only fields defined by config-schema
2662
+ - Use clear placeholders for text/assets/URLs/ids
2663
+
2664
+ What I'll produce first:
2665
+ - Short recap of requirements
2666
+ - Clarifying questions (only what's necessary)
2667
+ - High-level architecture plan
2668
+ - 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,permission:o,workspaceTokenOnly:r=!1},s)=>{!(r&&ee(i))&&(!o||i.tokenInfo.permissions?.includes(o)||0)&&e.tool(t,n,a,s)})(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:tw})}}),new(tD())(3e4),r?ty.C.split(({query:e})=>{let{kind:i,operation:t}=(0,tS.Vn)(e);return"OperationDefinition"===i&&"subscription"===t},p,m):m].filter(Boolean));return _.closeSubscriptionClient=()=>r&&l.dispose(),_}({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:t2,variables:{...t,...e}}).subscribe({next:t5(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:t5(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",{},b(function*(){return Z((yield d.workspaces()))})),r({name:"get_workspace_overview",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",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",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",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",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",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",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(ns)}),permission:"update_module",workspaceTokenOnly:!0},(D=b(function*({workspace_id:e,id:i,config:t,last_commit_id:n}){var a=yield Y(t);if(!a.valid)throw Error(`Config validation failed: ${a.errors.join(", ")}`);return Z((yield nd("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",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"},(S=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 S.apply(this,arguments)})),r({name:"create_application",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"},(w=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 w.apply(this,arguments)})),r({name:"update_application_info",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",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",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(ns)},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 Y(i);if(!a.valid)throw Error(`Config validation failed: ${a.errors.join(", ")}`);return Z((yield nd("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",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",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",description:"List all media workspaces",inputSchema:{},permission:"query_media_flow"},b(function*(){return Z((yield c.mediaWorkspaces()))})),r({name:"get_media_workspace",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",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",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",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",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",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"},(K=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 nr(n,(0,M.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 K.apply(this,arguments)})),r({name:"update_media_file_meta",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"},(G=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 G.apply(this,arguments)})),r({name:"copy_media_files",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"},(L=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 L.apply(this,arguments)})),r({name:"delete_media_files",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"},(H=b(function*({box_id:e,file_ids:i}){return Z((yield c.deleteMediaFiles({boxId:e,...p(i)})))}),function(e){return H.apply(this,arguments)})),r({name:"cleanup_media_box",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)},(J=b(function*({device_width:e,device_height:i,app_grid_width:t,app_grid_height:n}){var a=(0,O.k)(t,e,i),o=(0,O.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")},no),e.tool("getting_started","Get documentation content for getting started",{},b(function*(){return Z(Q)})),!a){var _,g,f,I,k,A,D,S,w,C,x,R,P,F,N,q,j,W,V,K,G,L,H,z,J,X,ei,et,en=()=>new ne(t,i.auth||i.token);r({name:"activity_log_events",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",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",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",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${nc}`),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)}}};