@fugood/bricks-cli 2.25.0-beta.62 → 2.25.0-beta.64

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.
Files changed (85) hide show
  1. package/lib/1010.js +1 -0
  2. package/lib/1178.js +1 -0
  3. package/lib/1215.js +1 -0
  4. package/lib/1708.js +9 -0
  5. package/lib/1759.js +1 -0
  6. package/lib/1936.js +1 -0
  7. package/lib/2151.js +1 -0
  8. package/lib/{209.js → 2209.js} +3 -3
  9. package/lib/2247.js +1 -0
  10. package/lib/2486.js +1 -0
  11. package/lib/2557.js +1 -0
  12. package/lib/{223.js → 3223.js} +1 -1
  13. package/lib/3332.js +13 -0
  14. package/lib/3690.js +1 -0
  15. package/lib/3774.js +44 -0
  16. package/lib/3976.js +14 -0
  17. package/lib/4305.js +1 -0
  18. package/lib/4456.js +3 -0
  19. package/lib/{192.js → 4479.js} +4 -4
  20. package/lib/4530.js +22 -0
  21. package/lib/4642.js +9 -0
  22. package/lib/4685.js +1202 -0
  23. package/lib/5212.js +1 -0
  24. package/lib/{658.js → 5658.js} +1 -1
  25. package/lib/5785.js +1 -0
  26. package/lib/6194.js +3 -0
  27. package/lib/6370.js +1 -0
  28. package/lib/6645.js +1 -0
  29. package/lib/6818.js +1 -0
  30. package/lib/7111.js +2 -0
  31. package/lib/7456.js +1 -0
  32. package/lib/7511.js +1 -0
  33. package/lib/7574.js +1 -0
  34. package/lib/7648.js +1 -0
  35. package/lib/8026.js +1 -0
  36. package/lib/{117.js → 8117.js} +2 -2
  37. package/lib/8166.js +1 -0
  38. package/lib/853.js +1 -0
  39. package/lib/915.js +4 -4
  40. package/lib/9320.js +3 -0
  41. package/lib/{387.js → 9387.js} +1 -1
  42. package/lib/9405.js +1 -0
  43. package/lib/9430.js +1 -0
  44. package/lib/{583.js → 9583.js} +1 -1
  45. package/lib/9663.js +1 -0
  46. package/lib/{866.js → 9866.js} +1 -1
  47. package/lib/9940.js +19 -0
  48. package/lib/index.js +17 -17
  49. package/lib/simulator-host-bridge.cjs +1 -0
  50. package/lib/simulator-main.mjs +3 -3
  51. package/package.json +5 -5
  52. package/lib/10.js +0 -1
  53. package/lib/111.js +0 -2
  54. package/lib/166.js +0 -1
  55. package/lib/178.js +0 -1
  56. package/lib/212.js +0 -1
  57. package/lib/215.js +0 -1
  58. package/lib/247.js +0 -1
  59. package/lib/274.js +0 -16
  60. package/lib/305.js +0 -1
  61. package/lib/306.js +0 -1
  62. package/lib/320.js +0 -3
  63. package/lib/332.js +0 -13
  64. package/lib/358.js +0 -1
  65. package/lib/370.js +0 -1
  66. package/lib/405.js +0 -1
  67. package/lib/430.js +0 -1
  68. package/lib/456.js +0 -3
  69. package/lib/479.js +0 -1231
  70. package/lib/486.js +0 -1
  71. package/lib/511.js +0 -1
  72. package/lib/557.js +0 -1
  73. package/lib/574.js +0 -1
  74. package/lib/645.js +0 -1
  75. package/lib/648.js +0 -1
  76. package/lib/663.js +0 -1
  77. package/lib/690.js +0 -1
  78. package/lib/708.js +0 -9
  79. package/lib/75.js +0 -1
  80. package/lib/759.js +0 -1
  81. package/lib/785.js +0 -1
  82. package/lib/818.js +0 -1
  83. package/lib/917.js +0 -1
  84. package/lib/936.js +0 -1
  85. package/lib/940.js +0 -19
package/lib/index.js CHANGED
@@ -12,12 +12,12 @@ Expecting one of '${o.join("', '")}'`);let r=`${e}Help`;return this.on(r,e=>{let
12
12
  `)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(e=>t.is(e))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}}function m(e){return e.map(e=>{let t,o;if(!e.startsWith("--inspect"))return e;let r="127.0.0.1",n="9229";return(null!==(o=e.match(/^(--inspect(-brk)?)$/))?t=o[1]:null!==(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))?(t=o[1],/^\d+$/.test(o[3])?n=o[3]:r=o[3]):null!==(o=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))&&(t=o[1],r=o[3],n=o[4]),t&&"0"!==n)?`${t}=${r}:${parseInt(n)+1}`:e})}t.Command=h},43823(e,t){class o extends Error{constructor(e,t,o){super(o),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}}t.CommanderError=o,t.InvalidArgumentError=class extends o{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}},99690(e,t,o){let{humanReadableArgName:r}=o(41762);t.Help=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter(e=>!e._hidden),o=e._getHelpCommand();return o&&!o._hidden&&t.push(o),this.sortSubcommands&&t.sort((e,t)=>e.name().localeCompare(t.name())),t}compareOptions(e,t){let o=e=>e.short?e.short.replace(/^-/,""):e.long.replace(/^--/,"");return o(e).localeCompare(o(t))}visibleOptions(e){let t=e.options.filter(e=>!e.hidden),o=e._getHelpOption();if(o&&!o.hidden){let r=o.short&&e._findOption(o.short),n=o.long&&e._findOption(o.long);r||n?o.long&&!n?t.push(e.createOption(o.long,o.description)):o.short&&!r&&t.push(e.createOption(o.short,o.description)):t.push(o)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let o=e.parent;o;o=o.parent){let e=o.options.filter(e=>!e.hidden);t.push(...e)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return(e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(e=>e.description))?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(e=>r(e)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((e,o)=>Math.max(e,t.subcommandTerm(o).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((e,o)=>Math.max(e,t.optionTerm(o).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((e,o)=>Math.max(e,t.optionTerm(o).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((e,o)=>Math.max(e,t.argumentTerm(o).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let o="";for(let t=e.parent;t;t=t.parent)o=t.name()+" "+o;return o+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue&&(e.required||e.optional||e.isBoolean()&&"boolean"==typeof e.defaultValue)&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),void 0!==e.presetArg&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),void 0!==e.envVar&&t.push(`env: ${e.envVar}`),t.length>0)?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(e=>JSON.stringify(e)).join(", ")}`),void 0!==e.defaultValue&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let o=`(${t.join(", ")})`;return e.description?`${e.description} ${o}`:o}return e.description}formatHelp(e,t){let o=t.padWidth(e,t),r=t.helpWidth||80;function n(e,n){if(n){let i=`${e.padEnd(o+2)}${n}`;return t.wrap(i,r-2,o+2)}return e}function i(e){return e.join("\n").replace(/^/gm," ".repeat(2))}let a=[`Usage: ${t.commandUsage(e)}`,""],s=t.commandDescription(e);s.length>0&&(a=a.concat([t.wrap(s,r,0),""]));let l=t.visibleArguments(e).map(e=>n(t.argumentTerm(e),t.argumentDescription(e)));l.length>0&&(a=a.concat(["Arguments:",i(l),""]));let u=t.visibleOptions(e).map(e=>n(t.optionTerm(e),t.optionDescription(e)));if(u.length>0&&(a=a.concat(["Options:",i(u),""])),this.showGlobalOptions){let o=t.visibleGlobalOptions(e).map(e=>n(t.optionTerm(e),t.optionDescription(e)));o.length>0&&(a=a.concat(["Global Options:",i(o),""]))}let c=t.visibleCommands(e).map(e=>n(t.subcommandTerm(e),t.subcommandDescription(e)));return c.length>0&&(a=a.concat(["Commands:",i(c),""])),a.join("\n")}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,o,r=40){let n=RegExp("[\\n][ \\f\\t\\v\xa0  -    \uFEFF]+");if(e.match(n))return e;let i=t-o;if(i<r)return e;let a=e.slice(0,o),s=e.slice(o).replace("\r\n","\n"),l=" ".repeat(o),u="\\s​",c=RegExp(`
13
13
  |.{1,${i-1}}([${u}]|$)|[^${u}]+?([${u}]|$)`,"g");return a+(s.match(c)||[]).map((e,t)=>"\n"===e?"":(t>0?l:"")+e.trimEnd()).join("\n")}}},92088(e,t,o){let{InvalidArgumentError:r}=o(43823);t.Option=class{constructor(e,t){let o,r,n;this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let i=((n=e.split(/[ |,]+/)).length>1&&!/^[[<]/.test(n[1])&&(o=n.shift()),r=n.shift(),!o&&/^-[^-]$/.test(r)&&(o=r,r=void 0),{shortFlag:o,longFlag:r});this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return"string"==typeof e&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t!==this.defaultValue&&Array.isArray(t)?t.concat(e):[e]}choices(e){return this.argChoices=e.slice(),this.parseArg=(e,t)=>{if(!this.argChoices.includes(e))throw new r(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(e,t):e},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.name().replace(/^no-/,"").split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},t.DualOptions=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(e=>{e.negate?this.negativeOptions.set(e.attributeName(),e):this.positiveOptions.set(e.attributeName(),e)}),this.negativeOptions.forEach((e,t)=>{this.positiveOptions.has(t)&&this.dualOptions.add(t)})}valueFromOption(e,t){let o=t.attributeName();if(!this.dualOptions.has(o))return!0;let r=this.negativeOptions.get(o).presetArg;return t.negate===((void 0!==r&&r)===e)}}},86054(e,t){t.suggestSimilar=function(e,t){if(!t||0===t.length)return"";t=Array.from(new Set(t));let o=e.startsWith("--");o&&(e=e.slice(2),t=t.map(e=>e.slice(2)));let r=[],n=3;return(t.forEach(t=>{if(t.length<=1)return;let o=function(e,t){if(Math.abs(e.length-t.length)>3)return Math.max(e.length,t.length);let o=[];for(let t=0;t<=e.length;t++)o[t]=[t];for(let e=0;e<=t.length;e++)o[0][e]=e;for(let r=1;r<=t.length;r++)for(let n=1;n<=e.length;n++){let i=1;i=+(e[n-1]!==t[r-1]),o[n][r]=Math.min(o[n-1][r]+1,o[n][r-1]+1,o[n-1][r-1]+i),n>1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(o[n][r]=Math.min(o[n][r],o[n-2][r-2]+1))}return o[e.length][t.length]}(e,t),i=Math.max(e.length,t.length);(i-o)/i>.4&&(o<n?(n=o,r=[t]):o===n&&r.push(t))}),r.sort((e,t)=>e.localeCompare(t)),o&&(r=r.map(e=>`--${e}`)),r.length>1)?`
14
14
  (Did you mean one of ${r.join(", ")}?)`:1===r.length?`
15
- (Did you mean ${r[0]}?)`:""}},98247(e,t,o){o.d(t,{v:()=>$});var r,n,i,a,s,l,u,c=o(99436),d=o(35679),p=o(73284),f=o(47988),g=o(94979),h=o(16928),m=o(79896);function D(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return(D=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var o=this.s.return;return void 0===o?Promise.resolve({value:e,done:!0}):t(o.apply(this.s,arguments))},throw:function(e){var o=this.s.return;return void 0===o?Promise.reject(e):t(o.apply(this.s,arguments))}},new D(e)}var y=(r=c(function*(){return(yield Promise.resolve().then(o.bind(o,30155))).default}),function(){return r.apply(this,arguments)}),v=(n=c(function*(){return Promise.all([o.e(370),o.e(785),o.e(583)]).then(o.bind(o,92642))}),function(){return n.apply(this,arguments)}),b=(i=c(function*(e){return(yield y())(e).start()}),function(e){return i.apply(this,arguments)}),F=(a=c(function*(){var e=(0,f.getCurrentProfile)(),t=(0,f.getToken)(e);return t||(console.error(p.default.red("Not logged in. Use `bricks auth login` first.")),process.exit(1)),(0,(yield v()).createActivityLogClient)((0,f.getActivityLogBaseUrl)(),t)}),function(){return a.apply(this,arguments)}),_=e=>new Date(e).toISOString().replace("T"," ").replace(/\.\d+Z$/,"Z"),C=(e,t)=>{if(!e)return"";var o="string"==typeof e?e:JSON.stringify(e);return o.length>t?o.slice(0,t-1)+"…":o},$=new d.uB("activity-log").alias("al").description("Activity log queries (read-only)");$.command("events").description("Query activity log events (all types)").requiredOption("--start-time <datetime>","Start time (ISO 8601 or relative: 1h, 30m, 2d)").option("--end-time <datetime>","End time (default: now)").option("--device <id>","Filter by device ID").option("--type <type>","Filter by event type: general, data, local_sync").option("--event-name <name>","Filter by event name").option("--subspace <id>","Filter by subspace ID").option("--sender <id>","Filter by sender").option("--limit <n>","Max events to display",parseInt).option("-j, --json","Output as JSON array").option("--jsonl","Output as JSONL (one JSON per line)").action((s=c(function*(e){var t=yield F(),o=(a=(0,g.p)(e.startTime),new Date(s=e.endTime?(0,g.p)(e.endTime):new Date().toISOString())-new Date(a)>2592e6&&(console.error(p.default.red("Time range must be 30 days or less")),process.exit(1)),l={start_time:a,end_time:s},e.device&&(l.device_id=e.device),e.type&&(l.event_type=e.type),e.eventName&&(l.event_name=e.eventName),e.subspace&&(l.subspace_id=e.subspace),e.sender&&(l.sender=e.sender),l);if(e.jsonl){var r=0;try{var n=!1,i=!1;try{for(var a,s,l,u,c,d=function(e){var t,o,r,n=2;for("u">typeof Symbol&&(o=Symbol.asyncIterator,r=Symbol.iterator);n--;){if(o&&null!=(t=e[o]))return t.call(e);if(r&&null!=(t=e[r]))return new D(t.call(e));o="@@asyncIterator",r="@@iterator"}throw TypeError("Object is not async iterable")}(t.events(o));n=!(c=yield d.next()).done;n=!1){var f=c.value;if(console.log(JSON.stringify(f)),r++,e.limit&&r>=e.limit)break}}catch(e){i=!0,u=e}finally{try{n&&null!=d.return&&(yield d.return())}finally{if(i)throw u}}}catch(e){console.error(p.default.red(`Failed to query events: ${e.message}`)),process.exit(1)}return}var h=yield b("Querying events...");try{var m=yield t.collectEvents(o,{limit:e.limit});if(h.stop(),e.json)return void console.log(JSON.stringify(m,null,2));if(0===m.length)return void console.log(p.default.yellow("No events found"));for(var y of(console.log(p.default.bold(`
15
+ (Did you mean ${r[0]}?)`:""}},98247(e,t,o){o.d(t,{v:()=>$});var r,n,i,a,s,l,u,c=o(99436),d=o(35679),p=o(73284),f=o(47988),g=o(94979),h=o(16928),m=o(79896);function D(e){function t(e){if(Object(e)!==e)return Promise.reject(TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then(function(e){return{value:e,done:t}})}return(D=function(e){this.s=e,this.n=e.next}).prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var o=this.s.return;return void 0===o?Promise.resolve({value:e,done:!0}):t(o.apply(this.s,arguments))},throw:function(e){var o=this.s.return;return void 0===o?Promise.reject(e):t(o.apply(this.s,arguments))}},new D(e)}var y=(r=c(function*(){return(yield Promise.resolve().then(o.bind(o,30155))).default}),function(){return r.apply(this,arguments)}),v=(n=c(function*(){return Promise.all([o.e(6370),o.e(5785),o.e(9583)]).then(o.bind(o,92642))}),function(){return n.apply(this,arguments)}),b=(i=c(function*(e){return(yield y())(e).start()}),function(e){return i.apply(this,arguments)}),F=(a=c(function*(){var e=(0,f.getCurrentProfile)(),t=(0,f.getToken)(e);return t||(console.error(p.default.red("Not logged in. Use `bricks auth login` first.")),process.exit(1)),(0,(yield v()).createActivityLogClient)((0,f.getActivityLogBaseUrl)(),t)}),function(){return a.apply(this,arguments)}),_=e=>new Date(e).toISOString().replace("T"," ").replace(/\.\d+Z$/,"Z"),C=(e,t)=>{if(!e)return"";var o="string"==typeof e?e:JSON.stringify(e);return o.length>t?o.slice(0,t-1)+"…":o},$=new d.uB("activity-log").alias("al").description("Activity log queries (read-only)");$.command("events").description("Query activity log events (all types)").requiredOption("--start-time <datetime>","Start time (ISO 8601 or relative: 1h, 30m, 2d)").option("--end-time <datetime>","End time (default: now)").option("--device <id>","Filter by device ID").option("--type <type>","Filter by event type: general, data, local_sync").option("--event-name <name>","Filter by event name").option("--subspace <id>","Filter by subspace ID").option("--sender <id>","Filter by sender").option("--limit <n>","Max events to display",parseInt).option("-j, --json","Output as JSON array").option("--jsonl","Output as JSONL (one JSON per line)").action((s=c(function*(e){var t=yield F(),o=(a=(0,g.p)(e.startTime),new Date(s=e.endTime?(0,g.p)(e.endTime):new Date().toISOString())-new Date(a)>2592e6&&(console.error(p.default.red("Time range must be 30 days or less")),process.exit(1)),l={start_time:a,end_time:s},e.device&&(l.device_id=e.device),e.type&&(l.event_type=e.type),e.eventName&&(l.event_name=e.eventName),e.subspace&&(l.subspace_id=e.subspace),e.sender&&(l.sender=e.sender),l);if(e.jsonl){var r=0;try{var n=!1,i=!1;try{for(var a,s,l,u,c,d=function(e){var t,o,r,n=2;for("u">typeof Symbol&&(o=Symbol.asyncIterator,r=Symbol.iterator);n--;){if(o&&null!=(t=e[o]))return t.call(e);if(r&&null!=(t=e[r]))return new D(t.call(e));o="@@asyncIterator",r="@@iterator"}throw TypeError("Object is not async iterable")}(t.events(o));n=!(c=yield d.next()).done;n=!1){var f=c.value;if(console.log(JSON.stringify(f)),r++,e.limit&&r>=e.limit)break}}catch(e){i=!0,u=e}finally{try{n&&null!=d.return&&(yield d.return())}finally{if(i)throw u}}}catch(e){console.error(p.default.red(`Failed to query events: ${e.message}`)),process.exit(1)}return}var h=yield b("Querying events...");try{var m=yield t.collectEvents(o,{limit:e.limit});if(h.stop(),e.json)return void console.log(JSON.stringify(m,null,2));if(0===m.length)return void console.log(p.default.yellow("No events found"));for(var y of(console.log(p.default.bold(`
16
16
  Activity Log Events (${m.length})`)),console.log("─".repeat(100)),console.log(p.default.gray(`${"Timestamp".padEnd(24)} ${"Type".padEnd(12)} ${"Device".padEnd(14)} ${"Event Name".padEnd(28)} ${"Sender".padEnd(16)} Payload`)),console.log("─".repeat(100)),m)){var v=_(y.timestamp),$=(y.event_type||"").padEnd(12),E=C(y.device_id,14).padEnd(14),w=C(y.event_name,28).padEnd(28),k=C(y.sender,16).padEnd(16),S=C(y.payload,40);console.log(`${v} ${$} ${E} ${w} ${k} ${p.default.gray(S)}`)}console.log("─".repeat(100))}catch(e){h.fail(`Failed to query events: ${e.message}`),process.exit(1)}}),function(e){return s.apply(this,arguments)})),$.command("screenshots").description("List screenshot timestamps for a device").requiredOption("--device <id>","Device ID (required)").requiredOption("--start-time <datetime>","Start time (ISO 8601 or relative: 1h, 30m, 2d)").option("--end-time <datetime>","End time (default: now)").option("-j, --json","Output as JSON").action((l=c(function*(e){var t=yield F(),o=(0,g.p)(e.startTime),r=e.endTime?(0,g.p)(e.endTime):new Date().toISOString();new Date(r)-new Date(o)>2592e6&&(console.error(p.default.red("Time range must be 30 days or less")),process.exit(1));var n={device_id:e.device,start_time:o,end_time:r},i=yield b("Querying screenshots...");try{var a=yield t.collectScreenshots(n);if(i.stop(),e.json)return void console.log(JSON.stringify(a,null,2));if(0===a.length)return void console.log(p.default.yellow("No screenshots found"));console.log(p.default.bold(`
17
- Screenshots (${a.length})`)),console.log("─".repeat(56)),console.log(p.default.gray(`${"#".padStart(4)} ${"Timestamp".padEnd(24)} --ts value`)),console.log("─".repeat(56)),a.forEach((e,t)=>{var o=new Date(e.timestamp).getTime();console.log(`${String(t+1).padStart(4)} ${_(e.timestamp).padEnd(24)} ${o}`)}),console.log("─".repeat(56))}catch(e){i.fail(`Failed to query screenshots: ${e.message}`),process.exit(1)}}),function(e){return l.apply(this,arguments)})),$.command("screenshot").description("Download a screenshot image").requiredOption("--device <id>","Device ID").requiredOption("--ts <timestamp>","Screenshot timestamp (ISO 8601 or epoch ms)").option("--space <id>","Workspace/space ID (auto-detected from profile)").option("-o, --output <path>","Output file path").option("--open","Open with OS default viewer after download").action((u=c(function*(e){var t,r,n=yield F(),i=e.space||(t=(0,f.getCurrentProfile)(),r=(0,f.getTokenInfo)(t),r?.workspaceId);i||(console.error(p.default.red("Could not determine workspace ID. Use --space <id> or log in first.")),process.exit(1));var a=/^\d+$/.test(e.ts)?e.ts:new Date(e.ts).getTime(),s=yield b("Downloading screenshot...");try{var l=yield n.downloadScreenshot(i,e.device,a);s.stop();var u=e.output||`screenshot-${e.device}-${a}.jpg`,c=h.resolve(u);m.writeFileSync(c,l);var d=(l.length/1024).toFixed(1);if(console.log(p.default.green(`✓ Screenshot saved: ${c} (${d} KB)`)),e.open){var g=(yield Promise.resolve().then(o.t.bind(o,35317,19))).exec,D="darwin"===process.platform?"open":"win32"===process.platform?"start":"xdg-open";g(`${D} "${c}"`)}}catch(e){s.fail(`Failed to download screenshot: ${e.message}`),process.exit(1)}}),function(e){return u.apply(this,arguments)}))},17422(e,t,o){o.d(t,{B:()=>j});var r,n,i,a,s,l,u,c,d,p,f,g,h,m,D,y,v,b=o(99436),F=o(35679),_=o(73284),C=o(30155),$=o(79896),E=o(44618),w=o(7586),k=o(56493),S=o(68168),x=o(74049),O=o(98593),A=(e,t)=>(0,O.H_)(e,t,{currentVersion:e?.current_version||null,unreleasedChanges:!!e?.has_unreleased_changes}),j=new F.uB("app").description("Application management");j.command("new").description("Create a new application").requiredOption("-n, --name <name>","Application name").option("-d, --description <description>","Application description").option("--layout-width <width>","Layout width",parseInt).option("--layout-height <height>","Layout height",parseInt).option("--init","Initialize a BRICKS Project after creation").option("-o, --output <dir>","Output directory for --init (default: current directory)").option("-y, --yes","Skip prompts for --init").option("-j, --json","Output as JSON").action((r=b(function*(e){var t=(0,k.requireAuth)(),r=e.json?null:(0,C.default)("Creating application...").start();try{var n={name:e.name};e.description&&(n.description=e.description),e.layoutWidth&&(n.layoutWidth=e.layoutWidth),e.layoutHeight&&(n.layoutHeight=e.layoutHeight);var i=yield t.createApplication(n);if(e.json&&!e.init?console.log(JSON.stringify(i,null,2)):!e.json&&(r.succeed(`Application created: ${_.default.green(i.name)}`),console.log(` ID: ${_.default.gray(i._id)}`),i.description&&console.log(` ${_.default.gray(i.description)}`)),e.init){r&&r.stop();var a=(yield Promise.all([o.e(658),o.e(456)]).then(o.bind(o,58891))).initProject;yield a("application",i._id,{output:e.output,yes:e.yes,json:e.json})}}catch(t){e.json?console.error(JSON.stringify({error:t.message})):r.fail(`Failed to create application: ${t.message}`),process.exit(1)}}),function(e){return r.apply(this,arguments)})),j.command("share-info <applicationId>").description("Show public share info (releases available for share-new) for an application").option("-j, --json","Output as JSON").action((n=b(function*(e,t){var o=(0,k.requireAuth)(),r=t.json?null:(0,C.default)("Fetching share info...").start();try{var n=yield o.publicApplicationShareInfo({id:e});if(r&&r.stop(),!n)return void(t.json?console.log(JSON.stringify(null)):console.log(_.default.yellow("No share info found for this application")));if(t.json)return void console.log(JSON.stringify(n,null,2));var i=[...n.share?.selected_releases||[]].sort((e,t)=>new Date(t.date||0)-new Date(e.date||0));console.log(_.default.bold(`
17
+ Screenshots (${a.length})`)),console.log("─".repeat(56)),console.log(p.default.gray(`${"#".padStart(4)} ${"Timestamp".padEnd(24)} --ts value`)),console.log("─".repeat(56)),a.forEach((e,t)=>{var o=new Date(e.timestamp).getTime();console.log(`${String(t+1).padStart(4)} ${_(e.timestamp).padEnd(24)} ${o}`)}),console.log("─".repeat(56))}catch(e){i.fail(`Failed to query screenshots: ${e.message}`),process.exit(1)}}),function(e){return l.apply(this,arguments)})),$.command("screenshot").description("Download a screenshot image").requiredOption("--device <id>","Device ID").requiredOption("--ts <timestamp>","Screenshot timestamp (ISO 8601 or epoch ms)").option("--space <id>","Workspace/space ID (auto-detected from profile)").option("-o, --output <path>","Output file path").option("--open","Open with OS default viewer after download").action((u=c(function*(e){var t,r,n=yield F(),i=e.space||(t=(0,f.getCurrentProfile)(),r=(0,f.getTokenInfo)(t),r?.workspaceId);i||(console.error(p.default.red("Could not determine workspace ID. Use --space <id> or log in first.")),process.exit(1));var a=/^\d+$/.test(e.ts)?e.ts:new Date(e.ts).getTime(),s=yield b("Downloading screenshot...");try{var l=yield n.downloadScreenshot(i,e.device,a);s.stop();var u=e.output||`screenshot-${e.device}-${a}.jpg`,c=h.resolve(u);m.writeFileSync(c,l);var d=(l.length/1024).toFixed(1);if(console.log(p.default.green(`✓ Screenshot saved: ${c} (${d} KB)`)),e.open){var g=(yield Promise.resolve().then(o.t.bind(o,35317,19))).exec,D="darwin"===process.platform?"open":"win32"===process.platform?"start":"xdg-open";g(`${D} "${c}"`)}}catch(e){s.fail(`Failed to download screenshot: ${e.message}`),process.exit(1)}}),function(e){return u.apply(this,arguments)}))},17422(e,t,o){o.d(t,{B:()=>j});var r,n,i,a,s,l,u,c,d,p,f,g,h,m,D,y,v,b=o(99436),F=o(35679),_=o(73284),C=o(30155),$=o(79896),E=o(44618),w=o(7586),k=o(56493),S=o(68168),x=o(74049),O=o(98593),A=(e,t)=>(0,O.H_)(e,t,{currentVersion:e?.current_version||null,unreleasedChanges:!!e?.has_unreleased_changes}),j=new F.uB("app").description("Application management");j.command("new").description("Create a new application").requiredOption("-n, --name <name>","Application name").option("-d, --description <description>","Application description").option("--layout-width <width>","Layout width",parseInt).option("--layout-height <height>","Layout height",parseInt).option("--init","Initialize a BRICKS Project after creation").option("-o, --output <dir>","Output directory for --init (default: current directory)").option("-y, --yes","Skip prompts for --init").option("-j, --json","Output as JSON").action((r=b(function*(e){var t=(0,k.requireAuth)(),r=e.json?null:(0,C.default)("Creating application...").start();try{var n={name:e.name};e.description&&(n.description=e.description),e.layoutWidth&&(n.layoutWidth=e.layoutWidth),e.layoutHeight&&(n.layoutHeight=e.layoutHeight);var i=yield t.createApplication(n);if(e.json&&!e.init?console.log(JSON.stringify(i,null,2)):!e.json&&(r.succeed(`Application created: ${_.default.green(i.name)}`),console.log(` ID: ${_.default.gray(i._id)}`),i.description&&console.log(` ${_.default.gray(i.description)}`)),e.init){r&&r.stop();var a=(yield Promise.all([o.e(5658),o.e(4456)]).then(o.bind(o,58891))).initProject;yield a("application",i._id,{output:e.output,yes:e.yes,json:e.json})}}catch(t){e.json?console.error(JSON.stringify({error:t.message})):r.fail(`Failed to create application: ${t.message}`),process.exit(1)}}),function(e){return r.apply(this,arguments)})),j.command("share-info <applicationId>").description("Show public share info (releases available for share-new) for an application").option("-j, --json","Output as JSON").action((n=b(function*(e,t){var o=(0,k.requireAuth)(),r=t.json?null:(0,C.default)("Fetching share info...").start();try{var n=yield o.publicApplicationShareInfo({id:e});if(r&&r.stop(),!n)return void(t.json?console.log(JSON.stringify(null)):console.log(_.default.yellow("No share info found for this application")));if(t.json)return void console.log(JSON.stringify(n,null,2));var i=[...n.share?.selected_releases||[]].sort((e,t)=>new Date(t.date||0)-new Date(e.date||0));console.log(_.default.bold(`
18
18
  Share Info: ${n.name||"Unnamed"}`)),console.log("─".repeat(60)),console.log(`App ID: ${_.default.gray(n._id)}`),n.description&&console.log(`Description: ${n.description}`),n.owner?.id_from_user&&console.log(`Owner: ${_.default.gray(n.owner.id_from_user)}`),n.share?.tags?.length&&console.log(`Tags: ${n.share.tags.join(", ")}`),n.share?.type&&console.log(`Type: ${n.share.type}`),console.log(`
19
19
  ${_.default.bold("Selected Releases")} (${i.length})`),0===i.length?console.log(_.default.gray(" None")):i.forEach(e=>{console.log(`
20
- ${_.default.cyan(e.name||"(unnamed)")} ${_.default.gray(e.date||"")}`),console.log(` Version ID: ${_.default.green(e.version)}`),console.log(` Release ID: ${_.default.gray(e._id)}`),e.note&&console.log(` Note: ${_.default.gray(e.note)}`)}),console.log("\n"+"─".repeat(60)),console.log(_.default.gray("Use:"),`bricks app share-new --app-id ${n._id} --version <name>`),console.log(_.default.gray("Or: "),"bricks app share-new --version-id <Version ID>")}catch(e){t.json?console.error(JSON.stringify({error:e.message})):r.fail(`Failed to fetch share info: ${e.message}`),process.exit(1)}}),function(e,t){return n.apply(this,arguments)})),j.command("share-new").description("Create a new application from a shared release version").option("--app-id <id>","Source shared application ID (requires --version)").option("--version <name>","Release name to use from the source app (requires --app-id)").option("--version-id <id>","Share version ID (from `app share-info`); skips lookup").option("-n, --name <name>","Application name").option("-d, --description <description>","Application description").option("--skip-if-exists","Return existing application if one already exists with this share version").option("--init","Initialize a BRICKS Project after creation").option("-o, --output <dir>","Output directory for --init (default: current directory)").option("-y, --yes","Skip prompts for --init").option("-j, --json","Output as JSON").action((i=b(function*(e){var t=(0,k.requireAuth)(),r=e.json?null:(0,C.default)("Creating application from shared version...").start();try{if(!e.versionId&&!(e.appId&&e.version))throw Error("Provide --version-id, or both --app-id and --version. Run `bricks app share-info <appId>` to discover values.");var n=e.versionId;if(!n){r&&(r.text="Resolving share version...");var i=yield t.publicApplicationShareInfo({id:e.appId}),a=i?.share?.selected_releases||[],s=a.find(t=>t.name===e.version);if(!s){var l=a.map(e=>e.name).filter(Boolean).join(", ")||"none";throw Error(`Release "${e.version}" not found on app ${e.appId}. Available: ${l}`)}n=s.version,r&&(r.text="Creating application from shared version...")}var u={shareVersionId:n};e.name&&(u.name=e.name),e.description&&(u.description=e.description),e.skipIfExists&&(u.skipIfExists=!0);var c=yield t.createApplicationWithShareVersion(u);if(e.json&&!e.init?console.log(JSON.stringify(c,null,2)):!e.json&&(r.succeed(`Application created: ${_.default.green(c.name)}`),console.log(` ID: ${_.default.gray(c._id)}`),c.description&&console.log(` ${_.default.gray(c.description)}`)),e.init){r&&r.stop();var d=(yield Promise.all([o.e(658),o.e(456)]).then(o.bind(o,58891))).initProject;yield d("application",c._id,{output:e.output,yes:e.yes,json:e.json})}}catch(t){e.json?console.error(JSON.stringify({error:t.message})):r.fail(`Failed to create application from shared version: ${t.message}`),process.exit(1)}}),function(e){return i.apply(this,arguments)})),j.command("list").description("List all applications").option("-k, --keyword <keyword>","Filter by keyword").option("-j, --json","Output as JSON").action((a=b(function*(e){var t=(0,k.requireAuth)(),o=(0,C.default)("Fetching applications...").start();try{var r=yield t.applications({keyword:e.keyword});if(o.stop(),e.json)return void console.log(JSON.stringify(r,null,2));if(!r||0===r.length)return void console.log(_.default.yellow("No applications found"));console.log(_.default.bold("\nApplications")),console.log("─".repeat(80)),r.forEach(e=>{var t=e.has_unreleased_changes?_.default.yellow("●"):_.default.green("●"),o=e.current_version?`v${e.current_version}`:_.default.gray("no version");console.log(`${t} ${_.default.cyan(e.name)} ${_.default.gray(o)}`),console.log(` ID: ${_.default.gray(e._id)}`),e.description&&console.log(` ${_.default.gray(e.description)}`),console.log()})}catch(e){o.fail(`Failed to list applications: ${e.message}`),process.exit(1)}}),function(e){return a.apply(this,arguments)})),j.command("get <id>").description("Get application details").option("-c, --composed","Get composed configuration").option("-j, --json","Output as JSON").action((s=b(function*(e,t){var o=(0,k.requireAuth)(),r=(0,C.default)("Fetching application...").start();try{var n=yield o.application({id:e,composed:t.composed});if(r.stop(),n||(console.log(_.default.red("Application not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(n,null,2));if(console.log(_.default.bold(`
20
+ ${_.default.cyan(e.name||"(unnamed)")} ${_.default.gray(e.date||"")}`),console.log(` Version ID: ${_.default.green(e.version)}`),console.log(` Release ID: ${_.default.gray(e._id)}`),e.note&&console.log(` Note: ${_.default.gray(e.note)}`)}),console.log("\n"+"─".repeat(60)),console.log(_.default.gray("Use:"),`bricks app share-new --app-id ${n._id} --version <name>`),console.log(_.default.gray("Or: "),"bricks app share-new --version-id <Version ID>")}catch(e){t.json?console.error(JSON.stringify({error:e.message})):r.fail(`Failed to fetch share info: ${e.message}`),process.exit(1)}}),function(e,t){return n.apply(this,arguments)})),j.command("share-new").description("Create a new application from a shared release version").option("--app-id <id>","Source shared application ID (requires --version)").option("--version <name>","Release name to use from the source app (requires --app-id)").option("--version-id <id>","Share version ID (from `app share-info`); skips lookup").option("-n, --name <name>","Application name").option("-d, --description <description>","Application description").option("--skip-if-exists","Return existing application if one already exists with this share version").option("--init","Initialize a BRICKS Project after creation").option("-o, --output <dir>","Output directory for --init (default: current directory)").option("-y, --yes","Skip prompts for --init").option("-j, --json","Output as JSON").action((i=b(function*(e){var t=(0,k.requireAuth)(),r=e.json?null:(0,C.default)("Creating application from shared version...").start();try{if(!e.versionId&&!(e.appId&&e.version))throw Error("Provide --version-id, or both --app-id and --version. Run `bricks app share-info <appId>` to discover values.");var n=e.versionId;if(!n){r&&(r.text="Resolving share version...");var i=yield t.publicApplicationShareInfo({id:e.appId}),a=i?.share?.selected_releases||[],s=a.find(t=>t.name===e.version);if(!s){var l=a.map(e=>e.name).filter(Boolean).join(", ")||"none";throw Error(`Release "${e.version}" not found on app ${e.appId}. Available: ${l}`)}n=s.version,r&&(r.text="Creating application from shared version...")}var u={shareVersionId:n};e.name&&(u.name=e.name),e.description&&(u.description=e.description),e.skipIfExists&&(u.skipIfExists=!0);var c=yield t.createApplicationWithShareVersion(u);if(e.json&&!e.init?console.log(JSON.stringify(c,null,2)):!e.json&&(r.succeed(`Application created: ${_.default.green(c.name)}`),console.log(` ID: ${_.default.gray(c._id)}`),c.description&&console.log(` ${_.default.gray(c.description)}`)),e.init){r&&r.stop();var d=(yield Promise.all([o.e(5658),o.e(4456)]).then(o.bind(o,58891))).initProject;yield d("application",c._id,{output:e.output,yes:e.yes,json:e.json})}}catch(t){e.json?console.error(JSON.stringify({error:t.message})):r.fail(`Failed to create application from shared version: ${t.message}`),process.exit(1)}}),function(e){return i.apply(this,arguments)})),j.command("list").description("List all applications").option("-k, --keyword <keyword>","Filter by keyword").option("-j, --json","Output as JSON").action((a=b(function*(e){var t=(0,k.requireAuth)(),o=(0,C.default)("Fetching applications...").start();try{var r=yield t.applications({keyword:e.keyword});if(o.stop(),e.json)return void console.log(JSON.stringify(r,null,2));if(!r||0===r.length)return void console.log(_.default.yellow("No applications found"));console.log(_.default.bold("\nApplications")),console.log("─".repeat(80)),r.forEach(e=>{var t=e.has_unreleased_changes?_.default.yellow("●"):_.default.green("●"),o=e.current_version?`v${e.current_version}`:_.default.gray("no version");console.log(`${t} ${_.default.cyan(e.name)} ${_.default.gray(o)}`),console.log(` ID: ${_.default.gray(e._id)}`),e.description&&console.log(` ${_.default.gray(e.description)}`),console.log()})}catch(e){o.fail(`Failed to list applications: ${e.message}`),process.exit(1)}}),function(e){return a.apply(this,arguments)})),j.command("get <id>").description("Get application details").option("-c, --composed","Get composed configuration").option("-j, --json","Output as JSON").action((s=b(function*(e,t){var o=(0,k.requireAuth)(),r=(0,C.default)("Fetching application...").start();try{var n=yield o.application({id:e,composed:t.composed});if(r.stop(),n||(console.log(_.default.red("Application not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(n,null,2));if(console.log(_.default.bold(`
21
21
  Application: ${n.name}`)),console.log("─".repeat(60)),console.log(`ID: ${_.default.gray(n._id)}`),console.log(`Description: ${n.description||_.default.gray("N/A")}`),console.log(`Tags: ${n.tags?.join(", ")||_.default.gray("None")}`),console.log(`Created: ${_.default.gray(n.create_datetime)}`),console.log(`Modified: ${_.default.gray(n.last_modify_datetime)}`),console.log(`
22
22
  ${_.default.bold("Version")}`),n.current_version){if(console.log(`Current: v${n.current_version}`),n.current_version_details){var i=n.current_version_details;i.name&&console.log(`Release Name: ${i.name}`),i.note&&console.log(`Release Note: ${_.default.gray(i.note)}`),i.create_datetime&&console.log(`Released At: ${_.default.gray(i.create_datetime)}`)}}else console.log(`Current: ${_.default.gray("No version")}`);if(console.log(`Unreleased: ${n.has_unreleased_changes?_.default.yellow("Yes"):_.default.green("No")}`),console.log(`
23
23
  ${_.default.bold("Features")}`),console.log(`Short Edit: ${n.short_edit?.enabled?_.default.green("Enabled"):_.default.gray("Disabled")}`),n.short_edit?.enabled&&n.short_edit.ref_map){var a=Object.keys(n.short_edit.ref_map).length;console.log(` References: ${a} editable properties`)}console.log(`Automation: ${n.canvas_control?.enable_schedule?_.default.green("Scheduled"):_.default.gray("No schedule")}`),n.lock?.enabled&&console.log(`Locked: ${_.default.yellow("Yes")}`),n.sync_key&&console.log(`Sync Key: ${_.default.gray(n.sync_key)}`),n.devices?.length>0?(console.log(`
@@ -25,7 +25,7 @@ ${_.default.bold("Bound Devices")} (${n.devices.length})`),n.devices.forEach(e=>
25
25
  ${_.default.bold("Bound Devices")}: ${_.default.gray("None")}`),console.log("─".repeat(60))}catch(e){r.fail(`Failed to get application: ${e.message}`),process.exit(1)}}),function(e,t){return s.apply(this,arguments)})),j.command("resolve <query>").description("Resolve an application name or ID to stable IDs").option("-l, --limit <limit>","Limit search results",e=>Number.parseInt(e,10),10).option("-j, --json","Output as JSON").action((l=b(function*(e,t){var o=(0,k.requireAuth)(),r=t.json?null:(0,C.default)("Resolving application...").start();try{var n=yield(0,S.Y)(()=>o.application({id:e})),i=n?[n]:yield o.applications({keyword:e,paginate:{limit:t.limit}}),a=(0,S.K)({resource:"application",query:e,items:i||[],fields:["_id","name"],selectedBy:n?"id":null});if(r&&r.stop(),t.json)return void(0,w.GF)(a);if(a.resolved){var s=a.resolved;console.log(_.default.bold("\nResolved Application")),console.log("─".repeat(60)),console.log(`Name: ${_.default.cyan(s.name||"Unnamed")}`),console.log(`ID: ${_.default.gray(s._id)}`),console.log(`Selected By: ${a.selectedBy}`),console.log("─".repeat(60));return}if(0===a.matches.length)return void console.log(_.default.yellow(`No applications matched "${e}"`));console.log(_.default.bold(`
26
26
  Matching Applications (${a.matches.length})`)),console.log("─".repeat(80)),a.matches.forEach(e=>{console.log(`${_.default.cyan(e.name||"Unnamed")} ${_.default.gray(e._id)}`)}),console.log("─".repeat(80))}catch(t){r?r.fail(`Failed to resolve application: ${t.message}`):(0,w.OW)(t.message,{resource:"application",query:e}),process.exit(1)}}),function(e,t){return l.apply(this,arguments)})),j.command("update <id>").description("Update application name, description, and/or configuration").option("-n, --name <name>","Application name").option("-d, --description <description>","Application description").option("-c, --config <json>","Application config as JSON string").option("-f, --file <path>","Application config from file").option("--validate","Validate configuration (default: true when config is set)",!0).option("--no-validate","Skip server-side config validation").option("--last-commit-id <id>","Reject if server config.bricks_project_last_commit_id does not match this value").option("-j, --json","Output as JSON").action((u=b(function*(e,t){var o=(0,k.requireAuth)(),r=t.json?null:(0,C.default)("Updating application...").start();try{var n=yield o.updateApplication((0,O.jB)(e,t));t.json?(0,O.yd)({action:"application.update",target:A(n,e),result:{lastCommitId:t.lastCommitId||null},json:!0}):(r.succeed(`Application updated: ${_.default.green(n.name)}`),n.has_unreleased_changes&&console.log(_.default.yellow("Note: Application has unreleased changes")))}catch(o){t.json?(0,w.OW)(o.message,{action:"application.update",target:{id:e}}):r.fail(`Failed to update application: ${o.message}`),process.exit(1)}}),function(e,t){return u.apply(this,arguments)})),j.command("short-edit <id>").description("Short edit application properties").requiredOption("-l, --list <json>","Short edit list as JSON array").action((c=b(function*(e,t){var o=(0,k.requireAuth)(),r=(0,C.default)("Applying short edit...").start();try{var n=JSON.parse(t.list);Array.isArray(n)||(r.fail("List must be a JSON array"),process.exit(1));var i=yield o.shortEditApplication({id:e,list:n});r.succeed(`Short edit applied to: ${_.default.green(i.name)}`)}catch(e){r.fail(`Failed to apply short edit: ${e.message}`),process.exit(1)}}),function(e,t){return c.apply(this,arguments)})),j.command("short-refs <id>").description("List short edit references for an application").option("-k, --keyword <keyword>","Filter by shortId or title").option("-t, --types <types>","Comma-separated shortId prefixes to include (e.g. B,C,S)").option("-j, --json","Output as JSON").action((d=b(function*(e,t){var o=(0,k.requireAuth)(),r=(0,C.default)("Fetching short edit references...").start();try{var n=yield o.application({id:e});if(r.stop(),!n?.short_edit?.enabled)return void console.log(_.default.yellow("Short Edit is not enabled for this application"));var i=t.types?t.types.split(",").map(e=>e.trim()).filter(Boolean):[],a=(0,E.V)(n.short_edit.ref_map,{keyword:t.keyword,types:i});if(t.json)return void console.log(JSON.stringify(a,null,2));if(0===a.length)return void console.log(_.default.yellow("No short edit references found"));console.log(_.default.bold(`
27
27
  Short Edit References: ${n.name}`)),a.forEach(e=>{console.log(_.default.cyan(`
28
- ${e.label} (${e.prefix}_)`)),e.refs.forEach(({shortId:e,ref:t})=>{var o=t?.title?_.default.gray(`- ${t.title}`):"";console.log(` ${_.default.green(e)} ${o}`)})}),console.log()}catch(e){r.fail(`Failed to fetch short edit references: ${e.message}`),process.exit(1)}}),function(e,t){return d.apply(this,arguments)})),j.command("bind <id>").description("Bind devices to application").option("-b, --bind <devices>","Device IDs to bind (comma-separated)").option("-u, --unbind <devices>","Device IDs to unbind (comma-separated)").option("--dry-run","Validate inputs and show the binding plan without applying it").option("-j, --json","Output as JSON").action((p=b(function*(e,t){var o=(0,k.requireAuth)(),r=t.json?null:(0,C.default)("Updating device bindings...").start();try{var n=yield o.application({id:e});if(!n)throw Error("Application not found");var i=t.bind?t.bind.split(",").map(e=>e.trim()):[],a=t.unbind?t.unbind.split(",").map(e=>e.trim()):[],s={id:e};if(i.length>0&&(s.bindDevices=i),a.length>0&&(s.unbindDevices=a),t.dryRun){r&&r.stop(),(0,O.S5)({action:"application.bind",target:A(n,e),request:{bindDevices:i,unbindDevices:a},checks:[(0,O.Iy)("application exists",!0,`${n.name} (${n._id})`),(0,O.Iy)("device changes provided",i.length+a.length>0,`bind=${i.length}, unbind=${a.length}`)],json:t.json});return}yield o.bindApplication(s),t.json?(0,O.yd)({action:"application.bind",target:A(n,e),result:{bindDevices:i,unbindDevices:a},json:!0}):r.succeed("Device bindings updated")}catch(o){t.json?(0,w.OW)(o.message,{action:"application.bind",target:{id:e}}):r.fail(`Failed to update bindings: ${o.message}`),process.exit(1)}}),function(e,t){return p.apply(this,arguments)})),j.command("remove <id>").description("Remove an application").option("--dry-run","Validate the target and show the removal plan without deleting it").option("-j, --json","Output as JSON").action((f=b(function*(e,t){var o=(0,k.requireAuth)(),r=t.json?null:(0,C.default)("Removing application...").start();try{var n=yield o.application({id:e});if(!n)throw Error("Application not found");var i=A(n,e);if(t.dryRun){r&&r.stop(),(0,O.S5)({action:"application.remove",target:i,request:{id:e},checks:[(0,O.Iy)("application exists",!0,`${i.name} (${i.id})`)],json:t.json});return}var a=yield o.removeApplication({id:e});t.json?(0,O.yd)({action:"application.remove",target:i,result:{removed:!!a},json:!0}):r.succeed(`Application removed: ${_.default.green(i.name)}`)}catch(o){t.json?(0,w.OW)(o.message,{action:"application.remove",target:{id:e}}):r.fail(`Failed to remove application: ${o.message}`),process.exit(1)}}),function(e,t){return f.apply(this,arguments)})),j.command("trigger <id> <testId>").description("Trigger automation test on application").option("--play","Play the test",!0).option("--stop","Stop the test").option("--setup-at-launch","Setup to run at app launch").option("-g, --match-group <group>","Match group").action((g=b(function*(e,t,o){var r=(0,k.requireAuth)(),n=(0,C.default)("Triggering automation...").start();try{yield r.triggerApplicationCanvasControl({id:e,testId:t,play:!o.stop&&o.play,setupAtLaunch:o.setupAtLaunch,matchGroup:o.matchGroup}),n.succeed(`Automation triggered: ${_.default.green(t)}`)}catch(e){n.fail(`Failed to trigger automation: ${e.message}`),process.exit(1)}}),function(e,t,o){return g.apply(this,arguments)})),j.command("release <id>").description("Release application to BRICKS platform").requiredOption("-c, --config <path|json>","Application config file path or JSON string").option("-n, --name <name>","Update application name as part of the release").option("--version <version>","Version name").option("--changelogs <text>","Release changelogs").option("--dry-run","Validate inputs and show the release plan without publishing").option("-j, --json","Output as JSON").action((h=b(function*(e,t){var o=(0,k.requireAuth)(),r=t.json?null:(0,C.default)("Releasing application...").start();try{var n=(0,x.Ku)(t.config),i=n.config,a=n.source,s=n.sizeBytes,l=yield o.application({id:e});if(!l)throw Error("Application not found");if(l.lock?.enabled)throw Error("Application is locked");var u=t.version||t.name||l.name||"Untitled",c=(0,x.w9)(t.changelogs);if(t.dryRun){r&&r.stop(),(0,O.S5)({action:"application.release",target:A(l,e),request:{name:t.name||null,version:u,changelogs:t.changelogs||null,configSource:a,configSizeBytes:s},checks:[(0,O.Iy)("application exists",!0,`${l.name} (${l._id})`),(0,O.Iy)("application is unlocked",!l.lock?.enabled),(0,O.Iy)("release config loaded",!0,`${s} bytes`)],json:t.json});return}var d=yield o.releaseApplication({id:e,config:i,...t.name?{name:t.name}:{},releaseCurrentVersion:u,releaseCurrentVersionNote:c});t.json?(0,O.yd)({action:"application.release",target:A(d||l,e),result:{name:t.name||null,version:u,configSource:a,configSizeBytes:s},json:!0}):r.succeed(`Application released: ${_.default.green(d?.name||l.name)}`)}catch(o){t.json?(0,w.OW)(o.message,{action:"application.release",target:{id:e}}):r.fail(`Failed to release application: ${o.message}`),process.exit(1)}}),function(e,t){return h.apply(this,arguments)})),j.command("project-pull <id>").description("Pull application source files from BRICKS platform").option("-j, --json","Output as JSON (for programmatic use)").action((m=b(function*(e,t){var o=(0,k.requireAuth)(),r=t.json?null:(0,C.default)("Pulling application project...").start();try{var n=yield o.applicationProject({id:e,buildApplicationOnly:!0});n||(r?r.fail("Application project not found"):console.error(JSON.stringify({error:"Application project not found"})),process.exit(1)),t.json?console.log(JSON.stringify(n)):(r.succeed(`Application project fetched: ${_.default.green(n.files?.length||0)} files`),console.log(JSON.stringify(n,null,2)))}catch(e){t.json?console.error(JSON.stringify({error:e.message})):r.fail(`Failed to pull application project: ${e.message}`),process.exit(1)}}),function(e,t){return m.apply(this,arguments)})),j.command("check-config <path>").description("Validate application config against BRICKS schema").option("-j, --json","Output as JSON").option("--validate-automation","Also validate automation_map and test_map references (skips commented/unfinished steps)").option("--no-validate-expressions","Skip validating PROPERTY_BANK_EXPRESSION strings against the runtime expression rules").action((D=b(function*(e,t){$.existsSync(e)||(console.error(_.default.red(`Config file not found: ${e}`)),process.exit(1));var r=(0,C.default)("Validating config...").start();try{var n=$.readFileSync(e,"utf-8"),i=JSON.parse(n),a=yield Promise.all([o.e(866),o.e(645),o.e(430),o.e(10),o.e(511),o.e(574)]).then(o.t.bind(o,38890,19)),s=a.checkConfig,l=a.checkConfigDeprecatedFeatures,u=s(i,{checkAutomation:!!t.validateAutomation,checkCalc:!0,checkExpressions:!1!==t.validateExpressions}),c=l(i);if(r.stop(),t.json){console.log(JSON.stringify({...u,deprecations:c},null,2)),u.valid||process.exit(1);return}if(u.valid&&0===c.length)return void console.log(_.default.green("✓ Config is valid"));console.log(_.default.bold("\nConfig Validation Report")),console.log("─".repeat(60)),u.schema.length>0&&(console.log(_.default.red(`
28
+ ${e.label} (${e.prefix}_)`)),e.refs.forEach(({shortId:e,ref:t})=>{var o=t?.title?_.default.gray(`- ${t.title}`):"";console.log(` ${_.default.green(e)} ${o}`)})}),console.log()}catch(e){r.fail(`Failed to fetch short edit references: ${e.message}`),process.exit(1)}}),function(e,t){return d.apply(this,arguments)})),j.command("bind <id>").description("Bind devices to application").option("-b, --bind <devices>","Device IDs to bind (comma-separated)").option("-u, --unbind <devices>","Device IDs to unbind (comma-separated)").option("--dry-run","Validate inputs and show the binding plan without applying it").option("-j, --json","Output as JSON").action((p=b(function*(e,t){var o=(0,k.requireAuth)(),r=t.json?null:(0,C.default)("Updating device bindings...").start();try{var n=yield o.application({id:e});if(!n)throw Error("Application not found");var i=t.bind?t.bind.split(",").map(e=>e.trim()):[],a=t.unbind?t.unbind.split(",").map(e=>e.trim()):[],s={id:e};if(i.length>0&&(s.bindDevices=i),a.length>0&&(s.unbindDevices=a),t.dryRun){r&&r.stop(),(0,O.S5)({action:"application.bind",target:A(n,e),request:{bindDevices:i,unbindDevices:a},checks:[(0,O.Iy)("application exists",!0,`${n.name} (${n._id})`),(0,O.Iy)("device changes provided",i.length+a.length>0,`bind=${i.length}, unbind=${a.length}`)],json:t.json});return}yield o.bindApplication(s),t.json?(0,O.yd)({action:"application.bind",target:A(n,e),result:{bindDevices:i,unbindDevices:a},json:!0}):r.succeed("Device bindings updated")}catch(o){t.json?(0,w.OW)(o.message,{action:"application.bind",target:{id:e}}):r.fail(`Failed to update bindings: ${o.message}`),process.exit(1)}}),function(e,t){return p.apply(this,arguments)})),j.command("remove <id>").description("Remove an application").option("--dry-run","Validate the target and show the removal plan without deleting it").option("-j, --json","Output as JSON").action((f=b(function*(e,t){var o=(0,k.requireAuth)(),r=t.json?null:(0,C.default)("Removing application...").start();try{var n=yield o.application({id:e});if(!n)throw Error("Application not found");var i=A(n,e);if(t.dryRun){r&&r.stop(),(0,O.S5)({action:"application.remove",target:i,request:{id:e},checks:[(0,O.Iy)("application exists",!0,`${i.name} (${i.id})`)],json:t.json});return}var a=yield o.removeApplication({id:e});t.json?(0,O.yd)({action:"application.remove",target:i,result:{removed:!!a},json:!0}):r.succeed(`Application removed: ${_.default.green(i.name)}`)}catch(o){t.json?(0,w.OW)(o.message,{action:"application.remove",target:{id:e}}):r.fail(`Failed to remove application: ${o.message}`),process.exit(1)}}),function(e,t){return f.apply(this,arguments)})),j.command("trigger <id> <testId>").description("Trigger automation test on application").option("--play","Play the test",!0).option("--stop","Stop the test").option("--setup-at-launch","Setup to run at app launch").option("-g, --match-group <group>","Match group").action((g=b(function*(e,t,o){var r=(0,k.requireAuth)(),n=(0,C.default)("Triggering automation...").start();try{yield r.triggerApplicationCanvasControl({id:e,testId:t,play:!o.stop&&o.play,setupAtLaunch:o.setupAtLaunch,matchGroup:o.matchGroup}),n.succeed(`Automation triggered: ${_.default.green(t)}`)}catch(e){n.fail(`Failed to trigger automation: ${e.message}`),process.exit(1)}}),function(e,t,o){return g.apply(this,arguments)})),j.command("release <id>").description("Release application to BRICKS platform").requiredOption("-c, --config <path|json>","Application config file path or JSON string").option("-n, --name <name>","Update application name as part of the release").option("--version <version>","Version name").option("--changelogs <text>","Release changelogs").option("--dry-run","Validate inputs and show the release plan without publishing").option("-j, --json","Output as JSON").action((h=b(function*(e,t){var o=(0,k.requireAuth)(),r=t.json?null:(0,C.default)("Releasing application...").start();try{var n=(0,x.Ku)(t.config),i=n.config,a=n.source,s=n.sizeBytes,l=yield o.application({id:e});if(!l)throw Error("Application not found");if(l.lock?.enabled)throw Error("Application is locked");var u=t.version||t.name||l.name||"Untitled",c=(0,x.w9)(t.changelogs);if(t.dryRun){r&&r.stop(),(0,O.S5)({action:"application.release",target:A(l,e),request:{name:t.name||null,version:u,changelogs:t.changelogs||null,configSource:a,configSizeBytes:s},checks:[(0,O.Iy)("application exists",!0,`${l.name} (${l._id})`),(0,O.Iy)("application is unlocked",!l.lock?.enabled),(0,O.Iy)("release config loaded",!0,`${s} bytes`)],json:t.json});return}var d=yield o.releaseApplication({id:e,config:i,...t.name?{name:t.name}:{},releaseCurrentVersion:u,releaseCurrentVersionNote:c});t.json?(0,O.yd)({action:"application.release",target:A(d||l,e),result:{name:t.name||null,version:u,configSource:a,configSizeBytes:s},json:!0}):r.succeed(`Application released: ${_.default.green(d?.name||l.name)}`)}catch(o){t.json?(0,w.OW)(o.message,{action:"application.release",target:{id:e}}):r.fail(`Failed to release application: ${o.message}`),process.exit(1)}}),function(e,t){return h.apply(this,arguments)})),j.command("project-pull <id>").description("Pull application source files from BRICKS platform").option("-j, --json","Output as JSON (for programmatic use)").action((m=b(function*(e,t){var o=(0,k.requireAuth)(),r=t.json?null:(0,C.default)("Pulling application project...").start();try{var n=yield o.applicationProject({id:e,buildApplicationOnly:!0});n||(r?r.fail("Application project not found"):console.error(JSON.stringify({error:"Application project not found"})),process.exit(1)),t.json?console.log(JSON.stringify(n)):(r.succeed(`Application project fetched: ${_.default.green(n.files?.length||0)} files`),console.log(JSON.stringify(n,null,2)))}catch(e){t.json?console.error(JSON.stringify({error:e.message})):r.fail(`Failed to pull application project: ${e.message}`),process.exit(1)}}),function(e,t){return m.apply(this,arguments)})),j.command("check-config <path>").description("Validate application config against BRICKS schema").option("-j, --json","Output as JSON").option("--validate-automation","Also validate automation_map and test_map references (skips commented/unfinished steps)").option("--no-validate-expressions","Skip validating PROPERTY_BANK_EXPRESSION strings against the runtime expression rules").action((D=b(function*(e,t){$.existsSync(e)||(console.error(_.default.red(`Config file not found: ${e}`)),process.exit(1));var r=(0,C.default)("Validating config...").start();try{var n=$.readFileSync(e,"utf-8"),i=JSON.parse(n),a=yield Promise.all([o.e(9866),o.e(6645),o.e(9430),o.e(1010),o.e(7511),o.e(7574)]).then(o.t.bind(o,38890,19)),s=a.checkConfig,l=a.checkConfigDeprecatedFeatures,u=s(i,{checkAutomation:!!t.validateAutomation,checkCalc:!0,checkExpressions:!1!==t.validateExpressions}),c=l(i);if(r.stop(),t.json){console.log(JSON.stringify({...u,deprecations:c},null,2)),u.valid||process.exit(1);return}if(u.valid&&0===c.length)return void console.log(_.default.green("✓ Config is valid"));console.log(_.default.bold("\nConfig Validation Report")),console.log("─".repeat(60)),u.schema.length>0&&(console.log(_.default.red(`
29
29
  Schema Errors (${u.schema.length})
30
30
  `)),u.schema.forEach((e,t)=>{var o=e.instancePath||e.dataPath||"/";console.log(` ${_.default.red(`${t+1}.`)} ${_.default.bold(o)}`),console.log(` ${e.message}`),e.params?.pattern&&console.log(` ${_.default.gray(`pattern: ${e.params.pattern}`)}`)})),u.ref.length>0&&(console.log(_.default.red(`
31
31
  Reference Errors (${u.ref.length})
@@ -35,9 +35,9 @@ ${e.label} (${e.prefix}_)`)),e.refs.forEach(({shortId:e,ref:t})=>{var o=t?.title
35
35
  Expression Errors (${u.expression.length})
36
36
  `)),u.expression.forEach((e,t)=>{console.log(` ${_.default.red(`${t+1}.`)} ${_.default.bold(e.field)}`),console.log(` ${e.message}`)})),c.length>0&&(console.log(_.default.yellow(`
37
37
  Deprecation Warnings (${c.length})
38
- `)),c.forEach((e,t)=>{console.log(` ${_.default.yellow(`${t+1}.`)} ${_.default.bold(e.id)}`),console.log(` ${e.data}`)})),console.log("\n"+"─".repeat(60));var d=u.schema.length+u.ref.length+u.calc.length+(u.expression?.length||0);u.valid?console.log(_.default.yellow(`⚠ ${c.length} warning(s)`)):console.log(_.default.red(`✗ ${d} error(s)`)+(c.length>0?_.default.yellow(`, ${c.length} warning(s)`):"")),u.valid||process.exit(1)}catch(e){r.fail(`Failed to validate config: ${e.message}`),process.exit(1)}}),function(e,t){return D.apply(this,arguments)})),j.command("doctor <idOrPath>").description("Diagnose an application config: schema validation plus semantic lint rules (data races, layout mistakes, dead config)").option("-j, --json","Output as JSON").option("-c, --composed","Fetch the composed configuration (remote id only)").option("--strict","Exit with code 1 when warnings are found").option("--only <codes>","Run only these rule codes (comma-separated)").option("--ignore <codes>","Skip these rule codes (comma-separated)").option("--validate-automation","Also validate automation_map and test_map references").action((y=b(function*(e,t){var r=t.json?null:(0,C.default)("Running config doctor...").start();try{var n=yield Promise.all([o.e(866),o.e(645),o.e(430),o.e(10),o.e(511),o.e(563)]).then(o.bind(o,63322)),i=n.runConfigDoctor,a=n.renderConfigDoctorReport,s=yield i("app",e,t),l=s.report,u=s.exitCode;r?.stop(),t.json?(0,w.GF)({...l,exitCode:u}):console.log(a(l)),0!==u&&process.exit(u)}catch(e){r?r.fail(`Config doctor failed: ${e.message}`):(0,w.OW)(e.message),process.exit(1)}}),function(e,t){return y.apply(this,arguments)})),j.command("ctor-init <id>").alias("project-init").description("Initialize a BRICKS Project from an application (deprecated: use `bricks ctor init`)").option("-o, --output <dir>","Output directory (default: current directory)").option("--github-actions","Include GitHub Actions workflow (default: true)").option("--no-github-actions","Skip GitHub Actions workflow setup").option("--agents","Include AGENTS.md (default: true)").option("--no-agents","Skip AGENTS.md setup").option("--claude","Include CLAUDE.md (default: true)").option("--no-claude","Skip CLAUDE.md setup").option("--gemini","Include GEMINI.md (default: false)").option("--no-gemini","Skip GEMINI.md setup").option("--install","Run bun install after generation (default: true)").option("--no-install","Skip bun install after generation").option("--git","Initialize git repository (default: true)").option("--no-git","Skip git initialization").option("-y, --yes","Skip prompts and use defaults/flags").option("-j, --json","Output as JSON (for programmatic use)").action((v=b(function*(e,t){t.json||console.error(_.default.yellow("Note: `bricks app ctor-init` is deprecated. Use `bricks ctor init <id>` instead."));var r=(yield Promise.all([o.e(658),o.e(456)]).then(o.bind(o,58891))).initProject;yield r("application",e,t)}),function(e,t){return v.apply(this,arguments)}))},55614(e,t,r){r.d(t,{s:()=>b});var n,i,a,s,l,u=r(99436),c=r(35679),d=r(73284),p=r(30155);let f=o("readline");var g=r(47988),h=r(7586),m=r(29988),D=e=>!!e&&"object"==typeof e&&!Array.isArray(e),y=(e={})=>{var t=D(e)?e:{},o=t.plan,r=D(o)?o:{},n=D(t.lock)?t.lock:{},i="string"==typeof o?o:r.type;return{...t,plan:{...r,type:i||"free"},lock:{...n,features:!!n.features}}},v=(n=u(function*(){var e=(0,g.getCurrentProfile)(),t=(0,g.getCurrentProfileSource)(),o=(0,g.getTokenInfo)(e),r=(0,g.getBaseUrl)();if(!o?.token)return{ok:!1,profile:e,profileSource:t,baseUrl:r,auth:{available:!1,source:"missing",workspaceId:null,workspaceName:null,createdAt:null,tokenPreview:null},workspace:null,error:null};try{var n=(0,(yield(0,m.i)()).createClient)(r,o.token),i=yield n.workspace();return{ok:!0,profile:e,profileSource:t,baseUrl:r,auth:{available:!0,source:"config",workspaceId:i?._id||o.workspaceId||null,workspaceName:i?.name||o.workspaceName||null,createdAt:o.createdAt||null,tokenPreview:(0,h.$l)(o.token)},workspace:i?{_id:i._id,name:i.name,description:i.description||null}:null,error:null}}catch(n){return{ok:!1,profile:e,profileSource:t,baseUrl:r,auth:{available:!0,source:"config",workspaceId:o.workspaceId||null,workspaceName:o.workspaceName||null,createdAt:o.createdAt||null,tokenPreview:(0,h.$l)(o.token)},workspace:null,error:{message:n.message}}}}),function(){return n.apply(this,arguments)}),b=new c.uB("auth").description("Authentication and token management");b.command("login").description("Login with a one-time passcode from BRICKS Controller (recommended)").argument("[passcode]","One-time passcode from BRICKS Controller").option("-p, --profile <profile>","Profile name to save the token").option("-n, --name <name>","Profile display name").action((i=u(function*(e,t){var o,r=t.profile||(0,g.getCurrentProfile)(),n=t.name,i=e;!i&&(console.log(d.default.cyan("Generate a one-time passcode from BRICKS Controller:")),console.log(d.default.gray(" 1. Open the link below (or select your workspace first)")),console.log(` ${d.default.underline.blue("https://control.bricks.tools/#/?action=manage-tokens")}`),console.log(d.default.gray(' 2. Click "Generate OTP" to create a one-time passcode\n')),(i=yield(o=f.createInterface({input:process.stdin,output:process.stdout}),new Promise(e=>{o.question("Enter passcode: ",t=>{o.close(),e(t.trim())})})))||(console.log(d.default.red("Passcode is required")),process.exit(1)));var a=(0,p.default)("Validating passcode...").start();try{var s=yield(0,m.i)(),l=s.createClient,u=(0,s.createPublicClient)((0,g.getBaseUrl)()),c=yield u.checkWorkspaceOTP(i);c.valid||(a.fail(`Invalid passcode: ${c.error||"Unknown error"}`),process.exit(1)),a.text=`Exchanging passcode for token (workspace: ${c.workspaceName})...`;var h=yield u.exchangeWorkspaceOTP(i);h.token||(a.fail("Failed to obtain token"),process.exit(1));var D=l((0,g.getBaseUrl)(),h.token),v=yield D.workspace();v||(a.fail("Token validation failed"),process.exit(1)),(0,g.setToken)(r,{token:h.token,name:n||v.name,workspaceId:v._id,workspaceName:v.name,workspaceBilling:y(v.billing)}),(0,g.setCurrentProfile)(r),a.succeed(`Logged in to workspace: ${d.default.green(v.name)} (profile: ${d.default.cyan(r)})`)}catch(e){a.fail(`Login failed: ${e.message}`),process.exit(1)}}),function(e,t){return i.apply(this,arguments)})),b.command("login-token").description("Login with a workspace token directly").option("-t, --token <token>","Workspace token").option("-p, --profile <profile>","Profile name to save the token").option("-n, --name <name>","Profile display name").action((a=u(function*(e){var t=e.profile||(0,g.getCurrentProfile)(),o=e.token,r=e.name;o||(console.error(d.default.red("Error: Token is required. Use -t or --token to provide it.")),console.log(d.default.gray("\nYou can get a workspace token from BRICKS Controller:")+d.default.underline.blue("https://control.bricks.tools/#/?action=manage-tokens")),console.log(` ${d.default.underline.blue("https://control.bricks.tools/#/?action=manage-tokens")}`),console.log(d.default.gray("Select your workspace and create a new token.\n")),console.log(d.default.yellow("Tip: Use `bricks auth login` for a simpler OTP-based login.")),process.exit(1));var n=(0,p.default)("Validating token...").start();try{var i=(0,(yield(0,m.i)()).createClient)((0,g.getBaseUrl)(),o),a=yield i.workspace();a||(n.fail("Invalid token or unable to access workspace"),process.exit(1)),(0,g.setToken)(t,{token:o,name:r||a.name,workspaceId:a._id,workspaceName:a.name,workspaceBilling:y(a.billing)}),(0,g.setCurrentProfile)(t),n.succeed(`Logged in to workspace: ${d.default.green(a.name)} (profile: ${d.default.cyan(t)})`)}catch(e){n.fail(`Login failed: ${e.message}`),process.exit(1)}}),function(e){return a.apply(this,arguments)})),b.command("logout").description("Remove saved token").option("-p, --profile <profile>","Profile to remove").option("-a, --all","Remove all profiles").action((s=u(function*(e){var t=e.profile;if(e.all){(0,g.listProfiles)().forEach(e=>(0,g.removeToken)(e.name)),console.log(d.default.green("All profiles removed"));return}var o=t||(0,g.getCurrentProfile)();(0,g.getTokenInfo)(o)?((0,g.removeToken)(o),console.log(d.default.green(`Logged out from profile: ${o}`))):console.log(d.default.yellow(`No token found for profile: ${o}`))}),function(e){return s.apply(this,arguments)})),b.command("status").description("Show current authentication status").option("-j, --json","Output as JSON").action((l=u(function*(e){var t=(0,g.getCurrentProfile)(),o=(0,g.getTokenInfo)(t);if(!o)return e.json?void(0,h.GF)((yield v())):(console.log(d.default.yellow("Not logged in")),void console.log(d.default.gray("Use `bricks auth login` to login")));if(e.json)return void(0,h.GF)((yield v()));var r=(0,p.default)("Checking connection...").start();try{var n=(0,(yield(0,m.i)()).createClient)((0,g.getBaseUrl)(),o.token),i=yield n.workspace();r.stop(),console.log(d.default.bold("\nAuthentication Status")),console.log("─".repeat(40)),console.log(`Profile: ${d.default.cyan(t)}`),console.log(`Workspace: ${d.default.green(i.name)}`),console.log(`Workspace ID: ${d.default.gray(i._id)}`);var a=(0,g.getBaseUrl)(),s=o.baseUrl;console.log(`Base URL: ${d.default.gray(a)}${s?"":d.default.gray(" (global)")}`),console.log(`Logged in: ${d.default.gray(o.createdAt)}`),console.log("─".repeat(40))}catch(e){r.fail(`Connection failed: ${e.message}`)}}),function(e){return l.apply(this,arguments)})),b.command("list").description("List all saved profiles").action(()=>{var e=(0,g.listProfiles)();if(0===e.length){console.log(d.default.yellow("No saved profiles")),console.log(d.default.gray("Use `bricks auth login` to login"));return}console.log(d.default.bold("\nSaved Profiles")),console.log("─".repeat(60)),e.forEach(e=>{var t=e.current?d.default.green("● "):" ",o=e.current?d.default.green(e.name):e.name,r=e.baseUrl?d.default.gray(` [${e.baseUrl}]`):"";console.log(`${t}${o.padEnd(15)} ${d.default.gray(e.workspaceName||"Unknown")}${r}`)}),console.log("─".repeat(60))}),b.command("use <profile>").description("Switch to a different profile").action(e=>{var t=(0,g.getTokenInfo)(e);if(!t){console.log(d.default.red(`Profile not found: ${e}`)),console.log(d.default.gray("Use `bricks auth list` to see available profiles"));return}(0,g.setCurrentProfile)(e),console.log(d.default.green(`Switched to profile: ${e}`)),t.workspaceName&&console.log(d.default.gray(`Workspace: ${t.workspaceName}`))}),b.command("set-url <url>").description("Set the base URL for the current profile").option("-g, --global","Set the global base URL instead of per-profile").action((e,t)=>{if(t.global)(0,g.setBaseUrl)(e),console.log(d.default.green(`Global base URL set to: ${e}`));else{var o=(0,g.getCurrentProfile)();(0,g.setBaseUrl)(e,o),console.log(d.default.green(`Base URL for profile ${d.default.cyan(o)} set to: ${e}`))}})},59845(e,t,o){o.d(t,{Q:()=>I});var r,n,i,a,s,l,u,c,d,p,f,g=o(99436),h=o(35679),m=o(73284),D=o(77598),y=o(48161),v=o(76760),b=o(51455),F=o(27549),_=o(19557),C=8089,$=(r=g(function*(e,t,o=3e3){return(0,_.uE)(`http://${e}:${t}/buttress/info`,o)}),function(e,t){return r.apply(this,arguments)}),E=v.join(y.homedir(),".bricks-cli","buttress"),w=e=>v.join(e||E,"state.json"),k=()=>{try{return`buttress-${F.machineIdSync()}`}catch{return null}},S=(n=g(function*(e){var t=w(e);try{var o=yield b.readFile(t,"utf8");return JSON.parse(o)}catch(e){if("ENOENT"===e.code)return null;throw e}}),function(e){return n.apply(this,arguments)}),x=(i=g(function*(e,t){var o=t||E,r=w(t);yield b.mkdir(o,{recursive:!0});var n=`${r}.tmp-${process.pid}`;return yield b.writeFile(n,JSON.stringify(e,null,2),"utf8"),yield b.rename(n,r),r}),function(e,t){return i.apply(this,arguments)}),O=(a=g(function*(e){var t=w(e);try{return yield b.unlink(t),!0}catch(e){if("ENOENT"===e.code)return!1;throw e}}),function(e){return a.apply(this,arguments)}),A=(s=g(function*({timeout:e=3e3,verify:t=!0,port:o=C,onStatus:r}={}){r?.(`Scanning UDP ${o} for ${e}ms...`);var n,i=yield(({timeout:e=3e3,idleTimeout:t=0,port:o=C}={})=>(0,_.YH)({port:o,timeout:e,idleTimeout:t,buildQuery:()=>Buffer.from(JSON.stringify({t:"QUERY",v:"2.0",d:{id:`cli-${(0,_.BW)()}`}})),parseMessage:(e,t)=>{var o=JSON.parse(e.toString());if("2.0"!==o.v||"ANNOUNCE"!==o.t&&"RESPONSE"!==o.t)return null;var r=o.d?.info;if(!r)return null;var n={...r,address:t.address};return{key:n.id||`${t.address}:${n.port}`,value:n}}}))({timeout:e,port:o});return 0===i.length?[]:t?(r?.(`Verifying ${i.length} server(s)...`),yield Promise.all(i.map((n=g(function*(e){var t=yield $(e.address,e.port,2e3);return t?{...e,...t,address:e.address,verified:!0}:{...e,verified:!1}}),function(e){return n.apply(this,arguments)})))):i}),function(){return s.apply(this,arguments)}),j=(l=g(function*(){var e=yield Promise.resolve().then(o.bind(o,47988)),t=e.getToken,r=e.getBaseUrl,n=e.getCurrentProfile,i=(yield Promise.all([o.e(370),o.e(785),o.e(332),o.e(209),o.e(907)]).then(o.bind(o,85382))).createClient,a=t(n());return a||(console.error(m.default.red("Not logged in. Use `bricks auth login` first.")),process.exit(1)),i(r(),a)}),function(){return l.apply(this,arguments)}),I=new h.uB("buttress").description("Pair and inspect buttress-server bindings for the current workspace").alias("butr");I.command("bind").description("Pair a local buttress-server with the current workspace").option("-s, --server-id <id>","Buttress server id (auto-detected from machine id by default)").option("-n, --name <name>","Friendly name for this buttress server").option("--state-dir <dir>","Override the buttress state directory (defaults to ~/.bricks-cli/buttress)").option("--print","Print state.json to stdout instead of writing to disk (useful for remote setups)").action((u=g(function*(e){var t,r,n,i,a,s,l=(yield Promise.resolve().then(o.bind(o,30155))).default,u=e.serverId||k();u||(console.error(m.default.red("Could not detect a local server id. Pass --server-id <id> explicitly.")),process.exit(1));var c=(r=(t=D.generateKeyPairSync("ed25519")).publicKey,n=t.privateKey,i=r.export({type:"spki",format:"der"}),a=n.export({type:"pkcs8",format:"der"}),s=D.createHash("sha256").update(i).digest("hex").slice(0,16),{publicKeySpki:i.toString("base64"),privateKeyPkcs8:a.toString("base64"),kid:s}),d=yield j(),p=l(`Binding buttress server ${m.default.cyan(u)}...`).start();try{var f=yield d.bindButtressServer({serverId:u,name:e.name,serverPublicKey:{spkiBase64:c.publicKeySpki,kid:c.kid}});p.stop();var g={workspace:{id:f.workspaceId,name:f.workspaceName,serverId:f.serverId,issuerPublicKey:f.issuerPublicKey.pem,kid:f.issuerPublicKey.kid,boundAt:new Date().toISOString()},serverKeyPair:c};if(e.print){console.warn(m.default.yellow("⚠ Output contains the server announce private key. Treat as a secret.")),process.stdout.write(`${JSON.stringify(g,null,2)}
38
+ `)),c.forEach((e,t)=>{console.log(` ${_.default.yellow(`${t+1}.`)} ${_.default.bold(e.id)}`),console.log(` ${e.data}`)})),console.log("\n"+"─".repeat(60));var d=u.schema.length+u.ref.length+u.calc.length+(u.expression?.length||0);u.valid?console.log(_.default.yellow(`⚠ ${c.length} warning(s)`)):console.log(_.default.red(`✗ ${d} error(s)`)+(c.length>0?_.default.yellow(`, ${c.length} warning(s)`):"")),u.valid||process.exit(1)}catch(e){r.fail(`Failed to validate config: ${e.message}`),process.exit(1)}}),function(e,t){return D.apply(this,arguments)})),j.command("doctor <idOrPath>").description("Diagnose an application config: schema validation plus semantic lint rules (data races, layout mistakes, dead config)").option("-j, --json","Output as JSON").option("-c, --composed","Fetch the composed configuration (remote id only)").option("--strict","Exit with code 1 when warnings are found").option("--only <codes>","Run only these rule codes (comma-separated)").option("--ignore <codes>","Skip these rule codes (comma-separated)").option("--validate-automation","Also validate automation_map and test_map references").action((y=b(function*(e,t){var r=t.json?null:(0,C.default)("Running config doctor...").start();try{var n=yield Promise.all([o.e(9866),o.e(6645),o.e(9430),o.e(1010),o.e(7511),o.e(563)]).then(o.bind(o,63322)),i=n.runConfigDoctor,a=n.renderConfigDoctorReport,s=yield i("app",e,t),l=s.report,u=s.exitCode;r?.stop(),t.json?(0,w.GF)({...l,exitCode:u}):console.log(a(l)),0!==u&&process.exit(u)}catch(e){r?r.fail(`Config doctor failed: ${e.message}`):(0,w.OW)(e.message),process.exit(1)}}),function(e,t){return y.apply(this,arguments)})),j.command("ctor-init <id>").alias("project-init").description("Initialize a BRICKS Project from an application (deprecated: use `bricks ctor init`)").option("-o, --output <dir>","Output directory (default: current directory)").option("--github-actions","Include GitHub Actions workflow (default: true)").option("--no-github-actions","Skip GitHub Actions workflow setup").option("--agents","Include AGENTS.md (default: true)").option("--no-agents","Skip AGENTS.md setup").option("--claude","Include CLAUDE.md (default: true)").option("--no-claude","Skip CLAUDE.md setup").option("--gemini","Include GEMINI.md (default: false)").option("--no-gemini","Skip GEMINI.md setup").option("--install","Run bun install after generation (default: true)").option("--no-install","Skip bun install after generation").option("--git","Initialize git repository (default: true)").option("--no-git","Skip git initialization").option("-y, --yes","Skip prompts and use defaults/flags").option("-j, --json","Output as JSON (for programmatic use)").action((v=b(function*(e,t){t.json||console.error(_.default.yellow("Note: `bricks app ctor-init` is deprecated. Use `bricks ctor init <id>` instead."));var r=(yield Promise.all([o.e(5658),o.e(4456)]).then(o.bind(o,58891))).initProject;yield r("application",e,t)}),function(e,t){return v.apply(this,arguments)}))},55614(e,t,r){r.d(t,{s:()=>b});var n,i,a,s,l,u=r(99436),c=r(35679),d=r(73284),p=r(30155);let f=o("readline");var g=r(47988),h=r(7586),m=r(29988),D=e=>!!e&&"object"==typeof e&&!Array.isArray(e),y=(e={})=>{var t=D(e)?e:{},o=t.plan,r=D(o)?o:{},n=D(t.lock)?t.lock:{},i="string"==typeof o?o:r.type;return{...t,plan:{...r,type:i||"free"},lock:{...n,features:!!n.features}}},v=(n=u(function*(){var e=(0,g.getCurrentProfile)(),t=(0,g.getCurrentProfileSource)(),o=(0,g.getTokenInfo)(e),r=(0,g.getBaseUrl)();if(!o?.token)return{ok:!1,profile:e,profileSource:t,baseUrl:r,auth:{available:!1,source:"missing",workspaceId:null,workspaceName:null,createdAt:null,tokenPreview:null},workspace:null,error:null};try{var n=(0,(yield(0,m.i)()).createClient)(r,o.token),i=yield n.workspace();return{ok:!0,profile:e,profileSource:t,baseUrl:r,auth:{available:!0,source:"config",workspaceId:i?._id||o.workspaceId||null,workspaceName:i?.name||o.workspaceName||null,createdAt:o.createdAt||null,tokenPreview:(0,h.$l)(o.token)},workspace:i?{_id:i._id,name:i.name,description:i.description||null}:null,error:null}}catch(n){return{ok:!1,profile:e,profileSource:t,baseUrl:r,auth:{available:!0,source:"config",workspaceId:o.workspaceId||null,workspaceName:o.workspaceName||null,createdAt:o.createdAt||null,tokenPreview:(0,h.$l)(o.token)},workspace:null,error:{message:n.message}}}}),function(){return n.apply(this,arguments)}),b=new c.uB("auth").description("Authentication and token management");b.command("login").description("Login with a one-time passcode from BRICKS Controller (recommended)").argument("[passcode]","One-time passcode from BRICKS Controller").option("-p, --profile <profile>","Profile name to save the token").option("-n, --name <name>","Profile display name").action((i=u(function*(e,t){var o,r=t.profile||(0,g.getCurrentProfile)(),n=t.name,i=e;!i&&(console.log(d.default.cyan("Generate a one-time passcode from BRICKS Controller:")),console.log(d.default.gray(" 1. Open the link below (or select your workspace first)")),console.log(` ${d.default.underline.blue("https://control.bricks.tools/#/?action=manage-tokens")}`),console.log(d.default.gray(' 2. Click "Generate OTP" to create a one-time passcode\n')),(i=yield(o=f.createInterface({input:process.stdin,output:process.stdout}),new Promise(e=>{o.question("Enter passcode: ",t=>{o.close(),e(t.trim())})})))||(console.log(d.default.red("Passcode is required")),process.exit(1)));var a=(0,p.default)("Validating passcode...").start();try{var s=yield(0,m.i)(),l=s.createClient,u=(0,s.createPublicClient)((0,g.getBaseUrl)()),c=yield u.checkWorkspaceOTP(i);c.valid||(a.fail(`Invalid passcode: ${c.error||"Unknown error"}`),process.exit(1)),a.text=`Exchanging passcode for token (workspace: ${c.workspaceName})...`;var h=yield u.exchangeWorkspaceOTP(i);h.token||(a.fail("Failed to obtain token"),process.exit(1));var D=l((0,g.getBaseUrl)(),h.token),v=yield D.workspace();v||(a.fail("Token validation failed"),process.exit(1)),(0,g.setToken)(r,{token:h.token,name:n||v.name,workspaceId:v._id,workspaceName:v.name,workspaceBilling:y(v.billing)}),(0,g.setCurrentProfile)(r),a.succeed(`Logged in to workspace: ${d.default.green(v.name)} (profile: ${d.default.cyan(r)})`)}catch(e){a.fail(`Login failed: ${e.message}`),process.exit(1)}}),function(e,t){return i.apply(this,arguments)})),b.command("login-token").description("Login with a workspace token directly").option("-t, --token <token>","Workspace token").option("-p, --profile <profile>","Profile name to save the token").option("-n, --name <name>","Profile display name").action((a=u(function*(e){var t=e.profile||(0,g.getCurrentProfile)(),o=e.token,r=e.name;o||(console.error(d.default.red("Error: Token is required. Use -t or --token to provide it.")),console.log(d.default.gray("\nYou can get a workspace token from BRICKS Controller:")+d.default.underline.blue("https://control.bricks.tools/#/?action=manage-tokens")),console.log(` ${d.default.underline.blue("https://control.bricks.tools/#/?action=manage-tokens")}`),console.log(d.default.gray("Select your workspace and create a new token.\n")),console.log(d.default.yellow("Tip: Use `bricks auth login` for a simpler OTP-based login.")),process.exit(1));var n=(0,p.default)("Validating token...").start();try{var i=(0,(yield(0,m.i)()).createClient)((0,g.getBaseUrl)(),o),a=yield i.workspace();a||(n.fail("Invalid token or unable to access workspace"),process.exit(1)),(0,g.setToken)(t,{token:o,name:r||a.name,workspaceId:a._id,workspaceName:a.name,workspaceBilling:y(a.billing)}),(0,g.setCurrentProfile)(t),n.succeed(`Logged in to workspace: ${d.default.green(a.name)} (profile: ${d.default.cyan(t)})`)}catch(e){n.fail(`Login failed: ${e.message}`),process.exit(1)}}),function(e){return a.apply(this,arguments)})),b.command("logout").description("Remove saved token").option("-p, --profile <profile>","Profile to remove").option("-a, --all","Remove all profiles").action((s=u(function*(e){var t=e.profile;if(e.all){(0,g.listProfiles)().forEach(e=>(0,g.removeToken)(e.name)),console.log(d.default.green("All profiles removed"));return}var o=t||(0,g.getCurrentProfile)();(0,g.getTokenInfo)(o)?((0,g.removeToken)(o),console.log(d.default.green(`Logged out from profile: ${o}`))):console.log(d.default.yellow(`No token found for profile: ${o}`))}),function(e){return s.apply(this,arguments)})),b.command("status").description("Show current authentication status").option("-j, --json","Output as JSON").action((l=u(function*(e){var t=(0,g.getCurrentProfile)(),o=(0,g.getTokenInfo)(t);if(!o)return e.json?void(0,h.GF)((yield v())):(console.log(d.default.yellow("Not logged in")),void console.log(d.default.gray("Use `bricks auth login` to login")));if(e.json)return void(0,h.GF)((yield v()));var r=(0,p.default)("Checking connection...").start();try{var n=(0,(yield(0,m.i)()).createClient)((0,g.getBaseUrl)(),o.token),i=yield n.workspace();r.stop(),console.log(d.default.bold("\nAuthentication Status")),console.log("─".repeat(40)),console.log(`Profile: ${d.default.cyan(t)}`),console.log(`Workspace: ${d.default.green(i.name)}`),console.log(`Workspace ID: ${d.default.gray(i._id)}`);var a=(0,g.getBaseUrl)(),s=o.baseUrl;console.log(`Base URL: ${d.default.gray(a)}${s?"":d.default.gray(" (global)")}`),console.log(`Logged in: ${d.default.gray(o.createdAt)}`),console.log("─".repeat(40))}catch(e){r.fail(`Connection failed: ${e.message}`)}}),function(e){return l.apply(this,arguments)})),b.command("list").description("List all saved profiles").action(()=>{var e=(0,g.listProfiles)();if(0===e.length){console.log(d.default.yellow("No saved profiles")),console.log(d.default.gray("Use `bricks auth login` to login"));return}console.log(d.default.bold("\nSaved Profiles")),console.log("─".repeat(60)),e.forEach(e=>{var t=e.current?d.default.green("● "):" ",o=e.current?d.default.green(e.name):e.name,r=e.baseUrl?d.default.gray(` [${e.baseUrl}]`):"";console.log(`${t}${o.padEnd(15)} ${d.default.gray(e.workspaceName||"Unknown")}${r}`)}),console.log("─".repeat(60))}),b.command("use <profile>").description("Switch to a different profile").action(e=>{var t=(0,g.getTokenInfo)(e);if(!t){console.log(d.default.red(`Profile not found: ${e}`)),console.log(d.default.gray("Use `bricks auth list` to see available profiles"));return}(0,g.setCurrentProfile)(e),console.log(d.default.green(`Switched to profile: ${e}`)),t.workspaceName&&console.log(d.default.gray(`Workspace: ${t.workspaceName}`))}),b.command("set-url <url>").description("Set the base URL for the current profile").option("-g, --global","Set the global base URL instead of per-profile").action((e,t)=>{if(t.global)(0,g.setBaseUrl)(e),console.log(d.default.green(`Global base URL set to: ${e}`));else{var o=(0,g.getCurrentProfile)();(0,g.setBaseUrl)(e,o),console.log(d.default.green(`Base URL for profile ${d.default.cyan(o)} set to: ${e}`))}})},59845(e,t,o){o.d(t,{Q:()=>I});var r,n,i,a,s,l,u,c,d,p,f,g=o(99436),h=o(35679),m=o(73284),D=o(77598),y=o(48161),v=o(76760),b=o(51455),F=o(27549),_=o(19557),C=8089,$=(r=g(function*(e,t,o=3e3){return(0,_.uE)(`http://${e}:${t}/buttress/info`,o)}),function(e,t){return r.apply(this,arguments)}),E=v.join(y.homedir(),".bricks-cli","buttress"),w=e=>v.join(e||E,"state.json"),k=()=>{try{return`buttress-${F.machineIdSync()}`}catch{return null}},S=(n=g(function*(e){var t=w(e);try{var o=yield b.readFile(t,"utf8");return JSON.parse(o)}catch(e){if("ENOENT"===e.code)return null;throw e}}),function(e){return n.apply(this,arguments)}),x=(i=g(function*(e,t){var o=t||E,r=w(t);yield b.mkdir(o,{recursive:!0});var n=`${r}.tmp-${process.pid}`;return yield b.writeFile(n,JSON.stringify(e,null,2),"utf8"),yield b.rename(n,r),r}),function(e,t){return i.apply(this,arguments)}),O=(a=g(function*(e){var t=w(e);try{return yield b.unlink(t),!0}catch(e){if("ENOENT"===e.code)return!1;throw e}}),function(e){return a.apply(this,arguments)}),A=(s=g(function*({timeout:e=3e3,verify:t=!0,port:o=C,onStatus:r}={}){r?.(`Scanning UDP ${o} for ${e}ms...`);var n,i=yield(({timeout:e=3e3,idleTimeout:t=0,port:o=C}={})=>(0,_.YH)({port:o,timeout:e,idleTimeout:t,buildQuery:()=>Buffer.from(JSON.stringify({t:"QUERY",v:"2.0",d:{id:`cli-${(0,_.BW)()}`}})),parseMessage:(e,t)=>{var o=(0,_.nl)(e,e=>e?.v==="2.0");if(!o)return null;var r={...o,address:t.address};return{key:r.id||`${t.address}:${r.port}`,value:r}}}))({timeout:e,port:o});return 0===i.length?[]:t?(r?.(`Verifying ${i.length} server(s)...`),yield Promise.all(i.map((n=g(function*(e){var t=yield $(e.address,e.port,2e3);return t?{...e,...t,address:e.address,verified:!0}:{...e,verified:!1}}),function(e){return n.apply(this,arguments)})))):i}),function(){return s.apply(this,arguments)}),j=(l=g(function*(){var e=yield Promise.resolve().then(o.bind(o,47988)),t=e.getToken,r=e.getBaseUrl,n=e.getCurrentProfile,i=(yield Promise.all([o.e(6370),o.e(5785),o.e(3332),o.e(2209),o.e(907)]).then(o.bind(o,85382))).createClient,a=t(n());return a||(console.error(m.default.red("Not logged in. Use `bricks auth login` first.")),process.exit(1)),i(r(),a)}),function(){return l.apply(this,arguments)}),I=new h.uB("buttress").description("Pair and inspect buttress-server bindings for the current workspace").alias("butr");I.command("bind").description("Pair a local buttress-server with the current workspace").option("-s, --server-id <id>","Buttress server id (auto-detected from machine id by default)").option("-n, --name <name>","Friendly name for this buttress server").option("--state-dir <dir>","Override the buttress state directory (defaults to ~/.bricks-cli/buttress)").option("--print","Print state.json to stdout instead of writing to disk (useful for remote setups)").action((u=g(function*(e){var t,r,n,i,a,s,l=(yield Promise.resolve().then(o.bind(o,30155))).default,u=e.serverId||k();u||(console.error(m.default.red("Could not detect a local server id. Pass --server-id <id> explicitly.")),process.exit(1));var c=(r=(t=D.generateKeyPairSync("ed25519")).publicKey,n=t.privateKey,i=r.export({type:"spki",format:"der"}),a=n.export({type:"pkcs8",format:"der"}),s=D.createHash("sha256").update(i).digest("hex").slice(0,16),{publicKeySpki:i.toString("base64"),privateKeyPkcs8:a.toString("base64"),kid:s}),d=yield j(),p=l(`Binding buttress server ${m.default.cyan(u)}...`).start();try{var f=yield d.bindButtressServer({serverId:u,name:e.name,serverPublicKey:{spkiBase64:c.publicKeySpki,kid:c.kid}});p.stop();var g={workspace:{id:f.workspaceId,name:f.workspaceName,serverId:f.serverId,issuerPublicKey:f.issuerPublicKey.pem,kid:f.issuerPublicKey.kid,boundAt:new Date().toISOString()},serverKeyPair:c};if(e.print){console.warn(m.default.yellow("⚠ Output contains the server announce private key. Treat as a secret.")),process.stdout.write(`${JSON.stringify(g,null,2)}
39
39
  `);return}var h=yield x(g,e.stateDir);console.log(m.default.green("✓"),"Buttress server bound to workspace."),console.log(` Workspace: ${m.default.bold(f.workspaceName)} (${f.workspaceId})`),console.log(` Server id: ${m.default.cyan(f.serverId)}`),console.log(` Issuer kid: ${m.default.gray(f.issuerPublicKey.kid)}`),console.log(` Announce kid: ${m.default.gray(c.kid)}`),console.log(` State file: ${m.default.gray(h)}`),console.log(),console.log(m.default.yellow("Restart buttress-server for the binding to take effect."))}catch(e){p.fail(`Bind failed: ${e.message}`),process.exit(1)}}),function(e){return u.apply(this,arguments)})),I.command("unbind").description("Unbind a buttress server from this workspace").option("-s, --server-id <id>","Buttress server id (auto-detected by default)").option("--state-dir <dir>","Override the buttress state directory").option("--keep-local","Do not remove the local state.json file").action((c=g(function*(e){var t=e.serverId||k();t||(console.error(m.default.red("Could not detect a local server id. Pass --server-id explicitly.")),process.exit(1));var o=yield j();try{if((yield o.unbindButtressServer({serverId:t}))?console.log(m.default.green("✓"),`Unbound ${m.default.cyan(t)} from workspace.`):console.log(m.default.yellow("!"),`${m.default.cyan(t)} was not bound to this workspace.`),!e.keepLocal){var r=w(e.stateDir),n=yield S(e.stateDir);n?.workspace?.serverId===t&&(yield O(e.stateDir),console.log(m.default.gray(`Removed local state file: ${r}`)))}}catch(e){console.error(m.default.red(`Unbind failed: ${e.message}`)),process.exit(1)}}),function(e){return c.apply(this,arguments)})),I.command("status").description("Show local buttress binding state and the workspace-side bound list").option("--state-dir <dir>","Override the buttress state directory").option("-j, --json","Output as JSON").action((d=g(function*(e){var t=yield S(e.stateDir),o=null;try{var r=yield j();o=yield r.buttressServers()}catch(e){o={error:e.message}}e.json?console.log(JSON.stringify({local:t,remote:o},null,2)):(console.log(m.default.bold("\nLocal buttress state")),console.log("─".repeat(60)),t?.workspace?(console.log(` Workspace: ${m.default.bold(t.workspace.name)} (${t.workspace.id})`),console.log(` Server id: ${m.default.cyan(t.workspace.serverId)}`),console.log(` Issuer kid: ${m.default.gray(t.workspace.kid)}`),console.log(` Bound at: ${m.default.gray(t.workspace.boundAt)}`),console.log(` File: ${m.default.gray(w(e.stateDir))}`)):console.log(m.default.gray(" not bound (no state.json found)")),console.log(m.default.bold("\nWorkspace-side bound servers")),console.log("─".repeat(60)),Array.isArray(o)?0===o.length?console.log(m.default.gray(" none")):o.forEach(e=>{console.log(` ${m.default.cyan(e.serverId)} ${m.default.gray(e.name||"")} ${m.default.gray(e.boundAt||"")}`)}):o?.error&&console.log(m.default.red(` failed to fetch: ${o.error}`)))}),function(e){return d.apply(this,arguments)})),I.command("issue-token").description("Issue a long-lived workspace-scoped buttress access token (CLI/CTOR usage)").option("--ttl <seconds>","Time-to-live in seconds (default 30 days)",e=>parseInt(e,10)).option("-j, --json","Output as JSON").action((p=g(function*(e){var t=yield j();try{var o=yield t.issueButtressAccessToken({ttlSeconds:e.ttl});if(e.json)return void console.log(JSON.stringify(o,null,2));console.log(m.default.green("✓"),"Buttress access token issued."),console.log(` Workspace: ${o.workspaceId}`),console.log(` Expires: ${o.expiresAt}`),console.log(` jti: ${m.default.gray(o.jti)}`),console.log(),console.log(m.default.cyan(o.token))}catch(e){console.error(m.default.red(`Issue token failed: ${e.message}`)),process.exit(1)}}),function(e){return p.apply(this,arguments)})),I.command("scan").description("Scan LAN for buttress-servers via UDP and verify each via /buttress/info").option("-t, --timeout <ms>","Scan timeout in milliseconds","3000").option("-p, --port <port>","UDP discovery port",String(C)).option("--udp-only","Skip HTTP /buttress/info verification").option("-j, --json","Output as JSON").action((f=g(function*(e){var t=(yield Promise.resolve().then(o.bind(o,30155))).default,r=yield Promise.resolve().then(o.bind(o,47988)),n=r.getCurrentProfile,i=r.getTokenInfo,a=parseInt(e.timeout,10),s=parseInt(e.port,10),l=[],u=t(`Scanning for buttress-servers (${a}ms)...`).start();try{l=yield A({timeout:a,port:s,verify:!e.udpOnly,onStatus:e=>{u.text=e}}),u.stop()}catch(e){u.fail(`Scan failed: ${e.message}`),process.exit(1)}var c=n(),d=i(c)?.workspaceId||null;if(e.json)return void console.log(JSON.stringify({servers:l,workspaceId:d},null,2));if(0===l.length)return void console.log(m.default.yellow("No buttress-servers found on the LAN."));for(var p of(console.log(m.default.bold(`
40
- Found ${l.length} buttress-server(s)`)),console.log("─".repeat(70)),l)){var f=!1===p.verified?m.default.red("unverified"):m.default.green("online"),g=p.workspace?.id,h=g&&d&&g===d,D=p.authentication?.bound?m.default.yellow("JWT required"):m.default.gray("open");console.log(` ${m.default.bold(p.name||"Unknown")} ${m.default.gray(`(${p.address}:${p.port})`)} [${f}]`),p.id&&console.log(` Server id: ${m.default.cyan(p.id)}`),p.version&&console.log(` Version: ${m.default.green(p.version)}`);var y=p.authentication?.kid?m.default.gray(` (kid: ${p.authentication.kid})`):"";if(console.log(` Auth: ${D}${y}`),g){var v=h?m.default.green(`${g} ${m.default.bold("(current profile)")}`):m.default.gray(g);console.log(` Workspace: ${v}`)}if(Array.isArray(p.generators)&&p.generators.length>0)for(var b of(console.log(" Generators:"),p.generators)){var F=[];"number"==typeof b.score&&F.push(`score ${b.score.toFixed(1)}`),!0===b.hasGpu?F.push("GPU ✓"):!1===b.hasGpu&&F.push("GPU ✗"),"number"==typeof b.usableBytes&&F.push(`${(b.usableBytes/0x40000000).toFixed(1)} GB usable`);var _=F.length>0?` ${m.default.gray(F.join(" "))}`:"";console.log(` - ${m.default.cyan(b.type)}${_}`)}}console.log("─".repeat(70)),l.some(e=>e.authentication?.bound)&&(console.log(),console.log(m.default.gray("To connect to a bound server, run `bricks buttress issue-token` for a workspace access token.")))}),function(e){return f.apply(this,arguments)}))},71335(e,t,o){o.d(t,{oT:()=>c});var r=o(35679),n=o(73284),i=o(47988),a={prod:"https://display.bricks.tools",beta:"https://display-beta.bricks.tools",dev:"http://localhost:3001"},s=e=>{var t=Object.entries(a).find(([,t])=>e===t);return t?t[0]:null},l={prod:"https://activity-log.bricks.tools",beta:"https://activity-log-beta.bricks.tools",dev:"http://localhost:8088"},u=e=>{var t=Object.entries(l).find(([,t])=>e===t);return t?t[0]:null},c=new r.uB("config").description("CLI configuration management");c.command("endpoint").argument("[environment]","Environment to use (prod, beta, dev)").description("Show or set endpoint environment").option("-p, --profile","Set for current profile instead of global").action((e,t)=>{if(!e){var o=(0,i.getBaseUrl)(),r=s(o),c=(0,i.getActivityLogBaseUrl)(),d=u(c);console.log(n.default.bold("\nEndpoint Configuration")),console.log("─".repeat(50)),console.log(n.default.bold("BRICKS")),console.log(` URL: ${n.default.cyan(o)}`),console.log(` Environment: ${r?n.default.green(r):n.default.yellow("custom")}`),console.log(n.default.bold("Activity Log")),console.log(` URL: ${n.default.cyan(c)}`),console.log(` Environment: ${d?n.default.green(d):n.default.yellow("custom")}`),console.log("─".repeat(50)),console.log(n.default.gray("\nUsage: bricks config endpoint <prod|beta|dev>"));return}var p=Object.keys(a);p.includes(e)||(console.error(n.default.red(`Invalid environment: ${e}`)),console.log(n.default.gray(`Valid options: ${p.join(", ")}`)),process.exit(1));var f=a[e],g=l[e],h=t.profile?(0,i.getCurrentProfile)():null;(0,i.setBaseUrl)(f,h),(0,i.setActivityLogBaseUrl)(g,h);var m=t.profile?` (profile: ${(0,i.getCurrentProfile)()})`:"";console.log(n.default.green(`✓ Endpoint changed to ${e}${m}`)),console.log(n.default.gray(` BRICKS: ${f}`)),console.log(n.default.gray(` Activity Log: ${g}`)),console.log(n.default.yellow("\nNote: You may need to re-authenticate if your token is for a different environment.")),console.log(n.default.gray("Use `bricks auth status` to check your connection."))}),c.command("show").description("Show current configuration").option("-j, --json","Output as JSON").action(e=>{var t=(0,i.getBaseUrl)(),o=s(t);if(e.json)return void console.log(JSON.stringify({endpoint:t,environment:o||"custom"},null,2));console.log(n.default.bold("\nBRICKS CLI Configuration")),console.log("─".repeat(50)),console.log(`BRICKS: ${n.default.cyan(t)}`),o?console.log(`Environment: ${n.default.green(o)}`):console.log(`Environment: ${n.default.yellow("custom")}`);var r=(0,i.getActivityLogBaseUrl)(),a=u(r);console.log(`Activity Log: ${n.default.cyan(r)} ${a?n.default.green(`(${a})`):n.default.yellow("(custom)")}`),console.log("─".repeat(50))})},22175(e,t,o){o.d(t,{g:()=>g});var r,n,i,a,s,l,u,c,d=o(99436),p=o(35679),f=o(73284),g=new p.uB("ctor").description("BRICKS Project (ctor) tooling: scaffold, sync, compile, deploy, and serve the project"),h=e=>{console.error(f.default.red(e?.message||String(e))),process.exit(1)};g.command("init <id>").description("Initialize a BRICKS Project from an application or module").option("--type <type>","Project type: app or module","app").option("-o, --output <dir>","Output directory (default: current directory)").option("--github-actions","Include GitHub Actions workflow (default: true)").option("--no-github-actions","Skip GitHub Actions workflow setup").option("--agents","Include AGENTS.md (default: true)").option("--no-agents","Skip AGENTS.md setup").option("--claude","Include CLAUDE.md (default: true)").option("--no-claude","Skip CLAUDE.md setup").option("--gemini","Include GEMINI.md (default: false)").option("--no-gemini","Skip GEMINI.md setup").option("--install","Run bun install after generation (default: true)").option("--no-install","Skip bun install after generation").option("--git","Initialize git repository (default: true)").option("--no-git","Skip git initialization").option("-y, --yes","Skip prompts and use defaults/flags").option("-j, --json","Output as JSON (for programmatic use)").action((r=d(function*(e,t){var r="module"===t.type?"module":"application",n=(yield Promise.all([o.e(658),o.e(456)]).then(o.bind(o,58891))).initProject;yield n(r,e,t)}),function(e,t){return r.apply(this,arguments)})),g.command("postinstall").description("Regenerate the ctor/ library, MCP config, and skills (run from a project)").option("--skip-copy-project","Skip copying the ctor/ library into the project").option("--refresh-skills","Also overwrite bundled skill files whose content changed (default keeps existing skills)").option("--check","Compare the bundled ctor/skills assets against the project without writing (always exits 0; read the output)").option("-j, --json","With --check, output the comparison as JSON").action((n=d(function*(e){try{if(e.check){var t=(yield Promise.all([o.e(111),o.e(708)]).then(o.bind(o,37495))).checkProjectAssets,r=yield t();if(e.json)return void console.log(JSON.stringify(r,null,2));if(r.upToDate)return void console.log(`Project assets match the bundled snapshot (CLI ${r.cliVersion}).`);var n=(e,{changed:t,missing:o})=>{if(t.length||o.length){for(var r of(console.log(`${e}: ${t.length} changed, ${o.length} missing`),t))console.log(` ~ ${r}`);for(var n of o)console.log(` + ${n}`)}};console.log(`Project assets differ from the bundled snapshot (CLI ${r.cliVersion}):`),n("ctor/",r.lib),n("skills",r.skills),console.log("Run `bricks ctor postinstall --refresh-skills` to update them.");return}var i=(yield Promise.all([o.e(111),o.e(708)]).then(o.bind(o,37495))).postinstall;yield i(e)}catch(e){h(e)}}),function(e){return n.apply(this,arguments)})),g.command("pull").description("Pull the latest project files from BRICKS (3-way git merge)").option("-f, --force","Force pull, committing any unstaged changes first").action((i=d(function*(e){try{var t=(yield o.e(663).then(o.bind(o,47090))).pull;yield t(e)}catch(e){h(e)}}),function(e){return i.apply(this,arguments)})),g.command("push").description("Compile and push config to BRICKS without creating a release").option("--auto-commit","Auto-commit unstaged changes before pushing").option("--no-check","Skip the conflict guard (don't pass --last-commit-id)").option("--no-validate","Skip server-side config schema validation").option("-y, --yes","Skip all prompts").action((a=d(function*(e){try{var t=(yield Promise.all([o.e(645),o.e(648),o.e(358),o.e(917),o.e(915)]).then(o.bind(o,88046))).compile,r=(yield o.e(557).then(o.bind(o,71772))).push;yield t({check:!0}),yield r(e)}catch(e){h(e)}}),function(e){return a.apply(this,arguments)})),g.command("deploy").description("Compile and release the project to BRICKS").option("--changelogs <text>","Changelogs text for the release").option("--changelogs-file <path>","Read changelogs from a file").option("--auto-commit","Auto-commit unstaged changes before deploying").option("--auto-version","Auto-bump patch version before deploying").option("--version <version>","Set explicit version for the release").option("-y, --yes","Skip all prompts").action((s=d(function*(e){try{var t=(yield Promise.all([o.e(645),o.e(648),o.e(358),o.e(917),o.e(915)]).then(o.bind(o,88046))).compile,r=(yield o.e(215).then(o.bind(o,42914))).deploy;yield t({check:!0}),yield r(e)}catch(e){h(e)}}),function(e){return s.apply(this,arguments)})),g.command("compile").description("Typecheck and build the project config").option("--no-check","Skip the typecheck preflight").action((l=d(function*(e){try{var t=(yield Promise.all([o.e(645),o.e(648),o.e(358),o.e(917),o.e(915)]).then(o.bind(o,88046))).compile;yield t(e)}catch(e){h(e)}}),function(e){return l.apply(this,arguments)})),g.command("simulator").description("Run the BRICKS web-preview simulator for the project").allowUnknownOption(!0).helpOption(!1).action((u=d(function*(e,t){try{var r=(yield o.e(320).then(o.bind(o,7931))).simulator;yield r(t.args)}catch(e){h(e)}}),function(e,t){return u.apply(this,arguments)})),g.command("mcp").description("Start the project-local bricks-ctor MCP server (STDIO)").option("--project <dir>","Project root (default: current directory)").action((c=d(function*(e){try{var t=(yield Promise.all([o.e(866),o.e(785),o.e(192),o.e(358),o.e(479),o.e(274)]).then(o.bind(o,75641))).startCtorMcpServer;yield t(e.project)}catch(e){h(e)}}),function(e){return c.apply(this,arguments)}))},55609(e,t,o){o.d(t,{E:()=>W});var r,n,i,a,s,l,u,c,d,p,f,g,h,m,D,y,v,b,F,_=o(68832),C=o(99436),$=o(79896),E=o(35679),w=o(73284),k=o(7586),S=o(56493),x=o(8479),O=o(47988),A=o(31596),j=o(98593),I=(r=C(function*(){return(yield Promise.resolve().then(o.bind(o,30155))).default}),function(){return r.apply(this,arguments)}),B=(n=C(function*(e,t){return e.json?null:(yield I())(t).start()}),function(e,t){return n.apply(this,arguments)}),N=(i=C(function*(){return o.e(658).then(o.bind(o,27521))}),function(){return i.apply(this,arguments)}),P=(a=C(function*(){return o.e(936).then(o.bind(o,76627))}),function(){return a.apply(this,arguments)}),T=(s=C(function*(){return Promise.all([o.e(370),o.e(785),o.e(387)]).then(o.bind(o,30182))}),function(){return s.apply(this,arguments)}),R=(l=C(function*({message:e,autoYes:t,json:o}){if(t)return!0;if(o)throw Error("Confirmation required: pass -y/--yes together with --json");if(!(0,x.isInteractiveTerminal)())throw Error("Refusing to prompt in a non-interactive shell. Pass -y/--yes to confirm.");try{var r=(yield N()).confirm;return yield r({message:e,default:!1})}catch{return!1}}),function(e){return l.apply(this,arguments)}),M=({spinner:e,error:t,options:o,action:r,target:n})=>{var i=t.message;i?.includes(A.GE)?i=`${A.GE} Run \`bricks data enable\` first.`:t.isBankAuthError&&(i=`${i}
40
+ Found ${l.length} buttress-server(s)`)),console.log("─".repeat(70)),l)){var f=!1===p.verified?m.default.red("unverified"):m.default.green("online"),g=p.workspace?.id,h=g&&d&&g===d,D=p.authentication?.bound?m.default.yellow("JWT required"):m.default.gray("open");console.log(` ${m.default.bold(p.name||"Unknown")} ${m.default.gray(`(${p.address}:${p.port})`)} [${f}]`),p.id&&console.log(` Server id: ${m.default.cyan(p.id)}`),p.version&&console.log(` Version: ${m.default.green(p.version)}`);var y=p.authentication?.kid?m.default.gray(` (kid: ${p.authentication.kid})`):"";if(console.log(` Auth: ${D}${y}`),g){var v=h?m.default.green(`${g} ${m.default.bold("(current profile)")}`):m.default.gray(g);console.log(` Workspace: ${v}`)}if(Array.isArray(p.generators)&&p.generators.length>0)for(var b of(console.log(" Generators:"),p.generators)){var F=[];"number"==typeof b.score&&F.push(`score ${b.score.toFixed(1)}`),!0===b.hasGpu?F.push("GPU ✓"):!1===b.hasGpu&&F.push("GPU ✗"),"number"==typeof b.usableBytes&&F.push(`${(b.usableBytes/0x40000000).toFixed(1)} GB usable`);var _=F.length>0?` ${m.default.gray(F.join(" "))}`:"";console.log(` - ${m.default.cyan(b.type)}${_}`)}}console.log("─".repeat(70)),l.some(e=>e.authentication?.bound)&&(console.log(),console.log(m.default.gray("To connect to a bound server, run `bricks buttress issue-token` for a workspace access token.")))}),function(e){return f.apply(this,arguments)}))},71335(e,t,o){o.d(t,{oT:()=>c});var r=o(35679),n=o(73284),i=o(47988),a={prod:"https://display.bricks.tools",beta:"https://display-beta.bricks.tools",dev:"http://localhost:3001"},s=e=>{var t=Object.entries(a).find(([,t])=>e===t);return t?t[0]:null},l={prod:"https://activity-log.bricks.tools",beta:"https://activity-log-beta.bricks.tools",dev:"http://localhost:8088"},u=e=>{var t=Object.entries(l).find(([,t])=>e===t);return t?t[0]:null},c=new r.uB("config").description("CLI configuration management");c.command("endpoint").argument("[environment]","Environment to use (prod, beta, dev)").description("Show or set endpoint environment").option("-p, --profile","Set for current profile instead of global").action((e,t)=>{if(!e){var o=(0,i.getBaseUrl)(),r=s(o),c=(0,i.getActivityLogBaseUrl)(),d=u(c);console.log(n.default.bold("\nEndpoint Configuration")),console.log("─".repeat(50)),console.log(n.default.bold("BRICKS")),console.log(` URL: ${n.default.cyan(o)}`),console.log(` Environment: ${r?n.default.green(r):n.default.yellow("custom")}`),console.log(n.default.bold("Activity Log")),console.log(` URL: ${n.default.cyan(c)}`),console.log(` Environment: ${d?n.default.green(d):n.default.yellow("custom")}`),console.log("─".repeat(50)),console.log(n.default.gray("\nUsage: bricks config endpoint <prod|beta|dev>"));return}var p=Object.keys(a);p.includes(e)||(console.error(n.default.red(`Invalid environment: ${e}`)),console.log(n.default.gray(`Valid options: ${p.join(", ")}`)),process.exit(1));var f=a[e],g=l[e],h=t.profile?(0,i.getCurrentProfile)():null;(0,i.setBaseUrl)(f,h),(0,i.setActivityLogBaseUrl)(g,h);var m=t.profile?` (profile: ${(0,i.getCurrentProfile)()})`:"";console.log(n.default.green(`✓ Endpoint changed to ${e}${m}`)),console.log(n.default.gray(` BRICKS: ${f}`)),console.log(n.default.gray(` Activity Log: ${g}`)),console.log(n.default.yellow("\nNote: You may need to re-authenticate if your token is for a different environment.")),console.log(n.default.gray("Use `bricks auth status` to check your connection."))}),c.command("show").description("Show current configuration").option("-j, --json","Output as JSON").action(e=>{var t=(0,i.getBaseUrl)(),o=s(t);if(e.json)return void console.log(JSON.stringify({endpoint:t,environment:o||"custom"},null,2));console.log(n.default.bold("\nBRICKS CLI Configuration")),console.log("─".repeat(50)),console.log(`BRICKS: ${n.default.cyan(t)}`),o?console.log(`Environment: ${n.default.green(o)}`):console.log(`Environment: ${n.default.yellow("custom")}`);var r=(0,i.getActivityLogBaseUrl)(),a=u(r);console.log(`Activity Log: ${n.default.cyan(r)} ${a?n.default.green(`(${a})`):n.default.yellow("(custom)")}`),console.log("─".repeat(50))})},22175(e,t,o){o.d(t,{g:()=>g});var r,n,i,a,s,l,u,c,d=o(99436),p=o(35679),f=o(73284),g=new p.uB("ctor").description("BRICKS Project (ctor) tooling: scaffold, sync, compile, deploy, and serve the project"),h=e=>{console.error(f.default.red(e?.message||String(e))),process.exit(1)};g.command("init <id>").description("Initialize a BRICKS Project from an application or module").option("--type <type>","Project type: app or module","app").option("-o, --output <dir>","Output directory (default: current directory)").option("--github-actions","Include GitHub Actions workflow (default: true)").option("--no-github-actions","Skip GitHub Actions workflow setup").option("--agents","Include AGENTS.md (default: true)").option("--no-agents","Skip AGENTS.md setup").option("--claude","Include CLAUDE.md (default: true)").option("--no-claude","Skip CLAUDE.md setup").option("--gemini","Include GEMINI.md (default: false)").option("--no-gemini","Skip GEMINI.md setup").option("--install","Run bun install after generation (default: true)").option("--no-install","Skip bun install after generation").option("--git","Initialize git repository (default: true)").option("--no-git","Skip git initialization").option("-y, --yes","Skip prompts and use defaults/flags").option("-j, --json","Output as JSON (for programmatic use)").action((r=d(function*(e,t){var r="module"===t.type?"module":"application",n=(yield Promise.all([o.e(5658),o.e(4456)]).then(o.bind(o,58891))).initProject;yield n(r,e,t)}),function(e,t){return r.apply(this,arguments)})),g.command("postinstall").description("Regenerate the ctor/ library, MCP config, and skills (run from a project)").option("--skip-copy-project","Skip copying the ctor/ library into the project").option("--refresh-skills","Also overwrite bundled skill files whose content changed (default keeps existing skills)").option("--check","Compare the bundled ctor/skills assets against the project without writing (always exits 0; read the output)").option("-j, --json","With --check, output the comparison as JSON").action((n=d(function*(e){try{if(e.check){var t=(yield Promise.all([o.e(7111),o.e(1708)]).then(o.bind(o,37495))).checkProjectAssets,r=yield t();if(e.json)return void console.log(JSON.stringify(r,null,2));if(r.upToDate)return void console.log(`Project assets match the bundled snapshot (CLI ${r.cliVersion}).`);var n=(e,{changed:t,missing:o})=>{if(t.length||o.length){for(var r of(console.log(`${e}: ${t.length} changed, ${o.length} missing`),t))console.log(` ~ ${r}`);for(var n of o)console.log(` + ${n}`)}};console.log(`Project assets differ from the bundled snapshot (CLI ${r.cliVersion}):`),n("ctor/",r.lib),n("skills",r.skills),console.log("Run `bricks ctor postinstall --refresh-skills` to update them.");return}var i=(yield Promise.all([o.e(7111),o.e(1708)]).then(o.bind(o,37495))).postinstall;yield i(e)}catch(e){h(e)}}),function(e){return n.apply(this,arguments)})),g.command("pull").description("Pull the latest project files from BRICKS (3-way git merge)").option("-f, --force","Force pull, committing any unstaged changes first").action((i=d(function*(e){try{var t=(yield o.e(9663).then(o.bind(o,47090))).pull;yield t(e)}catch(e){h(e)}}),function(e){return i.apply(this,arguments)})),g.command("push").description("Compile and push config to BRICKS without creating a release").option("--auto-commit","Auto-commit unstaged changes before pushing").option("--no-check","Skip the conflict guard (don't pass --last-commit-id)").option("--no-validate","Skip server-side config schema validation").option("-y, --yes","Skip all prompts").action((a=d(function*(e){try{var t=(yield Promise.all([o.e(6645),o.e(2151),o.e(7648),o.e(8026),o.e(915)]).then(o.bind(o,88046))).compile,r=(yield o.e(2557).then(o.bind(o,71772))).push;yield t({check:!0}),yield r(e)}catch(e){h(e)}}),function(e){return a.apply(this,arguments)})),g.command("deploy").description("Compile and release the project to BRICKS").option("--changelogs <text>","Changelogs text for the release").option("--changelogs-file <path>","Read changelogs from a file").option("--auto-commit","Auto-commit unstaged changes before deploying").option("--auto-version","Auto-bump patch version before deploying").option("--version <version>","Set explicit version for the release").option("-y, --yes","Skip all prompts").action((s=d(function*(e){try{var t=(yield Promise.all([o.e(6645),o.e(2151),o.e(7648),o.e(8026),o.e(915)]).then(o.bind(o,88046))).compile,r=(yield o.e(1215).then(o.bind(o,42914))).deploy;yield t({check:!0}),yield r(e)}catch(e){h(e)}}),function(e){return s.apply(this,arguments)})),g.command("compile").description("Typecheck and build the project config").option("--no-check","Skip the typecheck preflight").action((l=d(function*(e){try{var t=(yield Promise.all([o.e(6645),o.e(2151),o.e(7648),o.e(8026),o.e(915)]).then(o.bind(o,88046))).compile;yield t(e)}catch(e){h(e)}}),function(e){return l.apply(this,arguments)})),g.command("simulator").description("Run the BRICKS web-preview simulator for the project").allowUnknownOption(!0).helpOption(!1).action((u=d(function*(e,t){try{var r=(yield o.e(9320).then(o.bind(o,7931))).simulator;yield r(t.args)}catch(e){h(e)}}),function(e,t){return u.apply(this,arguments)})),g.command("mcp").description("Start the project-local bricks-ctor MCP server (STDIO)").option("--project <dir>","Project root (default: current directory)").action((c=d(function*(e){try{var t=(yield Promise.all([o.e(9866),o.e(4479),o.e(4685),o.e(6194)]).then(o.bind(o,95417))).startCtorMcpServer;yield t(e.project)}catch(e){h(e)}}),function(e){return c.apply(this,arguments)}))},55609(e,t,o){o.d(t,{E:()=>W});var r,n,i,a,s,l,u,c,d,p,f,g,h,m,D,y,v,b,F,_=o(68832),C=o(99436),$=o(79896),E=o(35679),w=o(73284),k=o(7586),S=o(56493),x=o(8479),O=o(47988),A=o(31596),j=o(98593),I=(r=C(function*(){return(yield Promise.resolve().then(o.bind(o,30155))).default}),function(){return r.apply(this,arguments)}),B=(n=C(function*(e,t){return e.json?null:(yield I())(t).start()}),function(e,t){return n.apply(this,arguments)}),N=(i=C(function*(){return o.e(5658).then(o.bind(o,27521))}),function(){return i.apply(this,arguments)}),P=(a=C(function*(){return o.e(1936).then(o.bind(o,76627))}),function(){return a.apply(this,arguments)}),T=(s=C(function*(){return Promise.all([o.e(6370),o.e(5785),o.e(9387)]).then(o.bind(o,30182))}),function(){return s.apply(this,arguments)}),R=(l=C(function*({message:e,autoYes:t,json:o}){if(t)return!0;if(o)throw Error("Confirmation required: pass -y/--yes together with --json");if(!(0,x.isInteractiveTerminal)())throw Error("Refusing to prompt in a non-interactive shell. Pass -y/--yes to confirm.");try{var r=(yield N()).confirm;return yield r({message:e,default:!1})}catch{return!1}}),function(e){return l.apply(this,arguments)}),M=({spinner:e,error:t,options:o,action:r,target:n})=>{var i=t.message;i?.includes(A.GE)?i=`${A.GE} Run \`bricks data enable\` first.`:t.isBankAuthError&&(i=`${i}
41
41
  The Data Bank key may be invalid or revoked — run \`bricks data login\` to reissue.`),o.json?(0,k.OW)(i,{action:r,...n&&{target:n}}):e?e.fail(i):console.error(w.default.red(i)),process.exit(1)},U=e=>{try{return JSON.parse(e)}catch{return e}},J=(e,t)=>{try{return JSON.parse(e)}catch{throw Error(`Invalid JSON for ${t}`)}},L=e=>e.split(",").map(e=>e.trim()).filter(Boolean),q=e=>({name:e.name,meta:e.meta,value:(0,k.$l)(e.value),enableExpired:!!e.enableExpired,expiredAt:e.expiredAt||null,createAt:e.createAt||null,hasReadLimit:!!e.limitedReadProperties?.length,hasWriteLimit:!!e.limitedWriteProperties?.length}),G=(u=C(function*(e){var t=yield e.workspace();return t?.bank||{}}),function(e){return u.apply(this,arguments)}),V=(c=C(function*(e){var t=(yield P()).resolveBankCredentials,o=yield T(),r=o.createBankClient,n=o.resolveBankEndpoint,i=yield t(e);return r({endpoint:n((0,O.getBaseUrl)()),spacename:i.spacename,spacekey:i.spacekey})}),function(e){return c.apply(this,arguments)}),W=new E.uB("data").description("Data Bank (remote properties) management");W.command("status").description("Show Data Bank status for this workspace").option("-j, --json","Output as JSON").action((d=C(function*(e){var t=(0,S.requireAuth)(),o=yield B(e,"Fetching Data Bank status...");try{var r=yield G(t),n=(0,O.getBankCredentials)((0,O.getCurrentProfile)()),i={enabled:!!r.enable_remote_update,spacename:r.spacename||null,keys:(r.keys||[]).map(q),cliKey:n?{keyName:n.keyName||null,spacekey:(0,k.$l)(n.spacekey),issuedAt:n.issuedAt||null}:null};if(o&&o.stop(),e.json)return void(0,k.GF)(i);console.log(w.default.bold("\nData Bank")),console.log("─".repeat(60)),console.log(`Enabled: ${i.enabled?w.default.green("Yes"):w.default.red("No")}`),console.log(`Spacename: ${i.spacename||w.default.gray("N/A")}`),console.log(`Keys: ${i.keys.length}`),console.log(`CLI Key: ${i.cliKey?`${i.cliKey.keyName||"Unnamed"} ${w.default.gray(`(${i.cliKey.spacekey})`)}`:w.default.gray("none (issued automatically on first use)")}`),console.log("─".repeat(60)),i.enabled||console.log(w.default.yellow("Run `bricks data enable` to enable Data Bank."))}catch(t){M({spinner:o,error:t,options:e,action:"data.status"})}}),function(e){return d.apply(this,arguments)}));var H=(p=C(function*(e,t){var o=(0,S.requireAuth)(),r=e?"data.enable":"data.disable",n=yield B(t,`${e?"Enabling":"Disabling"} Data Bank...`);try{var i=yield o.updateWorkspace({enableBankRemoteUpdate:e}),a=i?.bank||{};n&&n.stop(),(0,j.yd)({action:r,target:{spacename:a.spacename||null},result:{enabled:!!a.enable_remote_update},json:t.json,message:e?`${w.default.green("Data Bank enabled.")} Spacename: ${w.default.cyan(a.spacename)}`:w.default.green("Data Bank disabled.")})}catch(e){M({spinner:n,error:e,options:t,action:r})}}),function(e,t){return p.apply(this,arguments)});W.command("enable").description("Enable Data Bank on this workspace").option("-j, --json","Output as JSON").action(e=>H(!0,e)),W.command("disable").description("Disable Data Bank on this workspace").option("-j, --json","Output as JSON").action(e=>H(!1,e)),W.command("login").description("Issue a Data Bank space key and save it to the active profile").option("--name <keyName>","Space key name","bricks-cli").option("-j, --json","Output as JSON").action((f=C(function*(e){var t=(0,S.requireAuth)(),o=yield B(e,"Issuing Data Bank key...");try{var r=(yield P()).issueBankCredentials,n=yield r(t,{keyName:e.name});o&&o.stop(),(0,j.yd)({action:"data.login",target:{spacename:n.spacename},result:{keyName:n.keyName,spacekey:(0,k.$l)(n.spacekey),issuedAt:n.issuedAt},json:e.json,message:`${w.default.green("Data Bank key issued and saved.")} ${w.default.gray(`(${n.keyName}, stored in ${O.CONFIG_PATH})`)}`})}catch(t){M({spinner:o,error:t,options:e,action:"data.login"})}}),function(e){return f.apply(this,arguments)})),W.command("logout").description("Remove the stored Data Bank key from the active profile").option("--revoke","Also revoke the key on the workspace").option("-j, --json","Output as JSON").action((g=C(function*(e){var t=(0,S.requireAuth)(),o=yield B(e,"Clearing Data Bank key...");try{var r=(yield P()).clearStoredBankCredentials,n=yield r(t,{revoke:e.revoke}),i=n.cleared,a=n.revoked;o&&o.stop(),(0,j.yd)({action:"data.logout",target:{profile:(0,O.getCurrentProfile)()},result:{cleared:i,revoked:a},json:e.json,message:i?w.default.green(`Data Bank key removed${a?" and revoked":""}.`):w.default.yellow("No Data Bank key stored for this profile.")})}catch(t){M({spinner:o,error:t,options:e,action:"data.logout"})}}),function(e){return g.apply(this,arguments)}));var K=new E.uB("keys").description("Data Bank space key management");W.addCommand(K),K.command("list").description("List Data Bank space keys (values are masked; use --json for full values)").option("-j, --json","Output as JSON (includes full key values)").action((h=C(function*(e){var t=(0,S.requireAuth)(),o=yield B(e,"Fetching space keys...");try{var r=(yield G(t)).keys||[];if(o&&o.stop(),e.json)return void(0,k.GF)(r);if(0===r.length)return void console.log(w.default.yellow("No space keys found"));console.log(w.default.bold("\nData Bank Space Keys")),console.log("─".repeat(60)),r.map(q).forEach(e=>{var t=e.enableExpired?`expires ${e.expiredAt}`:"no expiry",o=[e.hasReadLimit&&"read-limited",e.hasWriteLimit&&"write-limited"].filter(Boolean).join(", ");console.log(`● ${w.default.cyan(e.name||"Unnamed")} ${w.default.gray(`(${e.meta})`)}`),console.log(` Value: ${w.default.gray(e.value)}`),console.log(` Expiry: ${w.default.gray(t)}${o?w.default.gray(`, ${o}`):""}`),console.log()}),console.log("─".repeat(60))}catch(t){M({spinner:o,error:t,options:e,action:"data.keys.list"})}}),function(e){return h.apply(this,arguments)})),K.command("new <name>").description("Create a new Data Bank space key").option("--expire-at <date>","Expiry time (ISO date, between 1 hour and 90 days from now)").option("--read <propertyIds>","Limit readable properties (comma separated)").option("--write <propertyIds>","Limit writable properties (comma separated)").option("-j, --json","Output as JSON").action((m=C(function*(e,t){var o=(0,S.requireAuth)(),r=yield B(t,"Creating space key...");try{if(t.expireAt&&Number.isNaN(Date.parse(t.expireAt)))throw Error(`Invalid --expire-at date: ${t.expireAt}`);var n=yield G(o),i=new Set((n.keys||[]).map(e=>e.value)),a=yield o.updateWorkspace({newBankKey:{name:e,enableExpired:!!t.expireAt,expiredAt:t.expireAt,limitedReadProps:t.read?L(t.read):void 0,limitedWriteProps:t.write?L(t.write):void 0}}),s=a?.bank?.keys||[],l=s.find(e=>!i.has(e.value))||s.filter(t=>t.name===e).at(-1);if(!l)throw Error("Space key was not created");r&&r.stop(),(0,j.yd)({action:"data.keys.new",target:{name:e},result:l,json:t.json,message:w.default.green(`Space key "${e}" created.`)}),t.json||(console.log(w.default.yellow("\n⚠ Copy this key now — it will not be shown again in full:")),console.log(l.value))}catch(o){M({spinner:r,error:o,options:t,action:"data.keys.new",target:{name:e}})}}),function(e,t){return m.apply(this,arguments)})),K.command("revoke <keyOrName>").description("Revoke a Data Bank space key by value or name").option("-y, --yes","Skip confirmation prompt").option("-j, --json","Output as JSON").action((D=C(function*(e,t){var o=(0,S.requireAuth)(),r=yield B(t,"Resolving space key...");try{var n=(yield G(o)).keys||[],i=n.filter(t=>t.value===e);if(0===i.length&&(i=n.filter(t=>t.name===e)),0===i.length)throw Error(`No space key matched "${e}"`);if(i.length>1)throw Error(`Multiple space keys named "${e}"; pass the exact key value instead`);var a=i,s=_(a,1)[0];if(r&&r.stop(),!(yield R({message:`Revoke space key "${s.name}" (${(0,k.$l)(s.value)})?`,autoYes:t.yes,json:t.json})))return void console.log(w.default.yellow("Cancelled"));yield o.updateWorkspace({revokeBankKey:s.value}),(0,j.yd)({action:"data.keys.revoke",target:{name:s.name,meta:s.meta},result:{revoked:!0},json:t.json,message:w.default.green(`Space key "${s.name}" revoked.`)})}catch(e){M({spinner:r,error:e,options:t,action:"data.keys.revoke"})}}),function(e,t){return D.apply(this,arguments)})),W.command("list").description("List Data Bank properties").option("-k, --keyword <keyword>","Filter by definition title / description or tags").option("-m, --meta <meta>",`Filter by meta (${A.YC.join(" | ")})`).option("-j, --json","Output as JSON").action((y=C(function*(e){var t=(0,S.requireAuth)(),o=yield B(e,"Fetching properties...");try{(0,A.jR)(e.meta);var r=yield V(t),n=yield r.listProperties({keyword:e.keyword,meta:e.meta});if(o&&o.stop(),e.json)return void(0,k.GF)(n||[]);if(!n||0===n.length)return void console.log(w.default.yellow("No Data Bank properties found"));console.log(w.default.bold(`
42
42
  Data Bank Properties (${n.length})`)),console.log("─".repeat(80)),n.forEach(e=>{var t=e.definition?.title;console.log(`● ${w.default.cyan(e.propertyId)} ${w.default.gray(`(${e.meta})`)}${t?` ${t}`:""}`),e.tags?.length&&console.log(` Tags: ${e.tags.join(", ")}`),console.log(` Value: ${(e=>{if(null==e)return w.default.gray("null");var t=JSON.stringify(e);return t.length>60?`${t.slice(0,60)}…`:t})(e.value)}`),console.log(` Updated: ${w.default.gray(e.updateAt)}`),console.log()}),console.log("─".repeat(80))}catch(t){M({spinner:o,error:t,options:e,action:"data.list"})}}),function(e){return y.apply(this,arguments)})),W.command("get <propertyId>").description("Get a Data Bank property").option("-j, --json","Output as JSON").action((v=C(function*(e,t){var o=(0,S.requireAuth)(),r=yield B(t,"Fetching property...");try{var n=yield V(o),i=yield n.getProperty(e);if(!i)throw Error(`Property not found: ${e}`);if(r&&r.stop(),t.json)return void(0,k.GF)(i);console.log(w.default.bold(`
43
43
  Data Bank Property: ${i.propertyId}`)),console.log("─".repeat(60)),console.log(`Meta: ${i.meta}`),console.log(`Title: ${i.definition?.title||w.default.gray("N/A")}`),console.log(`Tags: ${i.tags?.join(", ")||w.default.gray("None")}`),console.log(`Last Note: ${i.lastUpdateNote||w.default.gray("N/A")}`),console.log(`Updated: ${w.default.gray(i.updateAt)}`),console.log(`Created: ${w.default.gray(i.createAt)}`),console.log(`
@@ -61,31 +61,31 @@ ${b.default.bold("Update Status")}`),console.log(`Needs Update: ${v.need_update?
61
61
  ${b.default.bold("Watchdog")}`),console.log(`Alive: ${_.alive?b.default.green("Yes"):b.default.red("No")}`),_.last_launch_time&&console.log(`Last Launch: ${b.default.gray(_.last_launch_time)}`),_.last_alive_time&&console.log(`Last Alive: ${b.default.gray(_.last_alive_time)}`)}}n.bound_application&&(console.log(`
62
62
  ${b.default.bold("Bound Application")}`),console.log(`Name: ${n.bound_application.name}`),console.log(`ID: ${b.default.gray(n.bound_application._id)}`)),n.env?.variables&&Object.keys(n.env.variables).length>0&&(console.log(`
63
63
  ${b.default.bold("Environment Variables")}`),Object.entries(n.env.variables).forEach(([e,t])=>{console.log(` ${b.default.cyan(e)}: ${t}`)})),console.log("─".repeat(60))}catch(e){r.fail(`Failed to get device: ${e.message}`),process.exit(1)}}),function(e,t){return a.apply(this,arguments)})),A.command("resolve <query>").description("Resolve a device name or ID to stable IDs").option("-l, --limit <limit>","Limit search results",e=>Number.parseInt(e,10),10).option("-j, --json","Output as JSON").action((s=y(function*(e,t){var o=(0,C.requireAuth)(),r=t.json?null:(0,F.default)("Resolving device...").start();try{var n=yield(0,$.Y)(()=>o.device({id:e})),i=n||!e?n?[n]:[]:yield o.devices({keyword:e,paginate:{limit:t.limit}}),a=(0,$.K)({resource:"device",query:e,items:n?[n]:i||[],fields:["_id","name","device_name"],selectedBy:n?"id":null});if(r&&r.stop(),t.json)return void(0,_.GF)(a);if(a.resolved){var s=a.resolved;console.log(b.default.bold("\nResolved Device")),console.log("─".repeat(60)),console.log(`Name: ${b.default.cyan(s.name||s.device_name||"Unnamed")}`),console.log(`ID: ${b.default.gray(s._id)}`),console.log(`Selected By: ${a.selectedBy}`),console.log("─".repeat(60));return}if(0===a.matches.length)return void console.log(b.default.yellow(`No devices matched "${e}"`));console.log(b.default.bold(`
64
- Matching Devices (${a.matches.length})`)),console.log("─".repeat(80)),a.matches.forEach(e=>{console.log(`${b.default.cyan(e.name||e.device_name||"Unnamed")} ${b.default.gray(e._id)}`)}),console.log("─".repeat(80))}catch(t){r?r.fail(`Failed to resolve device: ${t.message}`):(0,_.OW)(t.message,{resource:"device",query:e}),process.exit(1)}}),function(e,t){return s.apply(this,arguments)})),A.command("bind <passcode>").description("Bind a new device using passcode").option("-n, --name <name>","Device name").option("--dry-run","Validate inputs and show the device binding plan without creating a device").option("-j, --json","Output as JSON").action((l=y(function*(e,t){var o=(0,C.requireAuth)(),r=t.json?null:(0,F.default)("Checking passcode...").start();try{var n=yield o.checkBindDevicePasscode({passcode:e});n||(t.json?(0,_.OW)("Invalid passcode or expired",{action:"device.bind"}):r.fail("Invalid passcode or expired"),process.exit(1));var i={name:t.name||n.payload?.deviceName||"CLI Device",deviceName:n.payload?.deviceName||null};if(t.dryRun){r&&r.stop(),(0,E.S5)({action:"device.bind",target:i,request:{passcodePreview:(0,_.$l)(e),requestedName:t.name||null,inferredName:n.payload?.deviceName||null},checks:[(0,E.Iy)("passcode is valid",!0),(0,E.Iy)("device name resolved",!0,i.name)],json:t.json});return}r&&(r.text="Binding device...");var a=yield o.createDevice({bindPasscode:e,name:i.name,deviceName:n.payload?.deviceName});t.json?(0,E.yd)({action:"device.bind",target:S(a,a._id),result:{inferredName:n.payload?.deviceName||null},json:!0}):(r.succeed(`Device bound successfully: ${b.default.green(a.name)}`),console.log(b.default.gray(`Device ID: ${a._id}`)))}catch(e){t.json?(0,_.OW)(e.message,{action:"device.bind"}):r.fail(`Failed to bind device: ${e.message}`),process.exit(1)}}),function(e,t){return l.apply(this,arguments)})),A.command("remove <id>").description("Remove a device").option("--dry-run","Validate the target and show the removal plan without deleting it").option("-j, --json","Output as JSON").action((u=y(function*(e,t){var o=(0,C.requireAuth)(),r=t.json?null:(0,F.default)("Removing device...").start();try{var n=yield x(o,e),i=S(n,e);if(t.dryRun){r&&r.stop(),(0,E.S5)({action:"device.remove",target:i,request:{id:e},checks:[(0,E.Iy)("device exists",!0,`${i.name} (${i.id})`)],json:t.json});return}var a=yield o.removeDevice({id:e});t.json?(0,E.yd)({action:"device.remove",target:i,result:{removed:!!a},json:!0}):r.succeed(`Device removed: ${b.default.green(i.name)}`)}catch(o){t.json?(0,_.OW)(o.message,{action:"device.remove",target:{id:e}}):r.fail(`Failed to remove device: ${o.message}`),process.exit(1)}}),function(e,t){return u.apply(this,arguments)})),A.command("control <id> <type>").description("Control a device").option("-p, --payload <json>","Event payload as JSON").option("--dry-run","Validate inputs and show the control request without sending it").option("-j, --json","Output as JSON").action((c=y(function*(e,t,o){try{var r;o.payload&&(r=JSON.parse(o.payload)),yield O({id:e,type:t,eventPayload:r,options:o,progressMessage:`Sending ${t} to device...`,successMessage:`Control event sent: ${b.default.green(t)}`,failureMessage:"Failed to control device"})}catch(r){o.json?(0,_.OW)(r.message,{action:"device.control",target:{id:e},type:t}):console.error(b.default.red(`Failed to control device: ${r.message}`)),process.exit(1)}}),function(e,t,o){return c.apply(this,arguments)})),A.command("refresh <id>").description("Refresh device application").option("--dry-run","Validate inputs and show the refresh request without sending it").option("-j, --json","Output as JSON").action((d=y(function*(e,t){yield O({id:e,type:"refresh",options:t,progressMessage:"Refreshing device...",successMessage:"Device refreshed",failureMessage:"Failed to refresh device"})}),function(e,t){return d.apply(this,arguments)})),A.command("clear-cache <id>").description("Clear device cache").option("--dry-run","Validate inputs and show the cache-clear request without sending it").option("-j, --json","Output as JSON").action((p=y(function*(e,t){yield O({id:e,type:"clear-cache",options:t,progressMessage:"Clearing cache...",successMessage:"Cache cleared",failureMessage:"Failed to clear cache"})}),function(e,t){return p.apply(this,arguments)})),A.command("screenshot <id>").description("Take device screenshot and save to file").option("-o, --output <path>","Output file path").option("--no-take","Only fetch existing screenshot without taking a new one").action((f=y(function*(e,t){var r=(0,C.requireAuth)(),n=(0,F.default)("Fetching workspace info...").start();try{var i=yield r.workspace();i?.media_resource?.enable_media_workspace||(n.fail("Media workspace is not enabled for this workspace"),process.exit(1)),i.media_resource.system_media_box_id||(n.fail("No media box configured for this workspace"),process.exit(1)),!1!==t.take&&(n.text="Sending screenshot request to device...",yield r.controlDevice({id:e,type:"take-screenshot"}),n.text="Waiting for device to capture screenshot...",yield new Promise(e=>setTimeout(e,3e3))),n.text="Fetching screenshot...";var a=(yield m||=Promise.all([o.e(370),o.e(831)]).then(o.bind(o,60450))).fetchAndSaveScreenshot,s=yield a(r,i,e,t.output);if(s.error&&(n.fail(s.error),process.exit(1)),n.succeed("Screenshot saved"),console.log(),console.log(b.default.bold("Screenshot saved to:")),console.log(b.default.cyan(s.path)),console.log(),s.file?.meta){var l=s.file.meta,u=l.originalWidth,c=l.originalHeight,d=l.originalFileSize;if(u&&c&&console.log(`${b.default.gray("Size:")} ${u}x${c}`),d){var p=(d/1024).toFixed(1);console.log(`${b.default.gray("File:")} ${p} KB`)}}s.file?.updatedAt&&console.log(`${b.default.gray("Updated:")} ${new Date(s.file.updatedAt).toLocaleString()}`)}catch(e){n.fail(`Failed to get screenshot: ${e.message}`),process.exit(1)}}),function(e,t){return f.apply(this,arguments)})),A.command("metrics <id>").description("Show device metrics (uptime, memory, disk)").option("--start-date <date>","Start date/time (ISO 8601 or relative e.g. 1h, 2d, default: today)").option("--end-date <date>","End date/time (ISO 8601 or relative e.g. 1h, 2d, default: now)").option("-j, --json","Output as JSON").action((g=y(function*(e,t){var o=(0,C.requireAuth)(),r=(0,F.default)("Fetching device metrics...").start();try{var n=new Date,i=new Date(n.getFullYear(),n.getMonth(),n.getDate()).toISOString(),a=t.startDate?(0,w.p)(t.startDate):i,s=t.endDate?(0,w.p)(t.endDate):n.toISOString(),l=yield o.deviceUsage({deviceId:e,startDate:a,endDate:s});if(r.stop(),!l||0===l.length)return void console.log(b.default.yellow("No metrics data found for this device"));if(t.json)return void console.log(JSON.stringify(l,null,2));for(var u of(console.log(b.default.bold(`
64
+ Matching Devices (${a.matches.length})`)),console.log("─".repeat(80)),a.matches.forEach(e=>{console.log(`${b.default.cyan(e.name||e.device_name||"Unnamed")} ${b.default.gray(e._id)}`)}),console.log("─".repeat(80))}catch(t){r?r.fail(`Failed to resolve device: ${t.message}`):(0,_.OW)(t.message,{resource:"device",query:e}),process.exit(1)}}),function(e,t){return s.apply(this,arguments)})),A.command("bind <passcode>").description("Bind a new device using passcode").option("-n, --name <name>","Device name").option("--dry-run","Validate inputs and show the device binding plan without creating a device").option("-j, --json","Output as JSON").action((l=y(function*(e,t){var o=(0,C.requireAuth)(),r=t.json?null:(0,F.default)("Checking passcode...").start();try{var n=yield o.checkBindDevicePasscode({passcode:e});n||(t.json?(0,_.OW)("Invalid passcode or expired",{action:"device.bind"}):r.fail("Invalid passcode or expired"),process.exit(1));var i={name:t.name||n.payload?.deviceName||"CLI Device",deviceName:n.payload?.deviceName||null};if(t.dryRun){r&&r.stop(),(0,E.S5)({action:"device.bind",target:i,request:{passcodePreview:(0,_.$l)(e),requestedName:t.name||null,inferredName:n.payload?.deviceName||null},checks:[(0,E.Iy)("passcode is valid",!0),(0,E.Iy)("device name resolved",!0,i.name)],json:t.json});return}r&&(r.text="Binding device...");var a=yield o.createDevice({bindPasscode:e,name:i.name,deviceName:n.payload?.deviceName});t.json?(0,E.yd)({action:"device.bind",target:S(a,a._id),result:{inferredName:n.payload?.deviceName||null},json:!0}):(r.succeed(`Device bound successfully: ${b.default.green(a.name)}`),console.log(b.default.gray(`Device ID: ${a._id}`)))}catch(e){t.json?(0,_.OW)(e.message,{action:"device.bind"}):r.fail(`Failed to bind device: ${e.message}`),process.exit(1)}}),function(e,t){return l.apply(this,arguments)})),A.command("remove <id>").description("Remove a device").option("--dry-run","Validate the target and show the removal plan without deleting it").option("-j, --json","Output as JSON").action((u=y(function*(e,t){var o=(0,C.requireAuth)(),r=t.json?null:(0,F.default)("Removing device...").start();try{var n=yield x(o,e),i=S(n,e);if(t.dryRun){r&&r.stop(),(0,E.S5)({action:"device.remove",target:i,request:{id:e},checks:[(0,E.Iy)("device exists",!0,`${i.name} (${i.id})`)],json:t.json});return}var a=yield o.removeDevice({id:e});t.json?(0,E.yd)({action:"device.remove",target:i,result:{removed:!!a},json:!0}):r.succeed(`Device removed: ${b.default.green(i.name)}`)}catch(o){t.json?(0,_.OW)(o.message,{action:"device.remove",target:{id:e}}):r.fail(`Failed to remove device: ${o.message}`),process.exit(1)}}),function(e,t){return u.apply(this,arguments)})),A.command("control <id> <type>").description("Control a device").option("-p, --payload <json>","Event payload as JSON").option("--dry-run","Validate inputs and show the control request without sending it").option("-j, --json","Output as JSON").action((c=y(function*(e,t,o){try{var r;o.payload&&(r=JSON.parse(o.payload)),yield O({id:e,type:t,eventPayload:r,options:o,progressMessage:`Sending ${t} to device...`,successMessage:`Control event sent: ${b.default.green(t)}`,failureMessage:"Failed to control device"})}catch(r){o.json?(0,_.OW)(r.message,{action:"device.control",target:{id:e},type:t}):console.error(b.default.red(`Failed to control device: ${r.message}`)),process.exit(1)}}),function(e,t,o){return c.apply(this,arguments)})),A.command("refresh <id>").description("Refresh device application").option("--dry-run","Validate inputs and show the refresh request without sending it").option("-j, --json","Output as JSON").action((d=y(function*(e,t){yield O({id:e,type:"refresh",options:t,progressMessage:"Refreshing device...",successMessage:"Device refreshed",failureMessage:"Failed to refresh device"})}),function(e,t){return d.apply(this,arguments)})),A.command("clear-cache <id>").description("Clear device cache").option("--dry-run","Validate inputs and show the cache-clear request without sending it").option("-j, --json","Output as JSON").action((p=y(function*(e,t){yield O({id:e,type:"clear-cache",options:t,progressMessage:"Clearing cache...",successMessage:"Cache cleared",failureMessage:"Failed to clear cache"})}),function(e,t){return p.apply(this,arguments)})),A.command("screenshot <id>").description("Take device screenshot and save to file").option("-o, --output <path>","Output file path").option("--no-take","Only fetch existing screenshot without taking a new one").action((f=y(function*(e,t){var r=(0,C.requireAuth)(),n=(0,F.default)("Fetching workspace info...").start();try{var i=yield r.workspace();i?.media_resource?.enable_media_workspace||(n.fail("Media workspace is not enabled for this workspace"),process.exit(1)),i.media_resource.system_media_box_id||(n.fail("No media box configured for this workspace"),process.exit(1)),!1!==t.take&&(n.text="Sending screenshot request to device...",yield r.controlDevice({id:e,type:"take-screenshot"}),n.text="Waiting for device to capture screenshot...",yield new Promise(e=>setTimeout(e,3e3))),n.text="Fetching screenshot...";var a=(yield m||=Promise.all([o.e(6370),o.e(831)]).then(o.bind(o,60450))).fetchAndSaveScreenshot,s=yield a(r,i,e,t.output);if(s.error&&(n.fail(s.error),process.exit(1)),n.succeed("Screenshot saved"),console.log(),console.log(b.default.bold("Screenshot saved to:")),console.log(b.default.cyan(s.path)),console.log(),s.file?.meta){var l=s.file.meta,u=l.originalWidth,c=l.originalHeight,d=l.originalFileSize;if(u&&c&&console.log(`${b.default.gray("Size:")} ${u}x${c}`),d){var p=(d/1024).toFixed(1);console.log(`${b.default.gray("File:")} ${p} KB`)}}s.file?.updatedAt&&console.log(`${b.default.gray("Updated:")} ${new Date(s.file.updatedAt).toLocaleString()}`)}catch(e){n.fail(`Failed to get screenshot: ${e.message}`),process.exit(1)}}),function(e,t){return f.apply(this,arguments)})),A.command("metrics <id>").description("Show device metrics (uptime, memory, disk)").option("--start-date <date>","Start date/time (ISO 8601 or relative e.g. 1h, 2d, default: today)").option("--end-date <date>","End date/time (ISO 8601 or relative e.g. 1h, 2d, default: now)").option("-j, --json","Output as JSON").action((g=y(function*(e,t){var o=(0,C.requireAuth)(),r=(0,F.default)("Fetching device metrics...").start();try{var n=new Date,i=new Date(n.getFullYear(),n.getMonth(),n.getDate()).toISOString(),a=t.startDate?(0,w.p)(t.startDate):i,s=t.endDate?(0,w.p)(t.endDate):n.toISOString(),l=yield o.deviceUsage({deviceId:e,startDate:a,endDate:s});if(r.stop(),!l||0===l.length)return void console.log(b.default.yellow("No metrics data found for this device"));if(t.json)return void console.log(JSON.stringify(l,null,2));for(var u of(console.log(b.default.bold(`
65
65
  Device Metrics: ${e}`)),console.log("─".repeat(60)),console.log(b.default.gray(`${"Date".padEnd(12)} ${"Uptime Events".padEnd(15)} ${"Avg Memory".padEnd(12)} ${"Avg Disk".padEnd(10)}`)),console.log("─".repeat(60)),l)){var c=(u.date||"").padEnd(12),d=String(u.uptime?.length||0).padEnd(15),p="N/A";if(u.memory_usage?.length){var f=0,g=0;for(var h of u.memory_usage){var m=h.values||[],y=D(m,2),v=y[0],_=y[1];null!=v&&null!=_&&_>0&&(f+=v,g+=_)}g>0&&(p=`${(f/g*100).toFixed(1)}%`)}var $="N/A";if(u.disk_usage?.length){var E=0,k=0;for(var S of u.disk_usage){var x=S.values||[],O=D(x,2),A=O[0],j=O[1];null!=A&&null!=j&&j>0&&(E+=A,k+=j)}k>0&&($=`${(E/k*100).toFixed(1)}%`)}console.log(`${c} ${d} ${p.padEnd(12)} ${$.padEnd(10)}`)}console.log("─".repeat(60))}catch(e){r.fail(`Failed to get device metrics: ${e.message}`),process.exit(1)}}),function(e,t){return g.apply(this,arguments)})),A.command("monitor").description("Monitor device status (polls every 60s)").option("-g, --group <id>","Monitor devices in a group").option("-i, --interval <seconds>","Polling interval in seconds","60").action((h=y(function*(e){var t,o=(0,C.requireAuth)(),r=1e3*parseInt(e.interval,10);console.log(b.default.bold("\nDevice Monitor")),console.log(b.default.gray(`Polling every ${e.interval}s. Press Ctrl+C to stop.
66
66
  `));var n=(t=y(function*(){try{var t;if(t=e.group?yield o.devicesByGroup({id:e.group}):yield o.devices({}),process.stdout.write("\x1b[2J\x1b[0f"),console.log(b.default.bold("Device Monitor")+b.default.gray(` - ${new Date().toLocaleTimeString()}`)),console.log("─".repeat(80)),!t||0===t.length)return void console.log(b.default.yellow("No devices found"));t.forEach(e=>{var t=e.entry_detail?.watch_dog_timer?.last_alive_time,o=k(t),r=e.name||e.device_name||e.device_target_name||"Unnamed",n=e.entry_detail?.application?.name||b.default.gray("No app");console.log(`${o} ${b.default.cyan(r.padEnd(25))} ${n}`)}),console.log(`
67
- ${b.default.gray("Press Ctrl+C to stop")}`)}catch(e){console.error(b.default.red(`Error: ${e.message}`))}}),function(){return t.apply(this,arguments)});yield n(),setInterval(n,r)}),function(e){return h.apply(this,arguments)}))},80274(e,t,o){o.d(t,{gf:()=>er});var r,n,i,a,s,l,u,c,d,p,f,g,h,m,D,y,v,b,F,_,C,$,E,w,k,S,x,O,A,j,I,B,N,P,T,R=o(68832),M=o(99436),U=o(35679),J=o(73284),L=o(51455),q=o(76760),G=o(75646),V=(r=M(function*(e,t,o=3e3){var r;try{var n=new AbortController;r=setTimeout(()=>n.abort(),o);var i=yield fetch(`http://${e}:${t}/json/list`,{signal:n.signal});if(!i.ok)return null;return yield i.json()}catch{return null}finally{void 0!==r&&clearTimeout(r)}}),function(e,t){return r.apply(this,arguments)}),W=e=>{if(!e)return null;var t=e.match(/\/ws\/(.+)$/);return t?decodeURIComponent(t[1]):null},H=(n=M(function*(e,t=1e3){for(var o=[],r=e,n=0;n<10;n++){var i=q.join(r,".bricks","devtools.json");try{var a=yield L.readFile(i,"utf8"),s=JSON.parse(a),l=yield(0,G.verifyDevToolsServer)(s.address||"localhost",s.port,t);l&&o.push({name:s.name||"BRICKS Simulator",address:s.address||"localhost",port:s.port,protocols:["cdp"],hasPasscode:!1,source:"project",projectPath:r,...l})}catch{}var u=q.dirname(r);if(u===r)break;r=u}return o}),function(e){return n.apply(this,arguments)}),K=(i=M(function*({timeout:e=3e3,verify:t=!1,udpOnly:o=!1,project:r=!0,port:n=19851,cwd:i=process.cwd(),onStatus:a}={}){var s,l=(0,G.discoverDevToolsServers)({timeout:e,idleTimeout:800}),u=o?Promise.resolve([]):(a?.("Scanning via UDP + HTTP probe..."),(0,G.httpProbeSubnet)({port:n,timeout:e})),c=r?H(i,1e3):Promise.resolve([]),d=R((yield Promise.all([l,u,c])),3),p=(e=>{var t=new Map;for(var o of e){var r=o.deviceId||`${o.address}:${o.port}`,n=t.get(r);if(!n){t.set(r,{...o,addresses:[o.address],protocols:[...o.protocols||[]]});continue}for(var i of(n.addresses.includes(o.address)||n.addresses.push(o.address),"127.0.0.1"===n.address&&"127.0.0.1"!==o.address&&(n.address=o.address),o.protocols||[]))n.protocols.includes(i)||n.protocols.push(i);for(var a of Object.entries(o)){var s=R(a,2),l=s[0],u=s[1];null!=u&&"address"!==l&&"addresses"!==l&&"protocols"!==l&&(void 0===n[l]||null===n[l])&&(n[l]=u)}}return[...t.values()]})([...d[0],...d[1],...d[2]]);if(0===p.length)return[];if(t){a?.(`Verifying ${p.length} server(s)...`);var f,g=yield Promise.all(p.map((f=M(function*(e){var t=yield(0,G.verifyDevToolsServer)(e.address,e.port);return{...e,...t||{},address:e.address,port:e.port,verified:!!t,version:t?.version||e.version}}),function(e){return f.apply(this,arguments)})));p.splice(0,p.length,...g)}return a?.("Checking chrome://inspect support..."),yield Promise.all(p.map((s=M(function*(e){var t=yield V(e.address,e.port);if(t){e.chromeInspect=!0;var o=W(t[0]?.webSocketDebuggerUrl);o&&(e.passcode=o)}}),function(e){return s.apply(this,arguments)}))),p}),function(){return i.apply(this,arguments)}),Y="2.24",z="19851",Q="127.0.0.1",X=e=>{if(!e)return{host:void 0,port:void 0};var t=e.match(/^\[([^\]]+)\](?::(\d+))?$/);if(t)return{host:t[1],port:t[2]};var o=e.lastIndexOf(":");if(o>0&&e.indexOf(":")===o){var r=e.slice(o+1);if(/^\d+$/.test(r))return{host:e.slice(0,o),port:r}}return{host:e,port:void 0}},Z=e=>{if(!e)return!1;for(var t=e.replace(/^v/,"").split(".").map(Number),o=Y.split(".").map(Number),r=0;r<o.length&&!((t[r]||0)>o[r]);r++)if((t[r]||0)<o[r])return!1;return!0},ee=e=>e?.auth?.workspaceJwt?.enabled?"workspace-jwt":e?.auth?.passcode||e?.hasPasscode?"passcode":e?.auth?"locked":"open",et=e=>"workspace-jwt"===e?J.default.green(e):"passcode"===e?J.default.yellow(e):"locked"===e?J.default.red(e):J.default.gray(e),eo=(a=M(function*({info:e,cdpOptions:t,force:r=!1}){if(t.passcode||!e?.auth?.workspaceJwt?.enabled)return null;var n=yield Promise.resolve().then(o.bind(o,47988)),i=n.getCurrentProfile,a=n.getTokenInfo,s=n.getBaseUrl,l=(yield Promise.all([o.e(370),o.e(785),o.e(332),o.e(209),o.e(907)]).then(o.bind(o,85382))).createClient,u=(yield o.e(305).then(o.bind(o,7944))).getOrIssueDevtoolsToken,c=i(),d=a(c);if(!d?.token||!d?.workspaceId||e.workspaceId&&String(d.workspaceId)!==String(e.workspaceId))return null;var p=l(s(),d.token);return(yield u({profile:c,client:p,workspaceId:e.workspaceId||void 0,force:r})).token}),function(e){return a.apply(this,arguments)}),er=new U.uB("devtools").description("DevTools server discovery, inspection, and CDP commands").option("-a, --address <address>",`DevTools server address, host or host:port (default: ${Q})`).option("-p, --port <port>",`Server port for CDP commands (default: ${z})`).option("--passcode <passcode>","Device passcode for CDP commands"),en=e=>e.option("-a, --address <address>","DevTools server address, host or host:port").option("-p, --port <port>",`Server port (default: ${z})`).option("--passcode <passcode>","Device passcode").option("-j, --json","Output as JSON"),ei=(s=M(function*(e,t){var r,n,i,a=(yield Promise.resolve().then(o.bind(o,30155))).default,s=(yield Promise.resolve().then(o.bind(o,75646))).verifyDevToolsServer,l=(yield o.e(178).then(o.bind(o,28193))).createCdpClient,u=(r=er.opts(),n=X(e.address??r.address),{...e,address:n.host??Q,port:e.port??r.port??n.port??z,passcode:e.passcode??r.passcode}),c=parseInt(u.port,10),d=a("Connecting to DevTools...").start();try{var p=yield s(u.address,c);p||(d.fail(`Cannot reach DevTools server at ${u.address}:${c}`),process.exit(1)),p.version&&!Z(p.version)&&(d.fail(`CDP requires app version >= ${Y} (device: ${p.version})`),process.exit(1));var f=yield eo({info:p,cdpOptions:u});i=l(u.address,c,{passcode:u.passcode,accessToken:f});try{yield i.connect()}catch(e){if(i.close(),!f||!/403|Forbidden/i.test(e.message))throw e;f=yield eo({info:p,cdpOptions:u,force:!0}),i=l(u.address,c,{passcode:u.passcode,accessToken:f}),yield i.connect()}d.stop(),yield t(i)}catch(e){d.isSpinning&&d.stop(),console.error(J.default.red(e.message)),process.exit(1)}finally{i?.close()}}),function(e,t){return s.apply(this,arguments)}),ea=({subspaceId:e,handler:t,action:o,parameters:r,property:n,waitAsync:i,sync:a})=>{var s={handler:t,action:o};void 0!==r&&(s.parameters=r),void 0!==n&&(s.property=n),void 0!==i&&(s.waitAsync=i),void 0!==a&&(s.sync=a);var l=e?JSON.stringify(e):"(Object.keys(globalThis.system?.subspaces?.() || {})[0] || '')";return`(() => {
67
+ ${b.default.gray("Press Ctrl+C to stop")}`)}catch(e){console.error(b.default.red(`Error: ${e.message}`))}}),function(){return t.apply(this,arguments)});yield n(),setInterval(n,r)}),function(e){return h.apply(this,arguments)}))},80274(e,t,o){o.d(t,{gf:()=>er});var r,n,i,a,s,l,u,c,d,p,f,g,h,m,D,y,v,b,F,_,C,$,E,w,k,S,x,O,A,j,I,B,N,P,T,R=o(68832),M=o(99436),U=o(35679),J=o(73284),L=o(51455),q=o(76760),G=o(75646),V=(r=M(function*(e,t,o=3e3){var r;try{var n=new AbortController;r=setTimeout(()=>n.abort(),o);var i=yield fetch(`http://${e}:${t}/json/list`,{signal:n.signal});if(!i.ok)return null;return yield i.json()}catch{return null}finally{void 0!==r&&clearTimeout(r)}}),function(e,t){return r.apply(this,arguments)}),W=e=>{if(!e)return null;var t=e.match(/\/ws\/(.+)$/);return t?decodeURIComponent(t[1]):null},H=(n=M(function*(e,t=1e3){for(var o=[],r=e,n=0;n<10;n++){var i=q.join(r,".bricks","devtools.json");try{var a=yield L.readFile(i,"utf8"),s=JSON.parse(a),l=yield(0,G.verifyDevToolsServer)(s.address||"localhost",s.port,t);l&&o.push({name:s.name||"BRICKS Simulator",address:s.address||"localhost",port:s.port,protocols:["cdp"],hasPasscode:!1,source:"project",projectPath:r,...l})}catch{}var u=q.dirname(r);if(u===r)break;r=u}return o}),function(e){return n.apply(this,arguments)}),K=(i=M(function*({timeout:e=3e3,verify:t=!1,udpOnly:o=!1,project:r=!0,port:n=19851,cwd:i=process.cwd(),onStatus:a}={}){var s,l=(0,G.discoverDevToolsServers)({timeout:e,idleTimeout:800}),u=o?Promise.resolve([]):(a?.("Scanning via UDP + HTTP probe..."),(0,G.httpProbeSubnet)({port:n,timeout:e})),c=r?H(i,1e3):Promise.resolve([]),d=R((yield Promise.all([l,u,c])),3),p=(e=>{var t=new Map;for(var o of e){var r=o.deviceId||`${o.address}:${o.port}`,n=t.get(r);if(!n){t.set(r,{...o,addresses:[o.address],protocols:[...o.protocols||[]]});continue}for(var i of(n.addresses.includes(o.address)||n.addresses.push(o.address),"127.0.0.1"===n.address&&"127.0.0.1"!==o.address&&(n.address=o.address),o.protocols||[]))n.protocols.includes(i)||n.protocols.push(i);for(var a of Object.entries(o)){var s=R(a,2),l=s[0],u=s[1];null!=u&&"address"!==l&&"addresses"!==l&&"protocols"!==l&&(void 0===n[l]||null===n[l])&&(n[l]=u)}}return[...t.values()]})([...d[0],...d[1],...d[2]]);if(0===p.length)return[];if(t){a?.(`Verifying ${p.length} server(s)...`);var f,g=yield Promise.all(p.map((f=M(function*(e){var t=yield(0,G.verifyDevToolsServer)(e.address,e.port);return{...e,...t||{},address:e.address,port:e.port,verified:!!t,version:t?.version||e.version}}),function(e){return f.apply(this,arguments)})));p.splice(0,p.length,...g)}return a?.("Checking chrome://inspect support..."),yield Promise.all(p.map((s=M(function*(e){var t=yield V(e.address,e.port);if(t){e.chromeInspect=!0;var o=W(t[0]?.webSocketDebuggerUrl);o&&(e.passcode=o)}}),function(e){return s.apply(this,arguments)}))),p}),function(){return i.apply(this,arguments)}),Y="2.24",z="19851",Q="127.0.0.1",X=e=>{if(!e)return{host:void 0,port:void 0};var t=e.match(/^\[([^\]]+)\](?::(\d+))?$/);if(t)return{host:t[1],port:t[2]};var o=e.lastIndexOf(":");if(o>0&&e.indexOf(":")===o){var r=e.slice(o+1);if(/^\d+$/.test(r))return{host:e.slice(0,o),port:r}}return{host:e,port:void 0}},Z=e=>{if(!e)return!1;for(var t=e.replace(/^v/,"").split(".").map(Number),o=Y.split(".").map(Number),r=0;r<o.length&&!((t[r]||0)>o[r]);r++)if((t[r]||0)<o[r])return!1;return!0},ee=e=>e?.auth?.workspaceJwt?.enabled?"workspace-jwt":e?.auth?.passcode||e?.hasPasscode?"passcode":e?.auth?"locked":"open",et=e=>"workspace-jwt"===e?J.default.green(e):"passcode"===e?J.default.yellow(e):"locked"===e?J.default.red(e):J.default.gray(e),eo=(a=M(function*({info:e,cdpOptions:t,force:r=!1}){if(t.passcode||!e?.auth?.workspaceJwt?.enabled)return null;var n=yield Promise.resolve().then(o.bind(o,47988)),i=n.getCurrentProfile,a=n.getTokenInfo,s=n.getBaseUrl,l=(yield Promise.all([o.e(6370),o.e(5785),o.e(3332),o.e(2209),o.e(907)]).then(o.bind(o,85382))).createClient,u=(yield o.e(4305).then(o.bind(o,7944))).getOrIssueDevtoolsToken,c=i(),d=a(c);if(!d?.token||!d?.workspaceId||e.workspaceId&&String(d.workspaceId)!==String(e.workspaceId))return null;var p=l(s(),d.token);return(yield u({profile:c,client:p,workspaceId:e.workspaceId||void 0,force:r})).token}),function(e){return a.apply(this,arguments)}),er=new U.uB("devtools").description("DevTools server discovery, inspection, and CDP commands").option("-a, --address <address>",`DevTools server address, host or host:port (default: ${Q})`).option("-p, --port <port>",`Server port for CDP commands (default: ${z})`).option("--passcode <passcode>","Device passcode for CDP commands"),en=e=>e.option("-a, --address <address>","DevTools server address, host or host:port").option("-p, --port <port>",`Server port (default: ${z})`).option("--passcode <passcode>","Device passcode").option("-j, --json","Output as JSON"),ei=(s=M(function*(e,t){var r,n,i,a=(yield Promise.resolve().then(o.bind(o,30155))).default,s=(yield Promise.resolve().then(o.bind(o,75646))).verifyDevToolsServer,l=(yield o.e(1178).then(o.bind(o,28193))).createCdpClient,u=(r=er.opts(),n=X(e.address??r.address),{...e,address:n.host??Q,port:e.port??r.port??n.port??z,passcode:e.passcode??r.passcode}),c=parseInt(u.port,10),d=a("Connecting to DevTools...").start();try{var p=yield s(u.address,c);p||(d.fail(`Cannot reach DevTools server at ${u.address}:${c}`),process.exit(1)),p.version&&!Z(p.version)&&(d.fail(`CDP requires app version >= ${Y} (device: ${p.version})`),process.exit(1));var f=yield eo({info:p,cdpOptions:u});i=l(u.address,c,{passcode:u.passcode,accessToken:f});try{yield i.connect()}catch(e){if(i.close(),!f||!/403|Forbidden/i.test(e.message))throw e;f=yield eo({info:p,cdpOptions:u,force:!0}),i=l(u.address,c,{passcode:u.passcode,accessToken:f}),yield i.connect()}d.stop(),yield t(i)}catch(e){d.isSpinning&&d.stop(),console.error(J.default.red(e.message)),process.exit(1)}finally{i?.close()}}),function(e,t){return s.apply(this,arguments)}),ea=({subspaceId:e,handler:t,action:o,parameters:r,property:n,waitAsync:i,sync:a})=>{var s={handler:t,action:o};void 0!==r&&(s.parameters=r),void 0!==n&&(s.property=n),void 0!==i&&(s.waitAsync=i),void 0!==a&&(s.sync=a);var l=e?JSON.stringify(e):"(Object.keys(globalThis.system?.subspaces?.() || {})[0] || '')";return`(() => {
68
68
  const systemRef = globalThis.system
69
69
  if (!systemRef?.executeAction) throw new Error('BRICKS DevTools system actions are unavailable')
70
70
  const subspaceId = ${l}
71
71
  if (!subspaceId) throw new Error('No BRICKS subspace is available')
72
72
  return systemRef.executeAction(subspaceId, ${JSON.stringify(s)})
73
- })()`},es=/^\d+$/,el=e=>"string"==typeof e&&es.test(e),eu=(l=M(function*(e,t){yield e.send("DOM.enable");var o=yield e.send("DOM.resolveNode",{nodeId:Number(t)}),r=o?.object;if(!r)throw Error(`Node ${t} not found`);if("value"in r)return r.value;if(!r.objectId)throw Error(`Node ${t} did not resolve to metadata`);var n=yield e.send("Runtime.getProperties",{objectId:r.objectId,ownProperties:!0}),i=n.result,a=n.exceptionDetails;if(a)throw Error(a.text||`Cannot read node ${t}`);return(void 0===i?[]:i).reduce((e,t)=>(e[t.name]=(e=>{if(e)return"value"in e?e.value:e.unserializableValue||e.description})(t.value),e),{})}),function(e,t){return l.apply(this,arguments)}),ec=(u=M(function*(e,{subspaceId:t,brickId:o}){var r=t,n=o,i={};if(el(t)){var a=yield eu(e,t);if(r=a.subspaceId||(String(a.shortId||"").startsWith("S_")?a.shortId:null),i.subspaceNodeId=Number(t),!r)throw Error(`Node ${t} is not inside a BRICKS subspace`)}if(el(o)){var s=yield eu(e,o);if(n=s.brickId||(String(s.shortId||"").startsWith("B_")?s.shortId:null),!el(t)&&s.subspaceId&&(r=s.subspaceId),i.brickNodeId=Number(o),!n)throw Error(`Node ${o} is not a BRICKS brick`)}return{subspaceId:r,brickId:n,...i}}),function(e,t){return u.apply(this,arguments)}),ed=(c=M(function*(e,t,{json:o,successMessage:r,jsonResult:n}){yield e.send("Runtime.enable");var i=yield e.send("Runtime.evaluate",{expression:t,objectGroup:"console",returnByValue:!0,awaitPromise:!0});if(i.exceptionDetails){var a=i.exceptionDetails;throw Error(a.exception?.description||a.exception?.value||a.text||"Runtime evaluation failed")}o?console.log(JSON.stringify({success:!0,...n},null,2)):console.log(J.default.green(r))}),function(e,t,o){return c.apply(this,arguments)}),ep=e=>{if(!e)return{};for(var t={},o=0;o<e.length;o+=2)t[e[o]]=e[o+1];return t},ef=e=>{if(!e)return null;var t=e.nodeName||e.localName||"unknown",o=e.id||e.shortId;o&&(t+=`#${o}`),e.title&&(t+=` "${e.title}"`);var r=[];return e.nodeId&&r.push(`node ${e.nodeId}`),e.shortId&&e.shortId!==o&&r.push(e.shortId),e.brickId&&e.brickId!==e.shortId&&r.push(e.brickId),e.templateKey&&r.push(e.templateKey),r.length>0?`${t} (${r.join(", ")})`:t},eg=(e,t="",o=!0,r=!0)=>{var n=[],i=r?"":o?" ":"│ ",a=e.nodeName||"#unknown";if(9===e.nodeType)a="#document";else if(3===e.nodeType){var s=e.nodeValue||"";a=J.default.gray(`"${s}"`)}else if(1===e.nodeType){var l=ep(e.attributes),u=l.id||l["short-id"];u&&(a+=J.default.gray(`#${u}`)),l.title&&(a+=` ${J.default.green(`"${l.title}"`)}`),void 0!==l.w&&void 0!==l.h&&(a+=J.default.blue(` ${l.w}\xd7${l.h}`),void 0!==l.x&&void 0!==l.y&&(a+=J.default.blue(` @${l.x},${l.y}`)));var c=[];void 0!==l.hide&&c.push(J.default.red("hidden")),void 0!==l.pressable&&c.push(J.default.yellow("pressable")),void 0!==l.editable&&c.push(J.default.yellow("editable")),c.length>0&&(a+=` [${c.join(", ")}]`)}n.push(`${t}${r?"":o?"└─ ":"├─ "}${a}`);var d=e.children||[];return d.forEach((e,o)=>{n.push(...eg(e,t+i,o===d.length-1,!1))}),n};er.command("issue-token").description("Issue a workspace-scoped DevTools access token and save it to the CLI config (used automatically by devtools commands)").option("--ttl <seconds>","Time-to-live in seconds (default 30 days)",e=>parseInt(e,10)).option("-j, --json","Output as JSON").action((d=M(function*(e){var t=yield Promise.resolve().then(o.bind(o,47988)),r=t.getCurrentProfile,n=t.getTokenInfo,i=t.getBaseUrl,a=t.CONFIG_PATH,s=(yield Promise.all([o.e(370),o.e(785),o.e(332),o.e(209),o.e(907)]).then(o.bind(o,85382))).createClient,l=(yield o.e(305).then(o.bind(o,7944))).getOrIssueDevtoolsToken,u=r(),c=n(u);c?.token||(console.error(J.default.red("Not logged in. Use `bricks auth login` first.")),process.exit(1));var d=s(i(),c.token);try{var p=yield l({profile:u,client:d,ttlSeconds:e.ttl,force:!0});if(e.json)return void console.log(JSON.stringify({profile:u,workspaceId:p.workspaceId,expiresAt:p.expiresAt,jti:p.jti},null,2));console.log(J.default.green("✓"),"DevTools access token issued and saved."),console.log(` Profile: ${u}`),console.log(` Workspace: ${p.workspaceId}`),console.log(` Expires: ${p.expiresAt}`),console.log(` jti: ${J.default.gray(p.jti)}`),console.log(J.default.gray(` Saved to ${a}`))}catch(e){console.error(J.default.red(`Issue token failed: ${e.message}`)),process.exit(1)}}),function(e){return d.apply(this,arguments)})),er.command("scan").description("Scan LAN for DevTools servers via UDP + HTTP").option("-t, --timeout <ms>","Scan timeout in milliseconds","3000").option("-j, --json","Output as JSON").option("--verify","Verify each discovered server via HTTP").option("--udp-only","Skip HTTP subnet probe (UDP only)").option("--no-project","Exclude local BRICKS project preview servers").option("-p, --port <port>","Port for HTTP probe","19851").action((p=M(function*(e){var t=(yield Promise.resolve().then(o.bind(o,30155))).default,r=yield Promise.resolve().then(o.bind(o,47988)),n=r.getCurrentProfile,i=r.getTokenInfo,a=parseInt(e.timeout,10),s=t(`Scanning for DevTools servers (${a}ms)...`).start();try{var l=yield K({timeout:a,verify:!!e.verify,udpOnly:!!e.udpOnly,project:!!e.project,port:parseInt(e.port,10),onStatus:e=>{s.text=e}});if(0===l.length){e.json?(s.stop(),console.log(JSON.stringify([],null,2))):s.info("No DevTools servers found on the network."),process.exit(0);return}s.stop(),e.json&&(console.log(JSON.stringify(l,null,2)),process.exit(0));var u=n(),c=i(u),d=c?.workspaceId||null;console.log(J.default.bold(`
73
+ })()`},es=/^\d+$/,el=e=>"string"==typeof e&&es.test(e),eu=(l=M(function*(e,t){yield e.send("DOM.enable");var o=yield e.send("DOM.resolveNode",{nodeId:Number(t)}),r=o?.object;if(!r)throw Error(`Node ${t} not found`);if("value"in r)return r.value;if(!r.objectId)throw Error(`Node ${t} did not resolve to metadata`);var n=yield e.send("Runtime.getProperties",{objectId:r.objectId,ownProperties:!0}),i=n.result,a=n.exceptionDetails;if(a)throw Error(a.text||`Cannot read node ${t}`);return(void 0===i?[]:i).reduce((e,t)=>(e[t.name]=(e=>{if(e)return"value"in e?e.value:e.unserializableValue||e.description})(t.value),e),{})}),function(e,t){return l.apply(this,arguments)}),ec=(u=M(function*(e,{subspaceId:t,brickId:o}){var r=t,n=o,i={};if(el(t)){var a=yield eu(e,t);if(r=a.subspaceId||(String(a.shortId||"").startsWith("S_")?a.shortId:null),i.subspaceNodeId=Number(t),!r)throw Error(`Node ${t} is not inside a BRICKS subspace`)}if(el(o)){var s=yield eu(e,o);if(n=s.brickId||(String(s.shortId||"").startsWith("B_")?s.shortId:null),!el(t)&&s.subspaceId&&(r=s.subspaceId),i.brickNodeId=Number(o),!n)throw Error(`Node ${o} is not a BRICKS brick`)}return{subspaceId:r,brickId:n,...i}}),function(e,t){return u.apply(this,arguments)}),ed=(c=M(function*(e,t,{json:o,successMessage:r,jsonResult:n}){yield e.send("Runtime.enable");var i=yield e.send("Runtime.evaluate",{expression:t,objectGroup:"console",returnByValue:!0,awaitPromise:!0});if(i.exceptionDetails){var a=i.exceptionDetails;throw Error(a.exception?.description||a.exception?.value||a.text||"Runtime evaluation failed")}o?console.log(JSON.stringify({success:!0,...n},null,2)):console.log(J.default.green(r))}),function(e,t,o){return c.apply(this,arguments)}),ep=e=>{if(!e)return{};for(var t={},o=0;o<e.length;o+=2)t[e[o]]=e[o+1];return t},ef=e=>{if(!e)return null;var t=e.nodeName||e.localName||"unknown",o=e.id||e.shortId;o&&(t+=`#${o}`),e.title&&(t+=` "${e.title}"`);var r=[];return e.nodeId&&r.push(`node ${e.nodeId}`),e.shortId&&e.shortId!==o&&r.push(e.shortId),e.brickId&&e.brickId!==e.shortId&&r.push(e.brickId),e.templateKey&&r.push(e.templateKey),r.length>0?`${t} (${r.join(", ")})`:t},eg=(e,t="",o=!0,r=!0)=>{var n=[],i=r?"":o?" ":"│ ",a=e.nodeName||"#unknown";if(9===e.nodeType)a="#document";else if(3===e.nodeType){var s=e.nodeValue||"";a=J.default.gray(`"${s}"`)}else if(1===e.nodeType){var l=ep(e.attributes),u=l.id||l["short-id"];u&&(a+=J.default.gray(`#${u}`)),l.title&&(a+=` ${J.default.green(`"${l.title}"`)}`),void 0!==l.w&&void 0!==l.h&&(a+=J.default.blue(` ${l.w}\xd7${l.h}`),void 0!==l.x&&void 0!==l.y&&(a+=J.default.blue(` @${l.x},${l.y}`)));var c=[];void 0!==l.hide&&c.push(J.default.red("hidden")),void 0!==l.pressable&&c.push(J.default.yellow("pressable")),void 0!==l.editable&&c.push(J.default.yellow("editable")),c.length>0&&(a+=` [${c.join(", ")}]`)}n.push(`${t}${r?"":o?"└─ ":"├─ "}${a}`);var d=e.children||[];return d.forEach((e,o)=>{n.push(...eg(e,t+i,o===d.length-1,!1))}),n};er.command("issue-token").description("Issue a workspace-scoped DevTools access token and save it to the CLI config (used automatically by devtools commands)").option("--ttl <seconds>","Time-to-live in seconds (default 30 days)",e=>parseInt(e,10)).option("-j, --json","Output as JSON").action((d=M(function*(e){var t=yield Promise.resolve().then(o.bind(o,47988)),r=t.getCurrentProfile,n=t.getTokenInfo,i=t.getBaseUrl,a=t.CONFIG_PATH,s=(yield Promise.all([o.e(6370),o.e(5785),o.e(3332),o.e(2209),o.e(907)]).then(o.bind(o,85382))).createClient,l=(yield o.e(4305).then(o.bind(o,7944))).getOrIssueDevtoolsToken,u=r(),c=n(u);c?.token||(console.error(J.default.red("Not logged in. Use `bricks auth login` first.")),process.exit(1));var d=s(i(),c.token);try{var p=yield l({profile:u,client:d,ttlSeconds:e.ttl,force:!0});if(e.json)return void console.log(JSON.stringify({profile:u,workspaceId:p.workspaceId,expiresAt:p.expiresAt,jti:p.jti},null,2));console.log(J.default.green("✓"),"DevTools access token issued and saved."),console.log(` Profile: ${u}`),console.log(` Workspace: ${p.workspaceId}`),console.log(` Expires: ${p.expiresAt}`),console.log(` jti: ${J.default.gray(p.jti)}`),console.log(J.default.gray(` Saved to ${a}`))}catch(e){console.error(J.default.red(`Issue token failed: ${e.message}`)),process.exit(1)}}),function(e){return d.apply(this,arguments)})),er.command("scan").description("Scan LAN for DevTools servers via UDP + HTTP").option("-t, --timeout <ms>","Scan timeout in milliseconds","3000").option("-j, --json","Output as JSON").option("--verify","Verify each discovered server via HTTP").option("--udp-only","Skip HTTP subnet probe (UDP only)").option("--no-project","Exclude local BRICKS project preview servers").option("-p, --port <port>","Port for HTTP probe","19851").action((p=M(function*(e){var t=(yield Promise.resolve().then(o.bind(o,30155))).default,r=yield Promise.resolve().then(o.bind(o,47988)),n=r.getCurrentProfile,i=r.getTokenInfo,a=parseInt(e.timeout,10),s=t(`Scanning for DevTools servers (${a}ms)...`).start();try{var l=yield K({timeout:a,verify:!!e.verify,udpOnly:!!e.udpOnly,project:!!e.project,port:parseInt(e.port,10),onStatus:e=>{s.text=e}});if(0===l.length){e.json?(s.stop(),console.log(JSON.stringify([],null,2))):s.info("No DevTools servers found on the network."),process.exit(0);return}s.stop(),e.json&&(console.log(JSON.stringify(l,null,2)),process.exit(0));var u=n(),c=i(u),d=c?.workspaceId||null;console.log(J.default.bold(`
74
74
  Found ${l.length} DevTools server(s)`)),console.log("─".repeat(80));var p=function*(e){var t=!1===e.verified?J.default.red("unverified"):J.default.green("online"),o=ee(e),r=et(o),n=(e.protocols||[]).map(e=>J.default.cyan(e)).join(", "),i=e.workspaceId&&d&&e.workspaceId===d,a=e.addresses||[e.address],s=a.filter(t=>t!==e.address),l=s.length>0?`${e.address}:${e.port} +${s.length} more`:`${e.address}:${e.port}`;if(console.log(` ${J.default.bold(e.name||"Unknown")} ${J.default.gray(`(${l})`)} [${t}]`),s.length>0&&console.log(` Addresses: ${a.map(e=>J.default.gray(e)).join(", ")}`),e.version&&console.log(` Version: ${J.default.green(e.version)}`),e.chromeInspect){var u=e.passcode?J.default.cyan(e.passcode):J.default.gray("no passcode");console.log(` Chrome Inspect: ${J.default.green("supported")} (passcode: ${u})`)}var c=` Protocols: ${n||J.default.gray("none")} Auth: ${r}`;if(e.deviceId&&(c+=` Device: ${J.default.gray(e.deviceId)}`),console.log(c),e.workspaceId){var p=i?J.default.green(`${e.workspaceId} (current profile)`):J.default.gray(e.workspaceId);console.log(` Workspace: ${p}`)}};for(var f of l)yield*p(f);console.log("─".repeat(80));var g=l[0],h=`${g.address}:${g.port||19851}`,m=ee(g),D=g.passcode?`/ws/${encodeURIComponent(g.passcode)}`:"workspace-jwt"===m?"/ws/<workspace-token>":"/ws/<passcode>";console.log(J.default.gray(`
75
75
  Connect via: http://${h}/devtools-frontend/inspector.html?ws=${h}${D}`)),console.log(J.default.gray(`Legacy: devtools://devtools/bundled/inspector.html?ws=${h}${D}`)),process.exit(0)}catch(e){s.fail(`Scan failed: ${e.message}`),process.exit(1)}}),function(e){return p.apply(this,arguments)})),er.command("open <address>").description("Show DevTools server information").option("-p, --port <port>",`Server port (default: ${z})`).option("--info","Show connection URLs").action((f=M(function*(e,t){var r=(yield Promise.resolve().then(o.bind(o,30155))).default,n=(yield Promise.resolve().then(o.bind(o,75646))).verifyDevToolsServer,i=X(e),a=i.host??Q,s=parseInt(t.port??i.port??z,10),l=`${a}:${s}`,u=r(`Fetching server info from ${l}...`).start(),c=yield n(a,s);c||(u.fail(`Could not reach DevTools server at ${l}`),process.exit(1)),u.stop();var d=yield V(a,s),p=d?W(d?.[0]?.webSocketDebuggerUrl):null,f=ee(c),g=p?`/ws/${encodeURIComponent(p)}`:"workspace-jwt"===f?"/ws/<workspace-token>":"/ws/<passcode>";if(t.info){console.log(J.default.bold("Connection URLs")),console.log("─".repeat(60)),console.log(` Web UI: ${J.default.cyan(`http://${l}`)}`),console.log(` CDP: ${J.default.cyan(`http://${l}/devtools-frontend/inspector.html?ws=${l}${g}`)}`),console.log(` CDP legacy: ${J.default.cyan(`devtools://devtools/bundled/inspector.html?ws=${l}${g}`)}`),console.log(` MCP: ${J.default.cyan(`http://${l}/mcp`)}`),console.log(` MCP SSE: ${J.default.cyan(`http://${l}/sse`)}`),console.log(` Info: ${J.default.cyan(`http://${l}/devtools/info`)}`),console.log("─".repeat(60)),console.log(),console.log(J.default.bold("Authorization")),c.auth?.workspaceJwt?.enabled&&console.log(` Workspace JWT: ${J.default.green("enabled")} (kid: ${c.auth.workspaceJwt.kid})`),p&&console.log(` Passcode: ${J.default.cyan(p)}`),console.log(" MCP and MCP SSE require a Bearer token header:"),console.log(` ${J.default.gray(`Authorization: Bearer ${c.auth?.workspaceJwt?.enabled?"<workspace-token>":p||"<passcode>"}`)}`);return}if(console.log(J.default.bold("DevTools Server")),console.log("─".repeat(60)),console.log(` Name: ${J.default.cyan(c.name||"Unknown")}`),console.log(` Version: ${c.version?J.default.green(c.version):J.default.gray("N/A")}`),console.log(` Device ID: ${J.default.gray(c.deviceId||"N/A")}`),console.log(` Workspace: ${J.default.gray(c.workspaceId||"N/A")}`),console.log(` Protocols: ${(c.protocols||[]).map(e=>J.default.cyan(e)).join(", ")||J.default.gray("none")}`),console.log(` Auth: ${et(f)}`),console.log(` Port: ${c.port}`),d){var h=p?J.default.cyan(p):J.default.gray("no passcode");console.log(` Inspect: ${J.default.green("chrome://inspect supported")} (passcode: ${h})`)}else console.log(` Inspect: ${J.default.gray("chrome://inspect not available")}`);console.log("─".repeat(60)),c.version&&!Z(c.version)&&console.log(J.default.yellow(`
76
76
  CDP commands require version >= ${Y}`)),console.log(J.default.gray(`
77
- Use --info to see connection URLs`))}),function(e,t){return f.apply(this,arguments)})),en(er.command("screenshot").description("Capture device screenshot").option("-o, --output <path>","Output file path")).action((g=M(function*(e){var t;yield ei(e,(t=M(function*(t){var r=yield t.send("Page.captureScreenshot",{format:"png"});r.data||(console.error(J.default.red("No screenshot data received")),process.exit(1));var n=yield Promise.resolve().then(o.t.bind(o,73024,19)),i=yield Promise.resolve().then(o.t.bind(o,76760,19)),a=e.output||`screenshot-${Date.now()}.png`,s=i.resolve(a);n.writeFileSync(s,Buffer.from(r.data,"base64")),console.log(J.default.green(`Screenshot saved to ${s}`))}),function(e){return t.apply(this,arguments)}))}),function(e){return g.apply(this,arguments)}));var eh=er.command("brick").description("Brick component inspection");en(eh.command("tree").description("Print brick component tree").option("-d, --depth <depth>","Max depth (-1 for full)","3")).action((h=M(function*(e){var t;yield ei(e,(t=M(function*(t){yield t.send("DOM.enable");var o=parseInt(e.depth,10),r=(yield t.send("DOM.getDocument",{depth:o})).root;e.json?console.log(JSON.stringify(r,null,2)):console.log(eg(r).join("\n"))}),function(e){return t.apply(this,arguments)}))}),function(e){return h.apply(this,arguments)})),en(eh.command("query <selector>").description("Find brick by CSS selector")).action((m=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield o.send("DOM.enable");var r=(yield o.send("DOM.getDocument",{depth:0})).root,n=(yield o.send("DOM.querySelector",{nodeId:r.nodeId,selector:e})).nodeId;if(0===n)return void console.log(J.default.yellow("No element found"));var i=yield o.send("DOM.describeNode",{nodeId:n}),a=ep((yield o.send("DOM.getAttributes",{nodeId:n})).attributes);if(t.json)return void console.log(JSON.stringify({nodeId:n,...i.node,attributes:a},null,2));if(console.log(J.default.bold(`Node ${n}: ${i.node?.nodeName||"unknown"}`)),Object.keys(a).length>0)for(var s of(console.log(J.default.bold("Attributes:")),Object.entries(a))){var l=R(s,2),u=l[0],c=l[1];console.log(` ${J.default.cyan(u)}: ${c}`)}}),function(e){return o.apply(this,arguments)}))}),function(e,t){return m.apply(this,arguments)})),en(eh.command("query-all <selector>").description("Find all bricks matching CSS selector")).action((D=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield o.send("DOM.enable");var r=(yield o.send("DOM.getDocument",{depth:0})).root,n=(yield o.send("DOM.querySelectorAll",{nodeId:r.nodeId,selector:e})).nodeIds;if(t.json)return void console.log(JSON.stringify({nodeIds:n,count:n.length},null,2));for(var i of(console.log(J.default.bold(`Found ${n.length} element(s)`)),n)){var a=yield o.send("DOM.describeNode",{nodeId:i}),s=ep((yield o.send("DOM.getAttributes",{nodeId:i})).attributes),l=s.id||s["short-id"]||"";console.log(` ${i}: ${a.node?.nodeName}${l?J.default.gray(`#${l}`):""}`)}}),function(e){return o.apply(this,arguments)}))}),function(e,t){return D.apply(this,arguments)})),en(eh.command("attributes <nodeId>").description("Get brick attributes")).action((y=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield o.send("DOM.enable");var r=parseInt(e,10),n=ep((yield o.send("DOM.getAttributes",{nodeId:r})).attributes);if(t.json)return void console.log(JSON.stringify(n,null,2));if(0===Object.keys(n).length)return void console.log(J.default.gray("No attributes"));for(var i of Object.entries(n)){var a=R(i,2),s=a[0],l=a[1];console.log(` ${J.default.cyan(s)}: ${l}`)}}),function(e){return o.apply(this,arguments)}))}),function(e,t){return y.apply(this,arguments)})),en(eh.command("box-model <nodeId>").description("Get brick dimensions and position")).action((v=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield o.send("DOM.enable");var r=parseInt(e,10),n=(yield o.send("DOM.getBoxModel",{nodeId:r})).model;t.json?console.log(JSON.stringify(n,null,2)):(console.log(J.default.bold(`Box Model for node ${r}`)),console.log(` Width: ${n.width}`),console.log(` Height: ${n.height}`),n.content&&console.log(` Content: [${n.content.join(", ")}]`),n.padding&&console.log(` Padding: [${n.padding.join(", ")}]`),n.border&&console.log(` Border: [${n.border.join(", ")}]`),n.margin&&console.log(` Margin: [${n.margin.join(", ")}]`))}),function(e){return o.apply(this,arguments)}))}),function(e,t){return v.apply(this,arguments)})),en(eh.command("resolve <nodeId>").description("Resolve brick to JavaScript object with properties")).action((b=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield o.send("DOM.enable");var r=parseInt(e,10),n=(yield o.send("DOM.resolveNode",{nodeId:r})).object;if(t.json)return void console.log(JSON.stringify(n,null,2));if(console.log(J.default.bold(`Resolved node ${r}`)),console.log(` Type: ${n.type}`),n.className&&console.log(` Class: ${n.className}`),n.description&&console.log(` Description: ${n.description}`),n.objectId&&console.log(` Object ID: ${J.default.gray(n.objectId)}`),n.preview?.properties)for(var i of(console.log(J.default.bold(" Properties:")),n.preview.properties))console.log(` ${J.default.cyan(i.name)}: ${i.value}`)}),function(e){return o.apply(this,arguments)}))}),function(e,t){return b.apply(this,arguments)})),en(eh.command("focus <nodeId>").description("Focus a brick element")).action((F=M(function*(e,t){var o;yield ei(t,(o=M(function*(t){yield t.send("DOM.enable");var o=parseInt(e,10);yield t.send("DOM.focus",{nodeId:o}),console.log(J.default.green(`Focused node ${o}`))}),function(e){return o.apply(this,arguments)}))}),function(e,t){return F.apply(this,arguments)})),en(eh.command("input <subspaceId> <brickId> <text...>").description("Set text on a BRICK_TEXT_INPUT by subspace/brick id or node id")).action((_=M(function*(e,t,o,r){var n,i=Array.isArray(o)?o.join(" "):o;yield ei(r,(n=M(function*(o){var n=yield ec(o,{subspaceId:e,brickId:t});yield ed(o,(({subspaceId:e,brickId:t,text:o})=>ea({subspaceId:e,handler:t,action:"BRICK_TEXT_INPUT_SET_TEXT",parameters:{BRICK_TEXT_INPUT_TEXT:o}}))({...n,text:i}),{json:r.json,successMessage:`Set text on ${n.brickId}`,jsonResult:{...n,action:"BRICK_TEXT_INPUT_SET_TEXT",text:i}})}),function(e){return n.apply(this,arguments)}))}),function(e,t,o,r){return _.apply(this,arguments)}));var em=er.command("input").description("Input emulation");en(em.command("tap <x> <y>").description("Tap/click at coordinates")).action((C=M(function*(e,t,o){var r;yield ei(o,(r=M(function*(r){var n=parseFloat(e),i=parseFloat(t),a=yield r.send("Input.dispatchMouseEvent",{type:"mousePressed",x:n,y:i,button:"left",clickCount:1});yield r.send("Input.dispatchMouseEvent",{type:"mouseReleased",x:n,y:i,button:"left",clickCount:1}),(({x:e,y:t,tapResult:o,json:r})=>{if(r)return console.log(JSON.stringify({x:e,y:t,...o||{}},null,2));console.log(J.default.green(`Tapped at (${e}, ${t})`));var n=ef(o?.element||o?.tappedElement||o?.hitElement);if(!n)return console.log(J.default.yellow(" Element: none"));console.log(` Element: ${n}`);var i=o?.hitElement,a=o?.tappedElement;if(i&&a&&i.nodeId!==a.nodeId){var s=ef(i);s&&console.log(` Hit: ${s}`)}o&&!1===o.dispatched&&console.log(J.default.yellow(" Action: no pressable handler"))})({x:n,y:i,tapResult:a,json:o.json})}),function(e){return r.apply(this,arguments)}))}),function(e,t,o){return C.apply(this,arguments)})),en(em.command("key <key>").description("Dispatch key event (e.g., Enter, Escape, Tab)")).action(($=M(function*(e,t){var o;yield ei(t,(o=M(function*(t){yield t.send("Input.dispatchKeyEvent",{type:"keyDown",key:e}),yield t.send("Input.dispatchKeyEvent",{type:"keyUp",key:e}),console.log(J.default.green(`Key: ${e}`))}),function(e){return o.apply(this,arguments)}))}),function(e,t){return $.apply(this,arguments)})),en(er.command("popup").description("System popup and alert control").command("close [popupId]").description("Close the current system alert/popup, or a popup by id/type").option("--type <type>","Popup clear type for SYSTEM POPUP_RESET").option("--subspace <subspaceId>","Subspace id to execute from (defaults to first subspace)")).action((E=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield ed(o,(({subspaceId:e,popupId:t,clearType:o})=>{var r={};return t&&(r.POPUP_ID=t),o&&(r.POPUP_CLEAR_TYPE=o),ea({subspaceId:e,handler:"SYSTEM",action:"POPUP_RESET",parameters:r})})({subspaceId:t.subspace,popupId:e,clearType:t.type}),{json:t.json,successMessage:e?`Closed popup ${e}`:"Closed current popup",jsonResult:{subspaceId:t.subspace||null,popupId:e||null,clearType:t.type||null,action:"POPUP_RESET"}})}),function(e){return o.apply(this,arguments)}))}),function(e,t){return E.apply(this,arguments)}));var eD=er.command("network").description("Network inspection");en(eD.command("list").description("Capture snapshot of network activity").option("--duration <ms>","Capture duration in milliseconds","2000")).action((w=M(function*(e){var t;yield ei(e,(t=M(function*(t){var o=new Map,r=parseInt(e.duration,10);t.on("Network.requestWillBeSent",e=>{o.set(e.requestId,{method:e.request.method,url:e.request.url,requestId:e.requestId,timestamp:e.timestamp})}),t.on("Network.responseReceived",e=>{var t=o.get(e.requestId);t&&(t.status=e.response.status,t.mimeType=e.response.mimeType)}),t.on("Network.loadingFailed",e=>{var t=o.get(e.requestId);t&&(t.error=e.errorText)}),yield t.send("Network.enable"),yield new Promise(e=>setTimeout(e,r)),yield t.send("Network.disable");var n=[...o.values()];if(e.json)return void console.log(JSON.stringify(n,null,2));if(console.log(J.default.bold(`Network Activity (captured ${(r/1e3).toFixed(1)}s, ${n.length} requests)`)),0===n.length)return void console.log(J.default.gray(" No network activity captured"));for(var i of n){var a=i.error?J.default.red("ERR"):i.status?i.status<300?J.default.green(i.status):i.status<400?J.default.yellow(i.status):J.default.red(i.status):J.default.gray("..."),s=i.url.length>60?i.url.substring(0,57)+"...":i.url;console.log(` ${a} ${J.default.bold(i.method.padEnd(6))} ${s} ${J.default.gray(`(${i.requestId})`)}`)}}),function(e){return t.apply(this,arguments)}))}),function(e){return w.apply(this,arguments)})),en(eD.command("get <requestId>").description("Get response body for a network request")).action((k=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield o.send("Network.enable");var r=yield o.send("Network.getResponseBody",{requestId:e}),n=r.body,i=r.base64Encoded;t.json?console.log(JSON.stringify({body:n,base64Encoded:i},null,2)):i?console.log(J.default.gray(`[base64 encoded, ${n.length} chars]`)):console.log(n)}),function(e){return o.apply(this,arguments)}))}),function(e,t){return k.apply(this,arguments)}));var ey="bricks://app",ev="DATA-",eb="properties",eF="entries",e_=e=>{if(null==e||"object"!=typeof e)return{value:e};if("value"in e)return{value:e.value};if("unserializableValue"in e)return{value:e.unserializableValue};if(e.objectId){var t=e.preview?.properties;return Array.isArray(t)&&t.length>0?{value:t.reduce((e,t)=>(e[t.name]=t.value,e),{}),byRef:!0}:{value:e.description||`[${e.type}]`,byRef:!0}}return{value:"undefined"===e.type?void 0:e.description}},eC=e=>{var t=e.startsWith(ev)?e.slice(ev.length):e,o=t.indexOf(":");return o<0?{shortId:t,title:null}:{shortId:t.slice(0,o),title:t.slice(o+1)}},e$=e=>{if(e.startsWith("global:"))return{scope:"global",name:e.slice(7)};if(e.startsWith("subspace:")){var t=e.slice(9),o=t.indexOf(":");return o>0?{scope:"subspace",subspaceUuid:t.slice(0,o),name:t.slice(o+1)}:{scope:"subspace",subspaceUuid:t,name:""}}return{scope:null,name:e}},eE=(e=[])=>{var t=new Map,o=new Map,r=new Set;for(var n of e||[])if(n&&"object"==typeof n){var i=n.shortId,a=n.uuid;i&&r.add(i),a&&(r.add(a),t.set(a,n),o.set(a,a),i&&o.set(i,a))}return{byUuid:t,uuidByScope:o,knownScopes:r}},ew=(e=[])=>e?.byUuid&&e?.uuidByScope&&e?.knownScopes?e:eE(e),ek=(S=M(function*(e){try{var t=yield e.send("Runtime.evaluate",{expression:"JSON.stringify(Object.values(system.subspaces()).map((s) => ({ shortId: s.shortId, uuid: s.uuid, title: s.title })))",objectGroup:"console",returnByValue:!0}),o=t.result;if(t.exceptionDetails||"string"!=typeof o?.value)return[];return JSON.parse(o.value)}catch{return[]}}),function(e){return S.apply(this,arguments)}),eS=(e,{full:t=!1,width:o=100}={})=>{var r="string"==typeof e?e:JSON.stringify(e);return void 0===r?J.default.gray("undefined"):t||r.length<=o?r:`${r.substring(0,o)}…`},ex=(e,t)=>{var o=ew(t),r=e.subspaceUuid?o.byUuid.get(e.subspaceUuid):null;return{key:e.rawKey,scope:e.scope,...e.subspaceUuid?{subspaceUuid:e.subspaceUuid}:{},...r?.shortId?{subspaceShortId:r.shortId}:{},name:e.name,value:e.value}},eO=(x=M(function*(e,{databaseName:t,objectStoreName:o,options:r}){var n=parseInt(r.skip??"0",10)||0,i=parseInt(r.limit??"25",10)||25,a=null;try{a=(yield e.send("IndexedDB.getMetadata",{securityOrigin:ey,databaseName:t,objectStoreName:o})).entriesCount}catch{}var s=yield e.send("IndexedDB.requestData",{securityOrigin:ey,databaseName:t,objectStoreName:o,indexName:"",skipCount:n,pageSize:i,returnByValue:!0}),l=s.objectStoreDataEntries,u=s.hasMore,c=!1,d=l.map(e=>{var t=e_(e.key).value,o=e_(e.value),r=o.value;return o.byRef&&(c=!0),{key:t,value:r}});if(r.json)return void console.log(JSON.stringify({database:t,objectStore:o,skip:n,limit:i,total:a,hasMore:!!u,entries:d},null,2));var p=null==a?"":` of ${a}`,f=n>0?`, skipped ${n}`:"";for(var g of(console.log(J.default.bold(`${t} / ${o} (${d.length}${p} entries${f})`)),console.log("─".repeat(60)),0===d.length&&console.log(J.default.gray(" No entries")),d)){var h=g.key,m=g.value,D="string"==typeof h?h:JSON.stringify(h);console.log(` ${J.default.cyan(D)}: ${eS(m,{full:!!r.full})}`)}u&&console.log(J.default.gray(" …more entries available — use -l/--limit and -s/--skip")),c&&console.log(J.default.yellow("\n Some values came back as object handles (device app without by-value reads).\n Update the device app to see full values."))}),function(e,t){return x.apply(this,arguments)}),eA=e=>e.option("-l, --limit <count>","Max items to fetch","25").option("-s, --skip <count>","Items to skip","0").option("--full","Do not truncate values"),ej=er.command("storage").description("Storage inspection (read-only — CDP cannot mutate device storage)");en(ej.command("list").description("Overview of all storage stores with entry counts")).action((O=M(function*(e){var t;yield ei(e,(t=M(function*(t){yield t.send("DOMStorage.enable"),yield t.send("IndexedDB.enable");var o,r=(o=M(function*(e){return(yield t.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ey,isLocalStorage:e}})).entries.length}),function(e){return o.apply(this,arguments)}),n=yield r(!0),i=yield r(!1),a=(yield t.send("IndexedDB.requestDatabaseNames",{securityOrigin:ey})).databaseNames,s=[];for(var l of a){var u=l.startsWith(ev)?eb:eF,c=null;try{c=(yield t.send("IndexedDB.getMetadata",{securityOrigin:ey,databaseName:l,objectStoreName:u})).entriesCount}catch{}s.push({name:l,objectStoreName:u,entriesCount:c})}var d=s.filter(e=>e.name.startsWith(ev)).map(e=>({...e,...eC(e.name)})),p=s.filter(e=>!e.name.startsWith(ev));if(e.json)return void console.log(JSON.stringify({system:{persist:n,memory:i},dataBanks:d,caches:p},null,2));var f=e=>null==e?J.default.gray("? entries"):`${e} entries`;for(var g of(console.log(J.default.bold("Storage Overview")+J.default.gray(" (read-only)")),console.log("─".repeat(60)),console.log(` ${J.default.bold("System storage")}${J.default.gray(" → storage system persist|memory")}`),console.log(` persist ${f(n)}`),console.log(` memory ${f(i)}`),console.log(` ${J.default.bold("Data banks")}${J.default.gray(" → storage data-bank get <S_xxxx|title>")}`),0===d.length&&console.log(J.default.gray(" none")),d)){var h=g.title?` "${g.title}"`:"";console.log(` ${J.default.cyan(g.shortId)}${h} ${f(g.entriesCount)}`)}for(var m of(console.log(` ${J.default.bold("Caches")}${J.default.gray(" → storage cache generator|generative-media")}`),0===p.length&&console.log(J.default.gray(" none")),p))console.log(` ${J.default.cyan(m.name)} ${f(m.entriesCount)}`);console.log("─".repeat(60))}),function(e){return t.apply(this,arguments)}))}),function(e){return O.apply(this,arguments)}));var eI=ej.command("system").description("System key-value storage"),eB=e=>e.option("--scope <scope>","Filter by scope: global or a subspace S_xxxx/UUID").option("--prefix <prefix>","Filter by key-name prefix (within the scope)").option("--full","Do not truncate values"),eN=(e,t)=>{var o;return o=M(function*(o){var r;yield ei(o,(r=M(function*(r){yield r.send("DOMStorage.enable");var n=(yield r.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ey,isLocalStorage:e}})).entries,i=yield ek(r),a=eE(i),s=((e,{scope:t,prefix:o,subspaceIndex:r=[]}={})=>{var n=ew(r),i=t&&"global"!==t?n.uuidByScope.get(t)||t:null;return e.map(([e,t])=>({rawKey:e,value:t,...e$(e)})).filter(e=>("global"!==t||"global"===e.scope)&&(!i||"subspace"===e.scope&&e.subspaceUuid===i)&&(!o||!!e.name.startsWith(o)))})(n,{scope:o.scope,prefix:o.prefix,subspaceIndex:a});if(o.json)return void console.log(JSON.stringify(s.map(e=>ex(e,a)),null,2));if(((e,{label:t,subspaceIndex:o,full:r})=>{var n=ew(o);if(console.log(J.default.bold(`${t} (${e.length} items)`)),console.log("─".repeat(60)),0===e.length)return console.log(J.default.gray(" No entries"));var i=null;for(var a of e){var s="subspace"===a.scope?`subspace:${a.subspaceUuid}`:a.scope;if(s!==i)if(i=s,"subspace"===a.scope){var l=n.byUuid.get(a.subspaceUuid),u=l?`${l.shortId}${l.title?` "${l.title}"`:""} `:"";console.log(` ${J.default.bold(`subspace ${u}`)}${J.default.gray(`(${a.subspaceUuid})`)}`)}else console.log(` ${J.default.bold(a.scope||"other")}`);var c=a.name||a.rawKey;console.log(` ${J.default.cyan(c)}: ${eS(a.value,{full:r,width:80})}`)}})(s,{label:t,subspaceIndex:a,full:!!o.full}),0===s.length&&o.scope&&"global"!==o.scope&&!a.knownScopes.has(o.scope)){var l=i.map(e=>e.shortId).join(", ");console.log(J.default.yellow(` Scope "${o.scope}" did not match a known subspace${l?` (known: ${l})`:""}`))}}),function(e){return r.apply(this,arguments)}))}),function(e){return o.apply(this,arguments)}};eB(en(eI.command("persist").description("Show persistent system storage entries"))).action(eN(!0,"Persistent Storage")),eB(en(eI.command("memory").description("Show in-memory system storage entries"))).action(eN(!1,"Memory Storage")),en(eI.command("get <key>").description("Show a single system storage value (full, untruncated)").option("--scope <scope>","Key scope: global (default) or a subspace S_xxxx/UUID","global").option("--memory","Read from in-memory storage instead of persistent")).action((A=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield o.send("DOMStorage.enable");var r=(yield o.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ey,isLocalStorage:!t.memory}})).entries,n=eE((yield ek(o))),i=[e];if("global"===t.scope)i.push(`global:${e}`);else{var a=n.uuidByScope.get(t.scope)||t.scope;i.push(`subspace:${a}:${e}`)}var s=r.map(([e,t])=>({rawKey:e,value:t,...e$(e)})).find(e=>i.includes(e.rawKey));if(!s){var l=r.map(([e])=>e).filter(t=>t.toLowerCase().includes(e.toLowerCase())).slice(0,5);if(l.length>0)for(var u of(console.error(J.default.yellow("Similar keys:")),l))console.error(` ${u}`);throw Error(`Key not found: ${i[i.length-1]}`)}if(t.json)return void console.log(JSON.stringify(ex(s,n),null,2));if("string"==typeof s.value)try{console.log(JSON.stringify(JSON.parse(s.value),null,2));return}catch{}console.log("string"==typeof s.value?s.value:JSON.stringify(s.value,null,2))}),function(e){return o.apply(this,arguments)}))}),function(e,t){return A.apply(this,arguments)}));var eP=ej.command("data-bank").description("Data bank (Property Bank) stores");en(eP.command("list").description("List data banks")).action((j=M(function*(e){var t;yield ei(e,(t=M(function*(t){yield t.send("IndexedDB.enable");var o=(yield t.send("IndexedDB.requestDatabaseNames",{securityOrigin:ey})).databaseNames,r=[];for(var n of o.filter(e=>e.startsWith(ev))){var i=null;try{i=(yield t.send("IndexedDB.getMetadata",{securityOrigin:ey,databaseName:n,objectStoreName:eb})).entriesCount}catch{}r.push({name:n,...eC(n),entriesCount:i})}if(e.json)return void console.log(JSON.stringify(r,null,2));for(var a of(console.log(J.default.bold(`Data Banks (${r.length})`)),console.log("─".repeat(60)),0===r.length&&console.log(J.default.gray(" No data banks")),r)){var s=a.title?` ${J.default.green(`"${a.title}"`)}`:"",l=null===a.entriesCount||void 0===a.entriesCount?"":J.default.gray(` ${a.entriesCount} entries`);console.log(` ${J.default.cyan(a.shortId)}${s}${l}`)}console.log(J.default.gray("\nInspect: bricks devtools storage data-bank get <S_xxxx|title>"))}),function(e){return t.apply(this,arguments)}))}),function(e){return j.apply(this,arguments)})),eA(en(eP.command("get <bank> [store]").description(`Show data bank entries — <bank> accepts a subspace S_xxxx, a title keyword, or the full DATA-* database name; [store] defaults to "${eb}"`))).action((I=M(function*(e,t,o){var r;yield ei(o,(r=M(function*(r){yield r.send("IndexedDB.enable");var n=(yield r.send("IndexedDB.requestDatabaseNames",{securityOrigin:ey})).databaseNames,i=((e,t)=>{var o=e.filter(e=>e.startsWith(ev)),r=o.find(e=>e===t||e===`${ev}${t}`);if(r)return{match:r};if(t.startsWith("S_")){var n=o.filter(e=>eC(e).shortId===t);if(1===n.length)return{match:n[0]};if(n.length>1)return{candidates:n}}var i=t.toLowerCase(),a=o.filter(e=>e.slice(ev.length).toLowerCase().includes(i));return 1===a.length?{match:a[0]}:{candidates:a}})(n,e);if(!i.match){var a=n.filter(e=>e.startsWith(ev)),s=(i.candidates?.length||0)>1,l=s?i.candidates:a;for(var u of(console.error(J.default.yellow(s?`Data bank "${e}" is ambiguous. Candidates:`:`Data bank "${e}" not found. Available:`)),l)){var c=eC(u),d=c.shortId,p=c.title;console.error(` ${d}${p?` "${p}"`:""}`)}process.exit(1)}yield eO(r,{databaseName:i.match,objectStoreName:t||eb,options:o})}),function(e){return r.apply(this,arguments)}))}),function(e,t,o){return I.apply(this,arguments)}));var eT=ej.command("cache").description("Cache stores (generator, generative-media)"),eR=e=>{var t;return t=M(function*(t){var o;yield ei(t,(o=M(function*(o){yield o.send("IndexedDB.enable"),yield eO(o,{databaseName:e,objectStoreName:eF,options:t})}),function(e){return o.apply(this,arguments)}))}),function(e){return t.apply(this,arguments)}};eA(en(eT.command("generator").description("Show generator cache entries"))).action(eR("GENERATOR_CACHE")),eA(en(eT.command("generative-media").description("Show generative media cache entries"))).action(eR("GENERATIVE_MEDIA_CACHE")),eA(en(ej.command("generator-cache",{hidden:!0}).description("Alias of `storage cache generator`"))).action(eR("GENERATOR_CACHE"));var eM=er.command("runtime").description("Runtime and evaluation");en(eM.command("eval <expression>").description("Evaluate JavaScript expression").option("--await","Await promise result")).action((B=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield o.send("Runtime.enable");var r=yield o.send("Runtime.evaluate",{expression:e,objectGroup:"console",returnByValue:!0,awaitPromise:!!t.await,generatePreview:!0});if(t.json)return void console.log(JSON.stringify(r,null,2));r.exceptionDetails&&(console.error(J.default.red(`Error: ${r.exceptionDetails.text}`)),r.exceptionDetails.exception?.description&&console.error(J.default.red(r.exceptionDetails.exception.description)),process.exit(1));var n=r.result;"undefined"===n.type?console.log(J.default.gray("undefined")):void 0!==n.value?console.log("object"==typeof n.value?JSON.stringify(n.value,null,2):String(n.value)):n.description?console.log(n.description):console.log(J.default.gray(`[${n.type}${n.subtype?`:${n.subtype}`:""}]`))}),function(e){return o.apply(this,arguments)}))}),function(e,t){return B.apply(this,arguments)})),en(eM.command("properties <objectId>").description("Get properties of a remote object")).action((N=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){var r=(yield o.send("Runtime.getProperties",{objectId:e,ownProperties:!0})).result;if(t.json)return void console.log(JSON.stringify(r,null,2));for(var n of(console.log(J.default.bold(`Properties of ${e}`)),r))if(n.enumerable){var i=n.value,a=i?.description||i?.value?.toString()||J.default.gray(`[${i?.type}]`);console.log(` ${J.default.cyan(n.name)}: ${a}`)}}),function(e){return o.apply(this,arguments)}))}),function(e,t){return N.apply(this,arguments)}));var eU=er.command("simulator").description("Inspect simulated peripherals (Application Simulator / web preview servers only)").command("thermal-printer").description("Simulated thermal printers and their print results"),eJ="This DevTools server does not expose simulator inspection. Connect to an Application Simulator preview (e.g. the CTOR project simulator) running a preview build with the Simulator CDP domain.",eL=e=>{if(!e)return"unknown time";var t=new Date(e);return Number.isNaN(t.getTime())?"unknown time":t.toLocaleString()},eq=e=>{if(e.raw)return"raw data";var t=(e=>{if(!e?.length)return"";var t=[];for(var o of e){var r=t[t.length-1];r&&r.type===o?r.count+=1:t.push({type:o,count:1})}return t.map(({type:e,count:t})=>t>1?`${e}\xd7${t}`:e).join(", ")})(e.commandTypes);return`${e.commandCount} command(s)${t?`: ${t}`:""}`};en(eU.command("list").description("List simulated thermal printers and their print history").option("--commands","Include full print command payloads (use with -j)")).action((P=M(function*(e){var t;yield ei(e,(t=M(function*(t){var o=yield t.send("Simulator.listThermalPrinters",{includeCommands:!!e.commands}),r=o?.printers;if(Array.isArray(r)||(console.error(J.default.red(eJ)),process.exit(1)),e.json)return void console.log(JSON.stringify(r,null,2));if(0===r.length){console.log(J.default.yellow("No simulated thermal printers registered.")),console.log(J.default.gray("A printer appears once the application configures GENERATOR_THERMAL_PRINTER."));return}for(var n of(console.log(J.default.bold(`Simulated Thermal Printers (${r.length})`)),console.log("─".repeat(60)),r)){var i=n.errored?J.default.red("fault"):n.connected?J.default.green("connected"):J.default.gray("idle");console.log(` ${J.default.bold(n.label||n.driver)} ${J.default.gray(`(${n.driver})`)} [${i}]`),console.log(` Printer ID: ${J.default.cyan(n.id)}`),n.connectString&&console.log(` Connect: ${J.default.gray(n.connectString)}`);var a=n.printHistory||[];if(0===a.length){console.log(J.default.gray(" No print results yet."));continue}var s="memory"===n.printHistorySource?J.default.gray(" (restored from memory)"):"";for(var l of(console.log(` Print results, newest first${s}:`),a))console.log(` --index ${l.index} ${eL(l.printedAt)} ${J.default.gray(eq(l))}`)}console.log("─".repeat(60)),console.log(J.default.gray("Save one as PNG: bricks devtools simulator thermal-printer print-result"))}),function(e){return t.apply(this,arguments)}))}),function(e){return P.apply(this,arguments)})),en(eU.command("print-result").description("Render a simulated print result to a PNG image").option("--printer <id>","Printer ID (see `list`; defaults to the only registered printer)").option("-i, --index <n>","Print history index, 0 = latest","0").option("--scale <factor>","Image scale factor (1-4)","2").option("-o, --output <path>","Output file path")).action((T=M(function*(e){var t;yield ei(e,(t=M(function*(t){var r=yield t.send("Simulator.captureThermalPrinterPrintResult",{id:e.printer,index:parseInt(e.index,10)||0,scale:parseFloat(e.scale)||2},3e4);r?.data||(console.error(J.default.red(eJ)),process.exit(1));var n=yield Promise.resolve().then(o.t.bind(o,73024,19)),i=yield Promise.resolve().then(o.t.bind(o,76760,19)),a=e.output||`print-result-${Date.now()}.png`,s=i.resolve(a);(n.writeFileSync(s,Buffer.from(r.data,"base64")),e.json)?console.log(JSON.stringify({path:s,id:r.id,driver:r.driver,label:r.label,index:r.index,printedAt:r.printedAt,width:r.width,height:r.height},null,2)):(console.log(J.default.green(`Print result saved to ${s}`)),console.log(` Printer: ${r.label} ${J.default.gray(`(${r.driver}, ${r.id})`)}`),console.log(` Printed: ${eL(r.printedAt)} (--index ${r.index})`),r.width&&r.height&&console.log(` Size: ${r.width}\xd7${r.height}`))}),function(e){return t.apply(this,arguments)}))}),function(e){return T.apply(this,arguments)}))},70970(e,t,o){o.d(t,{l:()=>s});var r=o(99436),n=o(35679),i=o(7586),a=()=>Promise.all([o.e(370),o.e(785),o.e(332),o.e(209),o.e(907),o.e(486)]).then(o.bind(o,421)),s=(({loadDoctorModule:e=a}={})=>{var t;return new n.uB("doctor").description("Check CLI configuration, auth state, and workspace reachability").option("-j, --json","Output as JSON").action((t=r(function*(t){try{var o=yield e(),r=o.buildDoctorReport,n=o.renderDoctorReport,a=yield r();if(t.json)return void(0,i.GF)(a);console.log(n(a))}catch(e){t.json?(0,i.OW)(e.message):console.error(`Doctor failed: ${e.message}`),process.exit(1)}}),function(e){return t.apply(this,arguments)}))})()},28634(e,t,o){o.d(t,{p:()=>_});var r,n,i,a,s,l,u,c=o(68832),d=o(99436),p=o(35679),f=o(73284),g=o(30155),h=o(7586),m=o(56493),D=o(68168),y=o(98593),v=e=>{if(!e)return f.default.gray("○");var t=Date.now()-new Date(e).getTime();return t<=3e5?f.default.green("●"):60>Math.floor(t/6e4)?f.default.yellow("○"):f.default.red("○")},b=(e,t)=>(0,y.H_)(e,t,{deviceCount:e?.devices?.length||0}),F=["refresh","clear-cache","system-menu-open","system-menu-close","system-info-open","system-info-close","local-sync-panel-open","local-sync-panel-close","debug-panel-open","debug-panel-close","logging-on","logging-off","test-panel-open","test-panel-close"],_=new p.uB("group").description("Device Group management");_.command("list").description("List all device groups").option("-j, --json","Output as JSON").action((r=d(function*(e){var t=(0,m.requireAuth)(),o=(0,g.default)("Fetching device groups...").start();try{var r=yield t.deviceGroups({});if(o.stop(),e.json)return void console.log(JSON.stringify(r,null,2));if(!r||0===r.length)return void console.log(f.default.yellow("No device groups found"));console.log(f.default.bold("\nDevice Groups")),console.log("─".repeat(80)),r.forEach(e=>{var t=e.devices?.length||0;console.log(`● ${f.default.cyan(e.name)} ${f.default.gray(`(${t} devices)`)}`),console.log(` ID: ${f.default.gray(e._id)}`),e.description&&console.log(` ${f.default.gray(e.description)}`),console.log()})}catch(e){o.fail(`Failed to list groups: ${e.message}`),process.exit(1)}}),function(e){return r.apply(this,arguments)})),_.command("get <id>").description("Get device group details").option("-j, --json","Output as JSON").action((n=d(function*(e,t){var o=(0,m.requireAuth)(),r=(0,g.default)("Fetching device group...").start();try{var n=yield o.deviceGroup({id:e});if(r.stop(),n||(console.log(f.default.red("Device group not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(n,null,2));console.log(f.default.bold(`
77
+ Use --info to see connection URLs`))}),function(e,t){return f.apply(this,arguments)})),en(er.command("screenshot").description("Capture device screenshot").option("-o, --output <path>","Output file path")).action((g=M(function*(e){var t;yield ei(e,(t=M(function*(t){var r=yield t.send("Page.captureScreenshot",{format:"png"});r.data||(console.error(J.default.red("No screenshot data received")),process.exit(1));var n=yield Promise.resolve().then(o.t.bind(o,73024,19)),i=yield Promise.resolve().then(o.t.bind(o,76760,19)),a=e.output||`screenshot-${Date.now()}.png`,s=i.resolve(a);n.writeFileSync(s,Buffer.from(r.data,"base64")),console.log(J.default.green(`Screenshot saved to ${s}`))}),function(e){return t.apply(this,arguments)}))}),function(e){return g.apply(this,arguments)}));var eh=er.command("brick").description("Brick component inspection");en(eh.command("tree").description("Print brick component tree").option("-d, --depth <depth>","Max depth (-1 for full)","3")).action((h=M(function*(e){var t;yield ei(e,(t=M(function*(t){yield t.send("DOM.enable");var o=parseInt(e.depth,10),r=(yield t.send("DOM.getDocument",{depth:o})).root;e.json?console.log(JSON.stringify(r,null,2)):console.log(eg(r).join("\n"))}),function(e){return t.apply(this,arguments)}))}),function(e){return h.apply(this,arguments)})),en(eh.command("query <selector>").description("Find brick by CSS selector")).action((m=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield o.send("DOM.enable");var r=(yield o.send("DOM.getDocument",{depth:0})).root,n=(yield o.send("DOM.querySelector",{nodeId:r.nodeId,selector:e})).nodeId;if(0===n)return void console.log(J.default.yellow("No element found"));var i=yield o.send("DOM.describeNode",{nodeId:n}),a=ep((yield o.send("DOM.getAttributes",{nodeId:n})).attributes);if(t.json)return void console.log(JSON.stringify({nodeId:n,...i.node,attributes:a},null,2));if(console.log(J.default.bold(`Node ${n}: ${i.node?.nodeName||"unknown"}`)),Object.keys(a).length>0)for(var s of(console.log(J.default.bold("Attributes:")),Object.entries(a))){var l=R(s,2),u=l[0],c=l[1];console.log(` ${J.default.cyan(u)}: ${c}`)}}),function(e){return o.apply(this,arguments)}))}),function(e,t){return m.apply(this,arguments)})),en(eh.command("query-all <selector>").description("Find all bricks matching CSS selector")).action((D=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield o.send("DOM.enable");var r=(yield o.send("DOM.getDocument",{depth:0})).root,n=(yield o.send("DOM.querySelectorAll",{nodeId:r.nodeId,selector:e})).nodeIds;if(t.json)return void console.log(JSON.stringify({nodeIds:n,count:n.length},null,2));for(var i of(console.log(J.default.bold(`Found ${n.length} element(s)`)),n)){var a=yield o.send("DOM.describeNode",{nodeId:i}),s=ep((yield o.send("DOM.getAttributes",{nodeId:i})).attributes),l=s.id||s["short-id"]||"";console.log(` ${i}: ${a.node?.nodeName}${l?J.default.gray(`#${l}`):""}`)}}),function(e){return o.apply(this,arguments)}))}),function(e,t){return D.apply(this,arguments)})),en(eh.command("attributes <nodeId>").description("Get brick attributes")).action((y=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield o.send("DOM.enable");var r=parseInt(e,10),n=ep((yield o.send("DOM.getAttributes",{nodeId:r})).attributes);if(t.json)return void console.log(JSON.stringify(n,null,2));if(0===Object.keys(n).length)return void console.log(J.default.gray("No attributes"));for(var i of Object.entries(n)){var a=R(i,2),s=a[0],l=a[1];console.log(` ${J.default.cyan(s)}: ${l}`)}}),function(e){return o.apply(this,arguments)}))}),function(e,t){return y.apply(this,arguments)})),en(eh.command("box-model <nodeId>").description("Get brick dimensions and position")).action((v=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield o.send("DOM.enable");var r=parseInt(e,10),n=(yield o.send("DOM.getBoxModel",{nodeId:r})).model;t.json?console.log(JSON.stringify(n,null,2)):(console.log(J.default.bold(`Box Model for node ${r}`)),console.log(` Width: ${n.width}`),console.log(` Height: ${n.height}`),n.content&&console.log(` Content: [${n.content.join(", ")}]`),n.padding&&console.log(` Padding: [${n.padding.join(", ")}]`),n.border&&console.log(` Border: [${n.border.join(", ")}]`),n.margin&&console.log(` Margin: [${n.margin.join(", ")}]`))}),function(e){return o.apply(this,arguments)}))}),function(e,t){return v.apply(this,arguments)})),en(eh.command("resolve <nodeId>").description("Resolve brick to JavaScript object with properties")).action((b=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield o.send("DOM.enable");var r=parseInt(e,10),n=(yield o.send("DOM.resolveNode",{nodeId:r})).object;if(t.json)return void console.log(JSON.stringify(n,null,2));if(console.log(J.default.bold(`Resolved node ${r}`)),console.log(` Type: ${n.type}`),n.className&&console.log(` Class: ${n.className}`),n.description&&console.log(` Description: ${n.description}`),n.objectId&&console.log(` Object ID: ${J.default.gray(n.objectId)}`),n.preview?.properties)for(var i of(console.log(J.default.bold(" Properties:")),n.preview.properties))console.log(` ${J.default.cyan(i.name)}: ${i.value}`)}),function(e){return o.apply(this,arguments)}))}),function(e,t){return b.apply(this,arguments)})),en(eh.command("focus <nodeId>").description("Focus a brick element")).action((F=M(function*(e,t){var o;yield ei(t,(o=M(function*(t){yield t.send("DOM.enable");var o=parseInt(e,10);yield t.send("DOM.focus",{nodeId:o}),console.log(J.default.green(`Focused node ${o}`))}),function(e){return o.apply(this,arguments)}))}),function(e,t){return F.apply(this,arguments)})),en(eh.command("input <subspaceId> <brickId> <text...>").description("Set text on a BRICK_TEXT_INPUT by subspace/brick id or node id")).action((_=M(function*(e,t,o,r){var n,i=Array.isArray(o)?o.join(" "):o;yield ei(r,(n=M(function*(o){var n=yield ec(o,{subspaceId:e,brickId:t});yield ed(o,(({subspaceId:e,brickId:t,text:o})=>ea({subspaceId:e,handler:t,action:"BRICK_TEXT_INPUT_SET_TEXT",parameters:{BRICK_TEXT_INPUT_TEXT:o}}))({...n,text:i}),{json:r.json,successMessage:`Set text on ${n.brickId}`,jsonResult:{...n,action:"BRICK_TEXT_INPUT_SET_TEXT",text:i}})}),function(e){return n.apply(this,arguments)}))}),function(e,t,o,r){return _.apply(this,arguments)}));var em=er.command("input").description("Input emulation");en(em.command("tap <x> <y>").description("Tap/click at coordinates")).action((C=M(function*(e,t,o){var r;yield ei(o,(r=M(function*(r){var n=parseFloat(e),i=parseFloat(t),a=yield r.send("Input.dispatchMouseEvent",{type:"mousePressed",x:n,y:i,button:"left",clickCount:1});yield r.send("Input.dispatchMouseEvent",{type:"mouseReleased",x:n,y:i,button:"left",clickCount:1}),(({x:e,y:t,tapResult:o,json:r})=>{if(r)return console.log(JSON.stringify({x:e,y:t,...o||{}},null,2));console.log(J.default.green(`Tapped at (${e}, ${t})`));var n=ef(o?.element||o?.tappedElement||o?.hitElement);if(!n)return console.log(J.default.yellow(" Element: none"));console.log(` Element: ${n}`);var i=o?.hitElement,a=o?.tappedElement;if(i&&a&&i.nodeId!==a.nodeId){var s=ef(i);s&&console.log(` Hit: ${s}`)}o&&!1===o.dispatched&&console.log(J.default.yellow(" Action: no pressable handler"))})({x:n,y:i,tapResult:a,json:o.json})}),function(e){return r.apply(this,arguments)}))}),function(e,t,o){return C.apply(this,arguments)})),en(em.command("key <key>").description("Dispatch key event (e.g., Enter, Escape, Tab)")).action(($=M(function*(e,t){var o;yield ei(t,(o=M(function*(t){yield t.send("Input.dispatchKeyEvent",{type:"keyDown",key:e}),yield t.send("Input.dispatchKeyEvent",{type:"keyUp",key:e}),console.log(J.default.green(`Key: ${e}`))}),function(e){return o.apply(this,arguments)}))}),function(e,t){return $.apply(this,arguments)})),en(er.command("popup").description("System popup and alert control").command("close [popupId]").description("Close the current system alert/popup, or a popup by id/type").option("--type <type>","Popup clear type for SYSTEM POPUP_RESET").option("--subspace <subspaceId>","Subspace id to execute from (defaults to first subspace)")).action((E=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield ed(o,(({subspaceId:e,popupId:t,clearType:o})=>{var r={};return t&&(r.POPUP_ID=t),o&&(r.POPUP_CLEAR_TYPE=o),ea({subspaceId:e,handler:"SYSTEM",action:"POPUP_RESET",parameters:r})})({subspaceId:t.subspace,popupId:e,clearType:t.type}),{json:t.json,successMessage:e?`Closed popup ${e}`:"Closed current popup",jsonResult:{subspaceId:t.subspace||null,popupId:e||null,clearType:t.type||null,action:"POPUP_RESET"}})}),function(e){return o.apply(this,arguments)}))}),function(e,t){return E.apply(this,arguments)}));var eD=er.command("network").description("Network inspection");en(eD.command("list").description("Capture snapshot of network activity").option("--duration <ms>","Capture duration in milliseconds","2000")).action((w=M(function*(e){var t;yield ei(e,(t=M(function*(t){var o=new Map,r=parseInt(e.duration,10);t.on("Network.requestWillBeSent",e=>{o.set(e.requestId,{method:e.request.method,url:e.request.url,requestId:e.requestId,timestamp:e.timestamp})}),t.on("Network.responseReceived",e=>{var t=o.get(e.requestId);t&&(t.status=e.response.status,t.mimeType=e.response.mimeType)}),t.on("Network.loadingFailed",e=>{var t=o.get(e.requestId);t&&(t.error=e.errorText)}),yield t.send("Network.enable"),yield new Promise(e=>setTimeout(e,r)),yield t.send("Network.disable");var n=[...o.values()];if(e.json)return void console.log(JSON.stringify(n,null,2));if(console.log(J.default.bold(`Network Activity (captured ${(r/1e3).toFixed(1)}s, ${n.length} requests)`)),0===n.length)return void console.log(J.default.gray(" No network activity captured"));for(var i of n){var a=i.error?J.default.red("ERR"):i.status?i.status<300?J.default.green(i.status):i.status<400?J.default.yellow(i.status):J.default.red(i.status):J.default.gray("..."),s=i.url.length>60?i.url.substring(0,57)+"...":i.url;console.log(` ${a} ${J.default.bold(i.method.padEnd(6))} ${s} ${J.default.gray(`(${i.requestId})`)}`)}}),function(e){return t.apply(this,arguments)}))}),function(e){return w.apply(this,arguments)})),en(eD.command("get <requestId>").description("Get response body for a network request")).action((k=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield o.send("Network.enable");var r=yield o.send("Network.getResponseBody",{requestId:e}),n=r.body,i=r.base64Encoded;t.json?console.log(JSON.stringify({body:n,base64Encoded:i},null,2)):i?console.log(J.default.gray(`[base64 encoded, ${n.length} chars]`)):console.log(n)}),function(e){return o.apply(this,arguments)}))}),function(e,t){return k.apply(this,arguments)}));var ey="bricks://app",ev="DATA-",eb="properties",eF="entries",e_=e=>{if(null==e||"object"!=typeof e)return{value:e};if("value"in e)return{value:e.value};if("unserializableValue"in e)return{value:e.unserializableValue};if(e.objectId){var t=e.preview?.properties;return Array.isArray(t)&&t.length>0?{value:t.reduce((e,t)=>(e[t.name]=t.value,e),{}),byRef:!0}:{value:e.description||`[${e.type}]`,byRef:!0}}return{value:"undefined"===e.type?void 0:e.description}},eC=e=>{var t=e.startsWith(ev)?e.slice(ev.length):e,o=t.indexOf(":");return o<0?{shortId:t,title:null}:{shortId:t.slice(0,o),title:t.slice(o+1)}},e$=e=>{if(e.startsWith("global:"))return{scope:"global",name:e.slice(7)};if(e.startsWith("subspace:")){var t=e.slice(9),o=t.indexOf(":");return o>0?{scope:"subspace",subspaceUuid:t.slice(0,o),name:t.slice(o+1)}:{scope:"subspace",subspaceUuid:t,name:""}}return{scope:null,name:e}},eE=(e=[])=>{var t=new Map,o=new Map,r=new Set;for(var n of e||[])if(n&&"object"==typeof n){var i=n.shortId,a=n.uuid;i&&r.add(i),a&&(r.add(a),t.set(a,n),o.set(a,a),i&&o.set(i,a))}return{byUuid:t,uuidByScope:o,knownScopes:r}},ew=(e=[])=>e?.byUuid&&e?.uuidByScope&&e?.knownScopes?e:eE(e),ek=(S=M(function*(e){try{var t=yield e.send("Runtime.evaluate",{expression:"JSON.stringify(Object.values(system.subspaces()).map((s) => ({ shortId: s.shortId, uuid: s.uuid, title: s.title })))",objectGroup:"console",returnByValue:!0}),o=t.result;if(t.exceptionDetails||"string"!=typeof o?.value)return[];return JSON.parse(o.value)}catch{return[]}}),function(e){return S.apply(this,arguments)}),eS=(e,{full:t=!1,width:o=100}={})=>{var r="string"==typeof e?e:JSON.stringify(e);return void 0===r?J.default.gray("undefined"):t||r.length<=o?r:`${r.substring(0,o)}…`},ex=(e,t)=>{var o=ew(t),r=e.subspaceUuid?o.byUuid.get(e.subspaceUuid):null;return{key:e.rawKey,scope:e.scope,...e.subspaceUuid?{subspaceUuid:e.subspaceUuid}:{},...r?.shortId?{subspaceShortId:r.shortId}:{},name:e.name,value:e.value}},eO=(x=M(function*(e,{databaseName:t,objectStoreName:o,options:r}){var n=parseInt(r.skip??"0",10)||0,i=parseInt(r.limit??"25",10)||25,a=null;try{a=(yield e.send("IndexedDB.getMetadata",{securityOrigin:ey,databaseName:t,objectStoreName:o})).entriesCount}catch{}var s=yield e.send("IndexedDB.requestData",{securityOrigin:ey,databaseName:t,objectStoreName:o,indexName:"",skipCount:n,pageSize:i,returnByValue:!0}),l=s.objectStoreDataEntries,u=s.hasMore,c=!1,d=l.map(e=>{var t=e_(e.key).value,o=e_(e.value),r=o.value;return o.byRef&&(c=!0),{key:t,value:r}});if(r.json)return void console.log(JSON.stringify({database:t,objectStore:o,skip:n,limit:i,total:a,hasMore:!!u,entries:d},null,2));var p=null==a?"":` of ${a}`,f=n>0?`, skipped ${n}`:"";for(var g of(console.log(J.default.bold(`${t} / ${o} (${d.length}${p} entries${f})`)),console.log("─".repeat(60)),0===d.length&&console.log(J.default.gray(" No entries")),d)){var h=g.key,m=g.value,D="string"==typeof h?h:JSON.stringify(h);console.log(` ${J.default.cyan(D)}: ${eS(m,{full:!!r.full})}`)}u&&console.log(J.default.gray(" …more entries available — use -l/--limit and -s/--skip")),c&&console.log(J.default.yellow("\n Some values came back as object handles (device app without by-value reads).\n Update the device app to see full values."))}),function(e,t){return x.apply(this,arguments)}),eA=e=>e.option("-l, --limit <count>","Max items to fetch","25").option("-s, --skip <count>","Items to skip","0").option("--full","Do not truncate values"),ej=er.command("storage").description("Storage inspection (read-only — CDP cannot mutate device storage)");en(ej.command("list").description("Overview of all storage stores with entry counts")).action((O=M(function*(e){var t;yield ei(e,(t=M(function*(t){yield t.send("DOMStorage.enable"),yield t.send("IndexedDB.enable");var o,r=(o=M(function*(e){return(yield t.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ey,isLocalStorage:e}})).entries.length}),function(e){return o.apply(this,arguments)}),n=yield r(!0),i=yield r(!1),a=(yield t.send("IndexedDB.requestDatabaseNames",{securityOrigin:ey})).databaseNames,s=[];for(var l of a){var u=l.startsWith(ev)?eb:eF,c=null;try{c=(yield t.send("IndexedDB.getMetadata",{securityOrigin:ey,databaseName:l,objectStoreName:u})).entriesCount}catch{}s.push({name:l,objectStoreName:u,entriesCount:c})}var d=s.filter(e=>e.name.startsWith(ev)).map(e=>({...e,...eC(e.name)})),p=s.filter(e=>!e.name.startsWith(ev));if(e.json)return void console.log(JSON.stringify({system:{persist:n,memory:i},dataBanks:d,caches:p},null,2));var f=e=>null==e?J.default.gray("? entries"):`${e} entries`;for(var g of(console.log(J.default.bold("Storage Overview")+J.default.gray(" (read-only)")),console.log("─".repeat(60)),console.log(` ${J.default.bold("System storage")}${J.default.gray(" → storage system persist|memory")}`),console.log(` persist ${f(n)}`),console.log(` memory ${f(i)}`),console.log(` ${J.default.bold("Data banks")}${J.default.gray(" → storage data-bank get <S_xxxx|title>")}`),0===d.length&&console.log(J.default.gray(" none")),d)){var h=g.title?` "${g.title}"`:"";console.log(` ${J.default.cyan(g.shortId)}${h} ${f(g.entriesCount)}`)}for(var m of(console.log(` ${J.default.bold("Caches")}${J.default.gray(" → storage cache generator|generative-media")}`),0===p.length&&console.log(J.default.gray(" none")),p))console.log(` ${J.default.cyan(m.name)} ${f(m.entriesCount)}`);console.log("─".repeat(60))}),function(e){return t.apply(this,arguments)}))}),function(e){return O.apply(this,arguments)}));var eI=ej.command("system").description("System key-value storage"),eB=e=>e.option("--scope <scope>","Filter by scope: global or a subspace S_xxxx/UUID").option("--prefix <prefix>","Filter by key-name prefix (within the scope)").option("--full","Do not truncate values"),eN=(e,t)=>{var o;return o=M(function*(o){var r;yield ei(o,(r=M(function*(r){yield r.send("DOMStorage.enable");var n=(yield r.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ey,isLocalStorage:e}})).entries,i=yield ek(r),a=eE(i),s=((e,{scope:t,prefix:o,subspaceIndex:r=[]}={})=>{var n=ew(r),i=t&&"global"!==t?n.uuidByScope.get(t)||t:null;return e.map(([e,t])=>({rawKey:e,value:t,...e$(e)})).filter(e=>("global"!==t||"global"===e.scope)&&(!i||"subspace"===e.scope&&e.subspaceUuid===i)&&(!o||!!e.name.startsWith(o)))})(n,{scope:o.scope,prefix:o.prefix,subspaceIndex:a});if(o.json)return void console.log(JSON.stringify(s.map(e=>ex(e,a)),null,2));if(((e,{label:t,subspaceIndex:o,full:r})=>{var n=ew(o);if(console.log(J.default.bold(`${t} (${e.length} items)`)),console.log("─".repeat(60)),0===e.length)return console.log(J.default.gray(" No entries"));var i=null;for(var a of e){var s="subspace"===a.scope?`subspace:${a.subspaceUuid}`:a.scope;if(s!==i)if(i=s,"subspace"===a.scope){var l=n.byUuid.get(a.subspaceUuid),u=l?`${l.shortId}${l.title?` "${l.title}"`:""} `:"";console.log(` ${J.default.bold(`subspace ${u}`)}${J.default.gray(`(${a.subspaceUuid})`)}`)}else console.log(` ${J.default.bold(a.scope||"other")}`);var c=a.name||a.rawKey;console.log(` ${J.default.cyan(c)}: ${eS(a.value,{full:r,width:80})}`)}})(s,{label:t,subspaceIndex:a,full:!!o.full}),0===s.length&&o.scope&&"global"!==o.scope&&!a.knownScopes.has(o.scope)){var l=i.map(e=>e.shortId).join(", ");console.log(J.default.yellow(` Scope "${o.scope}" did not match a known subspace${l?` (known: ${l})`:""}`))}}),function(e){return r.apply(this,arguments)}))}),function(e){return o.apply(this,arguments)}};eB(en(eI.command("persist").description("Show persistent system storage entries"))).action(eN(!0,"Persistent Storage")),eB(en(eI.command("memory").description("Show in-memory system storage entries"))).action(eN(!1,"Memory Storage")),en(eI.command("get <key>").description("Show a single system storage value (full, untruncated)").option("--scope <scope>","Key scope: global (default) or a subspace S_xxxx/UUID","global").option("--memory","Read from in-memory storage instead of persistent")).action((A=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield o.send("DOMStorage.enable");var r=(yield o.send("DOMStorage.getDOMStorageItems",{storageId:{securityOrigin:ey,isLocalStorage:!t.memory}})).entries,n=eE((yield ek(o))),i=[e];if("global"===t.scope)i.push(`global:${e}`);else{var a=n.uuidByScope.get(t.scope)||t.scope;i.push(`subspace:${a}:${e}`)}var s=r.map(([e,t])=>({rawKey:e,value:t,...e$(e)})).find(e=>i.includes(e.rawKey));if(!s){var l=r.map(([e])=>e).filter(t=>t.toLowerCase().includes(e.toLowerCase())).slice(0,5);if(l.length>0)for(var u of(console.error(J.default.yellow("Similar keys:")),l))console.error(` ${u}`);throw Error(`Key not found: ${i[i.length-1]}`)}if(t.json)return void console.log(JSON.stringify(ex(s,n),null,2));if("string"==typeof s.value)try{console.log(JSON.stringify(JSON.parse(s.value),null,2));return}catch{}console.log("string"==typeof s.value?s.value:JSON.stringify(s.value,null,2))}),function(e){return o.apply(this,arguments)}))}),function(e,t){return A.apply(this,arguments)}));var eP=ej.command("data-bank").description("Data bank (Property Bank) stores");en(eP.command("list").description("List data banks")).action((j=M(function*(e){var t;yield ei(e,(t=M(function*(t){yield t.send("IndexedDB.enable");var o=(yield t.send("IndexedDB.requestDatabaseNames",{securityOrigin:ey})).databaseNames,r=[];for(var n of o.filter(e=>e.startsWith(ev))){var i=null;try{i=(yield t.send("IndexedDB.getMetadata",{securityOrigin:ey,databaseName:n,objectStoreName:eb})).entriesCount}catch{}r.push({name:n,...eC(n),entriesCount:i})}if(e.json)return void console.log(JSON.stringify(r,null,2));for(var a of(console.log(J.default.bold(`Data Banks (${r.length})`)),console.log("─".repeat(60)),0===r.length&&console.log(J.default.gray(" No data banks")),r)){var s=a.title?` ${J.default.green(`"${a.title}"`)}`:"",l=null===a.entriesCount||void 0===a.entriesCount?"":J.default.gray(` ${a.entriesCount} entries`);console.log(` ${J.default.cyan(a.shortId)}${s}${l}`)}console.log(J.default.gray("\nInspect: bricks devtools storage data-bank get <S_xxxx|title>"))}),function(e){return t.apply(this,arguments)}))}),function(e){return j.apply(this,arguments)})),eA(en(eP.command("get <bank> [store]").description(`Show data bank entries — <bank> accepts a subspace S_xxxx, a title keyword, or the full DATA-* database name; [store] defaults to "${eb}"`))).action((I=M(function*(e,t,o){var r;yield ei(o,(r=M(function*(r){yield r.send("IndexedDB.enable");var n=(yield r.send("IndexedDB.requestDatabaseNames",{securityOrigin:ey})).databaseNames,i=((e,t)=>{var o=e.filter(e=>e.startsWith(ev)),r=o.find(e=>e===t||e===`${ev}${t}`);if(r)return{match:r};if(t.startsWith("S_")){var n=o.filter(e=>eC(e).shortId===t);if(1===n.length)return{match:n[0]};if(n.length>1)return{candidates:n}}var i=t.toLowerCase(),a=o.filter(e=>e.slice(ev.length).toLowerCase().includes(i));return 1===a.length?{match:a[0]}:{candidates:a}})(n,e);if(!i.match){var a=n.filter(e=>e.startsWith(ev)),s=(i.candidates?.length||0)>1,l=s?i.candidates:a;for(var u of(console.error(J.default.yellow(s?`Data bank "${e}" is ambiguous. Candidates:`:`Data bank "${e}" not found. Available:`)),l)){var c=eC(u),d=c.shortId,p=c.title;console.error(` ${d}${p?` "${p}"`:""}`)}process.exit(1)}yield eO(r,{databaseName:i.match,objectStoreName:t||eb,options:o})}),function(e){return r.apply(this,arguments)}))}),function(e,t,o){return I.apply(this,arguments)}));var eT=ej.command("cache").description("Cache stores (generator, generative-media)"),eR=e=>{var t;return t=M(function*(t){var o;yield ei(t,(o=M(function*(o){yield o.send("IndexedDB.enable"),yield eO(o,{databaseName:e,objectStoreName:eF,options:t})}),function(e){return o.apply(this,arguments)}))}),function(e){return t.apply(this,arguments)}};eA(en(eT.command("generator").description("Show generator cache entries"))).action(eR("GENERATOR_CACHE")),eA(en(eT.command("generative-media").description("Show generative media cache entries"))).action(eR("GENERATIVE_MEDIA_CACHE")),eA(en(ej.command("generator-cache",{hidden:!0}).description("Alias of `storage cache generator`"))).action(eR("GENERATOR_CACHE"));var eM=er.command("runtime").description("Runtime and evaluation");en(eM.command("eval <expression>").description("Evaluate JavaScript expression").option("--await","Await promise result")).action((B=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){yield o.send("Runtime.enable");var r=yield o.send("Runtime.evaluate",{expression:e,objectGroup:"console",returnByValue:!0,awaitPromise:!!t.await,generatePreview:!0});if(t.json)return void console.log(JSON.stringify(r,null,2));r.exceptionDetails&&(console.error(J.default.red(`Error: ${r.exceptionDetails.text}`)),r.exceptionDetails.exception?.description&&console.error(J.default.red(r.exceptionDetails.exception.description)),process.exit(1));var n=r.result;"undefined"===n.type?console.log(J.default.gray("undefined")):void 0!==n.value?console.log("object"==typeof n.value?JSON.stringify(n.value,null,2):String(n.value)):n.description?console.log(n.description):console.log(J.default.gray(`[${n.type}${n.subtype?`:${n.subtype}`:""}]`))}),function(e){return o.apply(this,arguments)}))}),function(e,t){return B.apply(this,arguments)})),en(eM.command("properties <objectId>").description("Get properties of a remote object")).action((N=M(function*(e,t){var o;yield ei(t,(o=M(function*(o){var r=(yield o.send("Runtime.getProperties",{objectId:e,ownProperties:!0})).result;if(t.json)return void console.log(JSON.stringify(r,null,2));for(var n of(console.log(J.default.bold(`Properties of ${e}`)),r))if(n.enumerable){var i=n.value,a=i?.description||i?.value?.toString()||J.default.gray(`[${i?.type}]`);console.log(` ${J.default.cyan(n.name)}: ${a}`)}}),function(e){return o.apply(this,arguments)}))}),function(e,t){return N.apply(this,arguments)}));var eU=er.command("simulator").description("Inspect simulated peripherals (Application Simulator / web preview servers only)").command("thermal-printer").description("Simulated thermal printers and their print results"),eJ="This DevTools server does not expose simulator inspection. Connect to an Application Simulator preview (e.g. the CTOR project simulator) running a preview build with the Simulator CDP domain.",eL=e=>{if(!e)return"unknown time";var t=new Date(e);return Number.isNaN(t.getTime())?"unknown time":t.toLocaleString()},eq=e=>{if(e.raw)return"raw data";var t=(e=>{if(!e?.length)return"";var t=[];for(var o of e){var r=t[t.length-1];r&&r.type===o?r.count+=1:t.push({type:o,count:1})}return t.map(({type:e,count:t})=>t>1?`${e}\xd7${t}`:e).join(", ")})(e.commandTypes);return`${e.commandCount} command(s)${t?`: ${t}`:""}`};en(eU.command("list").description("List simulated thermal printers and their print history").option("--commands","Include full print command payloads (use with -j)")).action((P=M(function*(e){var t;yield ei(e,(t=M(function*(t){var o=yield t.send("Simulator.listThermalPrinters",{includeCommands:!!e.commands}),r=o?.printers;if(Array.isArray(r)||(console.error(J.default.red(eJ)),process.exit(1)),e.json)return void console.log(JSON.stringify(r,null,2));if(0===r.length){console.log(J.default.yellow("No simulated thermal printers registered.")),console.log(J.default.gray("A printer appears once the application configures GENERATOR_THERMAL_PRINTER."));return}for(var n of(console.log(J.default.bold(`Simulated Thermal Printers (${r.length})`)),console.log("─".repeat(60)),r)){var i=n.errored?J.default.red("fault"):n.connected?J.default.green("connected"):J.default.gray("idle");console.log(` ${J.default.bold(n.label||n.driver)} ${J.default.gray(`(${n.driver})`)} [${i}]`),console.log(` Printer ID: ${J.default.cyan(n.id)}`),n.connectString&&console.log(` Connect: ${J.default.gray(n.connectString)}`);var a=n.printHistory||[];if(0===a.length){console.log(J.default.gray(" No print results yet."));continue}var s="memory"===n.printHistorySource?J.default.gray(" (restored from memory)"):"";for(var l of(console.log(` Print results, newest first${s}:`),a))console.log(` --index ${l.index} ${eL(l.printedAt)} ${J.default.gray(eq(l))}`)}console.log("─".repeat(60)),console.log(J.default.gray("Save one as PNG: bricks devtools simulator thermal-printer print-result"))}),function(e){return t.apply(this,arguments)}))}),function(e){return P.apply(this,arguments)})),en(eU.command("print-result").description("Render a simulated print result to a PNG image").option("--printer <id>","Printer ID (see `list`; defaults to the only registered printer)").option("-i, --index <n>","Print history index, 0 = latest","0").option("--scale <factor>","Image scale factor (1-4)","2").option("-o, --output <path>","Output file path")).action((T=M(function*(e){var t;yield ei(e,(t=M(function*(t){var r=yield t.send("Simulator.captureThermalPrinterPrintResult",{id:e.printer,index:parseInt(e.index,10)||0,scale:parseFloat(e.scale)||2},3e4);r?.data||(console.error(J.default.red(eJ)),process.exit(1));var n=yield Promise.resolve().then(o.t.bind(o,73024,19)),i=yield Promise.resolve().then(o.t.bind(o,76760,19)),a=e.output||`print-result-${Date.now()}.png`,s=i.resolve(a);(n.writeFileSync(s,Buffer.from(r.data,"base64")),e.json)?console.log(JSON.stringify({path:s,id:r.id,driver:r.driver,label:r.label,index:r.index,printedAt:r.printedAt,width:r.width,height:r.height},null,2)):(console.log(J.default.green(`Print result saved to ${s}`)),console.log(` Printer: ${r.label} ${J.default.gray(`(${r.driver}, ${r.id})`)}`),console.log(` Printed: ${eL(r.printedAt)} (--index ${r.index})`),r.width&&r.height&&console.log(` Size: ${r.width}\xd7${r.height}`))}),function(e){return t.apply(this,arguments)}))}),function(e){return T.apply(this,arguments)}))},70970(e,t,o){o.d(t,{l:()=>s});var r=o(99436),n=o(35679),i=o(7586),a=()=>Promise.all([o.e(6370),o.e(5785),o.e(3332),o.e(2209),o.e(907),o.e(2486)]).then(o.bind(o,421)),s=(({loadDoctorModule:e=a}={})=>{var t;return new n.uB("doctor").description("Check CLI configuration, auth state, and workspace reachability").option("-j, --json","Output as JSON").action((t=r(function*(t){try{var o=yield e(),r=o.buildDoctorReport,n=o.renderDoctorReport,a=yield r();if(t.json)return void(0,i.GF)(a);console.log(n(a))}catch(e){t.json?(0,i.OW)(e.message):console.error(`Doctor failed: ${e.message}`),process.exit(1)}}),function(e){return t.apply(this,arguments)}))})()},28634(e,t,o){o.d(t,{p:()=>_});var r,n,i,a,s,l,u,c=o(68832),d=o(99436),p=o(35679),f=o(73284),g=o(30155),h=o(7586),m=o(56493),D=o(68168),y=o(98593),v=e=>{if(!e)return f.default.gray("○");var t=Date.now()-new Date(e).getTime();return t<=3e5?f.default.green("●"):60>Math.floor(t/6e4)?f.default.yellow("○"):f.default.red("○")},b=(e,t)=>(0,y.H_)(e,t,{deviceCount:e?.devices?.length||0}),F=["refresh","clear-cache","system-menu-open","system-menu-close","system-info-open","system-info-close","local-sync-panel-open","local-sync-panel-close","debug-panel-open","debug-panel-close","logging-on","logging-off","test-panel-open","test-panel-close"],_=new p.uB("group").description("Device Group management");_.command("list").description("List all device groups").option("-j, --json","Output as JSON").action((r=d(function*(e){var t=(0,m.requireAuth)(),o=(0,g.default)("Fetching device groups...").start();try{var r=yield t.deviceGroups({});if(o.stop(),e.json)return void console.log(JSON.stringify(r,null,2));if(!r||0===r.length)return void console.log(f.default.yellow("No device groups found"));console.log(f.default.bold("\nDevice Groups")),console.log("─".repeat(80)),r.forEach(e=>{var t=e.devices?.length||0;console.log(`● ${f.default.cyan(e.name)} ${f.default.gray(`(${t} devices)`)}`),console.log(` ID: ${f.default.gray(e._id)}`),e.description&&console.log(` ${f.default.gray(e.description)}`),console.log()})}catch(e){o.fail(`Failed to list groups: ${e.message}`),process.exit(1)}}),function(e){return r.apply(this,arguments)})),_.command("get <id>").description("Get device group details").option("-j, --json","Output as JSON").action((n=d(function*(e,t){var o=(0,m.requireAuth)(),r=(0,g.default)("Fetching device group...").start();try{var n=yield o.deviceGroup({id:e});if(r.stop(),n||(console.log(f.default.red("Device group not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(n,null,2));console.log(f.default.bold(`
78
78
  Device Group: ${n.name}`)),console.log("─".repeat(60)),console.log(`ID: ${f.default.gray(n._id)}`),console.log(`Description: ${n.description||f.default.gray("N/A")}`),console.log(`Tags: ${n.tags?.join(", ")||f.default.gray("None")}`),console.log(`Created: ${f.default.gray(n.create_datetime)}`),console.log(`Modified: ${f.default.gray(n.last_modify_datetime)}`),n.devices?.length>0&&(console.log(`
79
79
  ${f.default.bold("Devices")} (${n.devices.length})`),n.devices.forEach(e=>{var t=e.device_target_name||e.device_id;console.log(` - ${t} ${f.default.gray(`(${e.device_id})`)}`)})),console.log("─".repeat(60))}catch(e){r.fail(`Failed to get group: ${e.message}`),process.exit(1)}}),function(e,t){return n.apply(this,arguments)})),_.command("resolve <query>").description("Resolve a device group name or ID to stable IDs").option("-l, --limit <limit>","Limit search results",e=>Number.parseInt(e,10),10).option("-j, --json","Output as JSON").action((i=d(function*(e,t){var o=(0,m.requireAuth)(),r=t.json?null:(0,g.default)("Resolving device group...").start();try{var n=yield(0,D.Y)(()=>o.deviceGroup({id:e})),i=n?[n]:yield o.deviceGroups({paginate:{limit:t.limit}}),a=n?i:(i||[]).filter(t=>t.name?.toLowerCase().includes(e.trim().toLowerCase())),s=(0,D.K)({resource:"group",query:e,items:a||[],fields:["_id","name"],selectedBy:n?"id":null});if(r&&r.stop(),t.json)return void(0,h.GF)(s);if(s.resolved){var l=s.resolved;console.log(f.default.bold("\nResolved Device Group")),console.log("─".repeat(60)),console.log(`Name: ${f.default.cyan(l.name||"Unnamed")}`),console.log(`ID: ${f.default.gray(l._id)}`),console.log(`Selected By: ${s.selectedBy}`),console.log("─".repeat(60));return}if(0===s.matches.length)return void console.log(f.default.yellow(`No device groups matched "${e}"`));console.log(f.default.bold(`
80
80
  Matching Device Groups (${s.matches.length})`)),console.log("─".repeat(80)),s.matches.forEach(e=>{console.log(`${f.default.cyan(e.name||"Unnamed")} ${f.default.gray(e._id)}`)}),console.log("─".repeat(80))}catch(t){r?r.fail(`Failed to resolve device group: ${t.message}`):(0,h.OW)(t.message,{resource:"group",query:e}),process.exit(1)}}),function(e,t){return i.apply(this,arguments)})),_.command("devices <id>").description("List devices in a group with status").option("-j, --json","Output as JSON").action((a=d(function*(e,t){var o=(0,m.requireAuth)(),r=(0,g.default)("Fetching devices...").start();try{var n=yield o.devicesByGroup({id:e});if(r.stop(),t.json)return void console.log(JSON.stringify(n,null,2));if(!n||0===n.length)return void console.log(f.default.yellow("No devices in this group"));console.log(f.default.bold("\nDevices in Group")),console.log("─".repeat(80)),n.forEach(e=>{var t=e.device||{},o=t.entry_detail?.watch_dog_timer?.last_alive_time,r=v(o),n=t.name||t.device_name||e.target_name||t._id||"Unknown",i=t.entry_detail?.application?.name||f.default.gray("No app");console.log(`${r} ${f.default.cyan(n.padEnd(30))} ${i}`)}),console.log("─".repeat(80))}catch(e){r.fail(`Failed to get devices: ${e.message}`),process.exit(1)}}),function(e,t){return a.apply(this,arguments)})),_.command("dispatch <id> <action>").description("Dispatch action to all devices in group").option("--dry-run","Validate inputs and show the dispatch plan without sending it").option("-j, --json","Output as JSON").action((s=d(function*(e,t,o){var r=(0,m.requireAuth)(),n=o.json?null:(0,g.default)(`Dispatching ${t}...`).start();F.includes(t)||(o.json?(0,h.OW)(`Invalid action. Valid actions: ${F.join(", ")}`,{action:"group.dispatch",target:{id:e}}):n.fail(`Invalid action. Valid actions: ${F.join(", ")}`),process.exit(1));try{var i=yield r.deviceGroup({id:e});if(!i)throw Error("Device group not found");if(o.dryRun){n&&n.stop(),(0,y.S5)({action:"group.dispatch",target:b(i,e),request:{action:t},checks:[(0,y.Iy)("group exists",!0,`${i.name} (${i._id})`),(0,y.Iy)("action is valid",!0)],json:o.json});return}var a=yield r.dispatchDeviceGroupAction({id:e,action:t});o.json?(0,y.yd)({action:"group.dispatch",target:b(i,e),result:{action:t,dispatched:a?.dispatched||0,devices:a?.devices||0},json:!0}):(n.succeed(`Action dispatched: ${f.default.green(t)}`),a&&(console.log(`Dispatched: ${f.default.green(a.dispatched||0)}`),console.log(`Devices: ${f.default.gray(a.devices||0)}`)))}catch(t){o.json?(0,h.OW)(t.message,{action:"group.dispatch",target:{id:e}}):n.fail(`Failed to dispatch action: ${t.message}`),process.exit(1)}}),function(e,t,o){return s.apply(this,arguments)})),_.command("refresh <id>").description("Refresh all devices in group").option("--dry-run","Validate inputs and show the refresh plan without sending it").option("-j, --json","Output as JSON").action((l=d(function*(e,t){var o=(0,m.requireAuth)(),r=t.json?null:(0,g.default)("Refreshing devices...").start();try{var n=yield o.deviceGroup({id:e});if(!n)throw Error("Device group not found");if(t.dryRun){r&&r.stop(),(0,y.S5)({action:"group.refresh",target:b(n,e),request:{action:"refresh"},checks:[(0,y.Iy)("group exists",!0,`${n.name} (${n._id})`)],json:t.json});return}var i=yield o.dispatchDeviceGroupAction({id:e,action:"refresh"});t.json?(0,y.yd)({action:"group.refresh",target:b(n,e),result:{dispatched:i?.dispatched||0,devices:i?.devices||0},json:!0}):(r.succeed("Devices refreshed"),i&&(console.log(`Dispatched: ${f.default.green(i.dispatched||0)}`),console.log(`Devices: ${f.default.gray(i.devices||0)}`)))}catch(o){t.json?(0,h.OW)(o.message,{action:"group.refresh",target:{id:e}}):r.fail(`Failed to refresh: ${o.message}`),process.exit(1)}}),function(e,t){return l.apply(this,arguments)})),_.command("monitor <id>").description("Monitor devices in group (polls every 60s)").option("-i, --interval <seconds>","Polling interval in seconds","60").action((u=d(function*(e,t){var o,r=(0,m.requireAuth)(),n=1e3*parseInt(t.interval,10);console.log(f.default.bold("\nDevice Group Monitor")),console.log(f.default.gray(`Polling every ${t.interval}s. Press Ctrl+C to stop.
81
81
  `));var i=(o=d(function*(){try{var t=yield Promise.all([r.deviceGroup({id:e}),r.devicesByGroup({id:e})]),o=c(t,2),n=o[0],i=o[1];if(process.stdout.write("\x1b[2J\x1b[0f"),console.log(f.default.bold(`Device Group: ${n.name}`)+f.default.gray(` - ${new Date().toLocaleTimeString()}`)),console.log("─".repeat(80)),!i||0===i.length)return void console.log(f.default.yellow("No devices in this group"));var a=0,s=0;i.forEach(e=>{var t=e.device||{},o=t.entry_detail?.watch_dog_timer?.last_alive_time,r=v(o),n=t.name||t.device_name||e.target_name||t._id||"Unknown",i=t.entry_detail?.application?.name||f.default.gray("No app");o&&Date.now()-new Date(o).getTime()<=3e5?a++:s++,console.log(`${r} ${f.default.cyan(n.padEnd(30))} ${i}`)}),console.log("─".repeat(80)),console.log(`Online: ${f.default.green(a)} Offline: ${f.default.red(s)}`),console.log(`
82
- ${f.default.gray("Press Ctrl+C to stop")}`)}catch(e){console.error(f.default.red(`Error: ${e.message}`))}}),function(){return o.apply(this,arguments)});yield i(),setInterval(i,n)}),function(e,t){return u.apply(this,arguments)}))},429(e,t,o){o.d(t,{K:()=>l});var r,n=o(99436),i=o(35679),a=o(73284),s=o(47988),l=new i.uB("mcp").description("MCP server management");l.command("start").description("Start the BRICKS MCP server in STDIO mode").option("-t, --token <token>","API token (overrides saved token)").action((r=n(function*(e){var t=(0,s.getCurrentProfile)(),r=e.token||(0,s.getToken)(t);r||(console.error(a.default.red("Error: No API token found.")),console.error(a.default.gray("Please login first with: bricks auth login <passcode>")),console.error(a.default.gray("Or provide a token with: bricks mcp start --token <token>")),process.exit(1));try{var n=(yield Promise.all([o.e(370),o.e(866),o.e(645),o.e(332),o.e(192),o.e(648),o.e(306),o.e(10),o.e(117)]).then(o.bind(o,98372))).startStdioServer;yield n({token:r})}catch(e){console.error(a.default.red(`Failed to start MCP server: ${e.message}`)),process.exit(1)}}),function(e){return r.apply(this,arguments)}))},12569(e,t,o){o.d(t,{u:()=>v});var r,n,i,a,s,l,u,c,d,p=o(68832),f=o(99436),g=o(35679),h=()=>(c||(c=Promise.all([Promise.resolve().then(o.bind(o,73284)),Promise.resolve().then(o.bind(o,30155)),Promise.resolve().then(o.bind(o,56493)),Promise.all([o.e(370),o.e(831)]).then(o.bind(o,60450))]).then(([e,t,o,r])=>({chalk:e.default,ora:t.default,requireAuth:o.requireAuth,isMediaEnabled:r.isMediaEnabled,buildScreenshotUrl:r.buildScreenshotUrl}))),c),m=(r=f(function*(e,t){var o=yield e.workspace();if(!t.isMediaEnabled(o))throw Error("Media workspace not enabled for this workspace")}),function(e,t){return r.apply(this,arguments)}),D=e=>{var t=e.meta||{};if(!t.originalFileUploaded)return{ready:!1,label:"Uploading"};if("Video"===e.fileType){if(!t.videoThumbOriginalFileKey)return{ready:!1,label:"Processing"};if(!t.convertedFileUploaded)return{ready:!1,label:"Transcoding"}}return{ready:!0,label:"Ready"}},y=(e,t)=>e.ready?t.green(e.label):t.yellow(e.label),v=new g.uB("media").description("Media Flow support");v.command("boxes").description("List Media Flow boxes").option("-j, --json","Output as JSON").action((n=f(function*(e){var t=yield h(),o=t.chalk,r=t.requireAuth(),n=t.ora("Fetching media boxes...").start();try{yield m(r,t);var i=yield r.mediaBoxes();if(n.stop(),e.json)return void console.log(JSON.stringify(i,null,2));if(!i||0===i.length)return void console.log(o.yellow("No media boxes found"));console.log(o.bold("\nMedia Boxes")),console.log("─".repeat(80)),i.forEach(e=>{console.log(`${o.cyan(e.name||"Unnamed")} ${o.gray(e.id)}`),e.description&&console.log(` ${e.description}`),e.tags?.length&&console.log(` Tags: ${e.tags.join(", ")}`),null!=e.size&&console.log(` Size: ${e.size}`),console.log()})}catch(e){n.fail(`Failed to list media boxes: ${e.message}`),process.exit(1)}}),function(e){return n.apply(this,arguments)})),v.command("box <id>").description("Get Media Flow box details").option("-j, --json","Output as JSON").action((i=f(function*(e,t){var o=yield h(),r=o.chalk,n=o.requireAuth(),i=o.ora("Fetching media box...").start();try{yield m(n,o);var a=yield n.mediaBox({id:e});if(i.stop(),a||(console.log(r.red("Media box not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(a,null,2));console.log(r.bold(`
82
+ ${f.default.gray("Press Ctrl+C to stop")}`)}catch(e){console.error(f.default.red(`Error: ${e.message}`))}}),function(){return o.apply(this,arguments)});yield i(),setInterval(i,n)}),function(e,t){return u.apply(this,arguments)}))},429(e,t,o){o.d(t,{K:()=>l});var r,n=o(99436),i=o(35679),a=o(73284),s=o(47988),l=new i.uB("mcp").description("MCP server management");l.command("start").description("Start the BRICKS MCP server in STDIO mode").option("-t, --token <token>","API token (overrides saved token)").action((r=n(function*(e){var t=(0,s.getCurrentProfile)(),r=e.token||(0,s.getToken)(t);r||(console.error(a.default.red("Error: No API token found.")),console.error(a.default.gray("Please login first with: bricks auth login <passcode>")),console.error(a.default.gray("Or provide a token with: bricks mcp start --token <token>")),process.exit(1));try{var n=(yield Promise.all([o.e(6370),o.e(9866),o.e(6645),o.e(3332),o.e(4479),o.e(7648),o.e(853),o.e(1010),o.e(8117)]).then(o.bind(o,98372))).startStdioServer;yield n({token:r})}catch(e){console.error(a.default.red(`Failed to start MCP server: ${e.message}`)),process.exit(1)}}),function(e){return r.apply(this,arguments)}))},12569(e,t,o){o.d(t,{u:()=>v});var r,n,i,a,s,l,u,c,d,p=o(68832),f=o(99436),g=o(35679),h=()=>(c||(c=Promise.all([Promise.resolve().then(o.bind(o,73284)),Promise.resolve().then(o.bind(o,30155)),Promise.resolve().then(o.bind(o,56493)),Promise.all([o.e(6370),o.e(831)]).then(o.bind(o,60450))]).then(([e,t,o,r])=>({chalk:e.default,ora:t.default,requireAuth:o.requireAuth,isMediaEnabled:r.isMediaEnabled,buildScreenshotUrl:r.buildScreenshotUrl}))),c),m=(r=f(function*(e,t){var o=yield e.workspace();if(!t.isMediaEnabled(o))throw Error("Media workspace not enabled for this workspace")}),function(e,t){return r.apply(this,arguments)}),D=e=>{var t=e.meta||{};if(!t.originalFileUploaded)return{ready:!1,label:"Uploading"};if("Video"===e.fileType){if(!t.videoThumbOriginalFileKey)return{ready:!1,label:"Processing"};if(!t.convertedFileUploaded)return{ready:!1,label:"Transcoding"}}return{ready:!0,label:"Ready"}},y=(e,t)=>e.ready?t.green(e.label):t.yellow(e.label),v=new g.uB("media").description("Media Flow support");v.command("boxes").description("List Media Flow boxes").option("-j, --json","Output as JSON").action((n=f(function*(e){var t=yield h(),o=t.chalk,r=t.requireAuth(),n=t.ora("Fetching media boxes...").start();try{yield m(r,t);var i=yield r.mediaBoxes();if(n.stop(),e.json)return void console.log(JSON.stringify(i,null,2));if(!i||0===i.length)return void console.log(o.yellow("No media boxes found"));console.log(o.bold("\nMedia Boxes")),console.log("─".repeat(80)),i.forEach(e=>{console.log(`${o.cyan(e.name||"Unnamed")} ${o.gray(e.id)}`),e.description&&console.log(` ${e.description}`),e.tags?.length&&console.log(` Tags: ${e.tags.join(", ")}`),null!=e.size&&console.log(` Size: ${e.size}`),console.log()})}catch(e){n.fail(`Failed to list media boxes: ${e.message}`),process.exit(1)}}),function(e){return n.apply(this,arguments)})),v.command("box <id>").description("Get Media Flow box details").option("-j, --json","Output as JSON").action((i=f(function*(e,t){var o=yield h(),r=o.chalk,n=o.requireAuth(),i=o.ora("Fetching media box...").start();try{yield m(n,o);var a=yield n.mediaBox({id:e});if(i.stop(),a||(console.log(r.red("Media box not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(a,null,2));console.log(r.bold(`
83
83
  Media Box: ${a.name||"Unnamed"}`)),console.log("─".repeat(60)),console.log(`ID: ${r.gray(a.id)}`),console.log(`Description: ${a.description||r.gray("N/A")}`),console.log(`Tags: ${a.tags?.join(", ")||r.gray("None")}`),null!=a.size&&console.log(`Size: ${a.size}`),a.passcodes?.length&&(console.log(`
84
84
  ${r.bold("Passcodes")}`),a.passcodes.forEach(e=>{console.log(`- ${e.name||"Passcode"}: ${e.code}`)})),console.log("─".repeat(60))}catch(e){i.fail(`Failed to get media box: ${e.message}`),process.exit(1)}}),function(e,t){return i.apply(this,arguments)})),v.command("files <boxId>").description("List Media Flow files in a box").option("-t, --types <types>","Comma-separated file types to include").option("-u, --user-tag <tag>","Filter by user tag (repeatable)",(e,t)=>[...t,e],[]).option("-l, --limit <limit>","Limit results",e=>Number.parseInt(e,10)).option("-o, --offset <offset>","Offset results",e=>Number.parseInt(e,10)).option("-j, --json","Output as JSON").action((a=f(function*(e,t){var o=yield h(),r=o.chalk,n=o.requireAuth(),i=o.ora("Fetching media files...").start();try{yield m(n,o);var a=t.types?t.types.split(",").map(e=>e.trim()).filter(Boolean):void 0,s=t.userTag?.length?t.userTag:void 0,l=yield n.mediaFiles({boxId:e,includeTypes:a,userTags:s,limit:t.limit,offset:t.offset});if(i.stop(),t.json)return void console.log(JSON.stringify(l,null,2));if(!l||0===l.length)return void console.log(r.yellow("No media files found"));console.log(r.bold(`
85
85
  Media Files (${l.length})`)),console.log("─".repeat(100)),l.forEach(e=>{var t=D(e);console.log(`${r.cyan(e.name||"Unnamed")} ${r.gray(e.id)}`),console.log(` Type: ${e.fileType} Status: ${y(t,r)}`),e.userTags?.length&&console.log(` Tags: ${e.userTags.join(", ")}`),e.updatedAt&&console.log(` Updated: ${new Date(e.updatedAt).toLocaleString()}`),console.log()})}catch(e){i.fail(`Failed to list media files: ${e.message}`),process.exit(1)}}),function(e,t){return a.apply(this,arguments)})),v.command("file <id>").description("Get Media Flow file details").option("-j, --json","Output as JSON").action((s=f(function*(e,t){var o=yield h(),r=o.chalk,n=o.requireAuth(),i=o.ora("Fetching media file...").start();try{yield m(n,o);var a=yield n.mediaFile({id:e});if(i.stop(),a||(console.log(r.red("Media file not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(a,null,2));var s=D(a);console.log(r.bold(`
86
- Media File: ${a.name||"Unnamed"}`)),console.log("─".repeat(60)),console.log(`ID: ${r.gray(a.id)}`),console.log(`Box ID: ${r.gray(a.boxId)}`),console.log(`Type: ${a.fileType}`),console.log(`Status: ${y(s,r)}`),console.log(`Description: ${a.description||r.gray("N/A")}`),console.log(`Tags: ${a.userTags?.join(", ")||r.gray("None")}`),console.log(`Created: ${r.gray(a.createdAt||"N/A")}`),console.log(`Updated: ${r.gray(a.updatedAt||"N/A")}`);var l=o.buildScreenshotUrl(a),u=o.buildScreenshotUrl(a,{preferThumbnail:!0});a.meta?.originalFileKey&&console.log(`Original Key: ${r.gray(a.meta.originalFileKey)}`),l&&console.log(`Original URL: ${r.gray(l)}`),u&&u!==l&&console.log(`Thumbnail URL: ${r.gray(u)}`),console.log("─".repeat(60))}catch(e){i.fail(`Failed to get media file: ${e.message}`),process.exit(1)}}),function(e,t){return s.apply(this,arguments)}));var b=e=>{var t=e.match(/^(\d+)x(\d+)(?::(\w+))?$/);if(!t)throw Error(`Invalid image version spec: "${e}". Expected format: WxH or WxH:STRATEGY`);return{width:parseInt(t[1],10),height:parseInt(t[2],10),strategy:(t[3]||"FILL").toUpperCase(),copypreview:!1}},F=(l=f(function*(e,t,o,r,n){var i=new FormData;for(var a of Object.entries(t)){var s=p(a,2),l=s[0],u=s[1];i.append(l,u)}i.append("file",new Blob([o],{type:n}),r);var c=yield fetch(e,{method:"POST",body:i});if(!c.ok&&204!==c.status){var d=yield c.text().catch(()=>"");throw Error(`S3 upload failed (${c.status}): ${d}`)}}),function(e,t,o,r,n){return l.apply(this,arguments)});v.command("upload <boxId> <files...>").description("Upload file(s) to a Media Flow box").option("-d, --description <text>","File description","").option("-t, --user-tag <tag>","User tag (repeatable, max 15)",(e,t)=>[...t,e],[]).option("--image-version <spec>","Image resize spec as WxH or WxH:STRATEGY (repeatable)",(e,t)=>[...t,e],[]).option("--image-version-type <type>","Image output format: jpg or png").option("--enable-ai-analysis","Enable AI analysis on uploaded files").option("--ai-instruction <text>","Custom AI analysis instruction").option("--concurrency <n>","Max concurrent uploads",e=>parseInt(e,10),3).option("-j, --json","Output as JSON").action((u=f(function*(e,t,r){var n=yield h(),i=yield(!d&&(d=Promise.all([Promise.resolve().then(o.t.bind(o,51455,19)),Promise.resolve().then(o.t.bind(o,76760,19)),o.e(247).then(o.t.bind(o,86090,19)),o.e(212).then(o.bind(o,76983))]).then(([e,t,o,r])=>({readFile:e.readFile,stat:e.stat,basename:t.basename,resolve:t.resolve,lookup:o.lookup,runWithConcurrency:r.runWithConcurrency}))),d),a=n.chalk,s=n.requireAuth(),l=n.ora("Preparing upload...").start();try{if(yield m(s,n),r.userTag.length>15)throw Error("Maximum 15 user tags allowed");var u,c,p=r.imageVersion.map(b),g=r.enableAiAnalysis||!!r.aiInstruction,D=yield Promise.all(t.map((u=f(function*(e){var t=i.resolve(e),o=yield i.stat(t).catch(()=>null);if(!o||!o.isFile())throw Error(`Not a file: ${e}`);var r=i.basename(t),n=i.lookup(r)||"application/octet-stream";return{filePath:t,fileName:r,contentType:n,size:o.size}}),function(e){return u.apply(this,arguments)})));l.stop();var y=D.length;console.log(a.bold(`
86
+ Media File: ${a.name||"Unnamed"}`)),console.log("─".repeat(60)),console.log(`ID: ${r.gray(a.id)}`),console.log(`Box ID: ${r.gray(a.boxId)}`),console.log(`Type: ${a.fileType}`),console.log(`Status: ${y(s,r)}`),console.log(`Description: ${a.description||r.gray("N/A")}`),console.log(`Tags: ${a.userTags?.join(", ")||r.gray("None")}`),console.log(`Created: ${r.gray(a.createdAt||"N/A")}`),console.log(`Updated: ${r.gray(a.updatedAt||"N/A")}`);var l=o.buildScreenshotUrl(a),u=o.buildScreenshotUrl(a,{preferThumbnail:!0});a.meta?.originalFileKey&&console.log(`Original Key: ${r.gray(a.meta.originalFileKey)}`),l&&console.log(`Original URL: ${r.gray(l)}`),u&&u!==l&&console.log(`Thumbnail URL: ${r.gray(u)}`),console.log("─".repeat(60))}catch(e){i.fail(`Failed to get media file: ${e.message}`),process.exit(1)}}),function(e,t){return s.apply(this,arguments)}));var b=e=>{var t=e.match(/^(\d+)x(\d+)(?::(\w+))?$/);if(!t)throw Error(`Invalid image version spec: "${e}". Expected format: WxH or WxH:STRATEGY`);return{width:parseInt(t[1],10),height:parseInt(t[2],10),strategy:(t[3]||"FILL").toUpperCase(),copypreview:!1}},F=(l=f(function*(e,t,o,r,n){var i=new FormData;for(var a of Object.entries(t)){var s=p(a,2),l=s[0],u=s[1];i.append(l,u)}i.append("file",new Blob([o],{type:n}),r);var c=yield fetch(e,{method:"POST",body:i});if(!c.ok&&204!==c.status){var d=yield c.text().catch(()=>"");throw Error(`S3 upload failed (${c.status}): ${d}`)}}),function(e,t,o,r,n){return l.apply(this,arguments)});v.command("upload <boxId> <files...>").description("Upload file(s) to a Media Flow box").option("-d, --description <text>","File description","").option("-t, --user-tag <tag>","User tag (repeatable, max 15)",(e,t)=>[...t,e],[]).option("--image-version <spec>","Image resize spec as WxH or WxH:STRATEGY (repeatable)",(e,t)=>[...t,e],[]).option("--image-version-type <type>","Image output format: jpg or png").option("--enable-ai-analysis","Enable AI analysis on uploaded files").option("--ai-instruction <text>","Custom AI analysis instruction").option("--concurrency <n>","Max concurrent uploads",e=>parseInt(e,10),3).option("-j, --json","Output as JSON").action((u=f(function*(e,t,r){var n=yield h(),i=yield(!d&&(d=Promise.all([Promise.resolve().then(o.t.bind(o,51455,19)),Promise.resolve().then(o.t.bind(o,76760,19)),o.e(2247).then(o.t.bind(o,86090,19)),o.e(5212).then(o.bind(o,76983))]).then(([e,t,o,r])=>({readFile:e.readFile,stat:e.stat,basename:t.basename,resolve:t.resolve,lookup:o.lookup,runWithConcurrency:r.runWithConcurrency}))),d),a=n.chalk,s=n.requireAuth(),l=n.ora("Preparing upload...").start();try{if(yield m(s,n),r.userTag.length>15)throw Error("Maximum 15 user tags allowed");var u,c,p=r.imageVersion.map(b),g=r.enableAiAnalysis||!!r.aiInstruction,D=yield Promise.all(t.map((u=f(function*(e){var t=i.resolve(e),o=yield i.stat(t).catch(()=>null);if(!o||!o.isFile())throw Error(`Not a file: ${e}`);var r=i.basename(t),n=i.lookup(r)||"application/octet-stream";return{filePath:t,fileName:r,contentType:n,size:o.size}}),function(e){return u.apply(this,arguments)})));l.stop();var y=D.length;console.log(a.bold(`
87
87
  Uploading ${y} file${y>1?"s":""} to box ${a.gray(e)}...
88
- `));var v=[];yield i.runWithConcurrency(D,r.concurrency,(c=f(function*(t,o){var l=`[${o+1}/${y}] ${t.fileName}`,u=n.ora(`${l} — requesting upload...`).start();try{var c,d,f=(c=t.contentType)&&"image/svg+xml"!==c?c.startsWith("image/")?"IMAGE":c.startsWith("video/")?"VIDEO":c.startsWith("audio/")?"AUDIO":"FILE":"FILE",h={imageVersions:"IMAGE"===f?p:[],imageVersionType:"IMAGE"===f?r.imageVersionType:void 0,enableAiAnalysis:g,aiCustomInstruction:r.aiInstruction||void 0},m=yield s.createMediaFileUploadRequest({name:t.fileName,description:r.description,boxId:e,fileType:f,contentType:t.contentType,userTags:r.userTag.length?r.userTag:[],meta:h});u.text=`${l} — uploading to storage...`;var D=JSON.parse(m.meta.uploadInfo),b=yield i.readFile(t.filePath);yield F(D.url,{AWSAccessKeyId:D.AWSAccessKeyId,"Content-Type":D["Content-Type"],key:D.key,Signature:D.Signature,Policy:D.Policy,acl:D.acl},b,t.fileName,t.contentType),u.succeed(`${l} ${a.green("✓")} ${a.gray(`(${f}, ${(d=t.size)<1024?`${d} B`:d<1048576?`${(d/1024).toFixed(1)} KB`:d<0x40000000?`${(d/1048576).toFixed(1)} MB`:`${(d/0x40000000).toFixed(1)} GB`})`)}`),v.push({file:t.fileName,id:m.id,status:"success",fileType:f,size:t.size})}catch(e){u.fail(`${l} — ${e.message}`),v.push({file:t.fileName,id:null,status:"failed",error:e.message})}}),function(e,t){return c.apply(this,arguments)}));var _=v.filter(e=>"success"===e.status).length,C=v.filter(e=>"failed"===e.status).length;r.json?console.log(JSON.stringify({boxId:e,results:v,summary:{total:y,success:_,failed:C}},null,2)):(console.log(),0===C?console.log(a.green(`Uploaded ${_}/${y} files`)):console.log(a.yellow(`Uploaded ${_}/${y} files (${C} failed)`))),C>0&&process.exit(1)}catch(e){l.fail(`Upload failed: ${e.message}`),process.exit(1)}}),function(e,t,o){return u.apply(this,arguments)}))},32541(e,t,o){o.d(t,{A:()=>x});var r,n,i,a,s,l,u,c,d,p,f,g,h,m=o(99436),D=o(35679),y=o(73284),v=o(30155),b=o(47988),F=o(29988),_=o(44618),C=o(7586),$=o(56493),E=o(68168),w=o(74049),k=o(98593),S=(e,t)=>(0,k.H_)(e,t,{currentVersion:e?.current_version||null,public:!!e?.is_public}),x=new D.uB("module").description("Module management");x.command("new").description("Create a new module").requiredOption("-n, --name <name>","Module name").option("-d, --description <description>","Module description").option("--layout-width <width>","Layout width",parseInt).option("--layout-height <height>","Layout height",parseInt).option("--public","Make module available to all users").option("--allow-modify","Allow users to modify imported module config").option("--init","Initialize a BRICKS Project after creation").option("-o, --output <dir>","Output directory for --init (default: current directory)").option("-y, --yes","Skip prompts for --init").option("-j, --json","Output as JSON").action((r=m(function*(e){var t=(0,$.requireAuth)(),r=e.json?null:(0,v.default)("Creating module...").start();try{var n={name:e.name};e.description&&(n.description=e.description),e.layoutWidth&&(n.layoutWidth=e.layoutWidth),e.layoutHeight&&(n.layoutHeight=e.layoutHeight),e.public&&(n.isPublic=!0),e.allowModify&&(n.isAllowModify=!0);var i=yield t.createModule(n);if(e.json&&!e.init?console.log(JSON.stringify(i,null,2)):e.json||(r.succeed(`Module created: ${y.default.green(i.name)}`),console.log(` ID: ${y.default.gray(i._id)}`),i.description&&console.log(` ${y.default.gray(i.description)}`),console.log(` Public: ${i.is_public?y.default.green("Yes"):y.default.gray("No")}`),console.log(` Allow Modify: ${i.is_allow_modify?y.default.green("Yes"):y.default.gray("No")}`)),e.init){r&&r.stop();var a=(yield Promise.all([o.e(658),o.e(456)]).then(o.bind(o,58891))).initProject;yield a("module",i._id,{output:e.output,yes:e.yes,json:e.json})}}catch(t){e.json?console.error(JSON.stringify({error:t.message})):r.fail(`Failed to create module: ${t.message}`),process.exit(1)}}),function(e){return r.apply(this,arguments)})),x.command("list").description("List all modules").option("-k, --keyword <keyword>","Filter by keyword").option("-j, --json","Output as JSON").action((n=m(function*(e){var t=(0,$.requireAuth)(),o=(0,v.default)("Fetching modules...").start();try{var r=yield t.modules({keyword:e.keyword});if(o.stop(),e.json)return void console.log(JSON.stringify(r,null,2));if(!r||0===r.length)return void console.log(y.default.yellow("No modules found"));console.log(y.default.bold("\nModules")),console.log("─".repeat(80)),r.forEach(e=>{var t=e.current_version?`v${e.current_version}`:y.default.gray("no version");console.log(`● ${y.default.cyan(e.name)} ${y.default.gray(t)}`),console.log(` ID: ${y.default.gray(e._id)}`),e.description&&console.log(` ${y.default.gray(e.description)}`),console.log()})}catch(e){o.fail(`Failed to list modules: ${e.message}`),process.exit(1)}}),function(e){return n.apply(this,arguments)})),x.command("list-public").description("Search public modules").requiredOption("-k, --keyword <keyword>","Search keyword (min 2 characters)").option("-j, --json","Output as JSON").action((i=m(function*(e){var t=(0,(yield(0,F.i)()).createClient)((0,b.getBaseUrl)()),o=(0,v.default)("Searching public modules...").start();try{var r=yield t.publicModules({keyword:e.keyword});if(o.stop(),e.json)return void console.log(JSON.stringify(r,null,2));if(!r||0===r.length)return void console.log(y.default.yellow("No public modules found"));console.log(y.default.bold("\nPublic Modules")),console.log("─".repeat(80)),r.forEach(e=>{var t=e.current_version?`v${e.current_version}`:y.default.gray("no version");console.log(`● ${y.default.cyan(e.name)} ${y.default.gray(t)}`),console.log(` ID: ${y.default.gray(e._id)}`),e.description&&console.log(` ${y.default.gray(e.description)}`),console.log()})}catch(e){o.fail(`Failed to search public modules: ${e.message}`),process.exit(1)}}),function(e){return i.apply(this,arguments)})),x.command("get <id>").description("Get module details").option("-j, --json","Output as JSON").action((a=m(function*(e,t){var o=(0,$.requireAuth)(),r=(0,v.default)("Fetching module...").start();try{var n=yield o.module({id:e});if(r.stop(),n||(console.log(y.default.red("Module not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(n,null,2));if(console.log(y.default.bold(`
88
+ `));var v=[];yield i.runWithConcurrency(D,r.concurrency,(c=f(function*(t,o){var l=`[${o+1}/${y}] ${t.fileName}`,u=n.ora(`${l} — requesting upload...`).start();try{var c,d,f=(c=t.contentType)&&"image/svg+xml"!==c?c.startsWith("image/")?"IMAGE":c.startsWith("video/")?"VIDEO":c.startsWith("audio/")?"AUDIO":"FILE":"FILE",h={imageVersions:"IMAGE"===f?p:[],imageVersionType:"IMAGE"===f?r.imageVersionType:void 0,enableAiAnalysis:g,aiCustomInstruction:r.aiInstruction||void 0},m=yield s.createMediaFileUploadRequest({name:t.fileName,description:r.description,boxId:e,fileType:f,contentType:t.contentType,userTags:r.userTag.length?r.userTag:[],meta:h});u.text=`${l} — uploading to storage...`;var D=JSON.parse(m.meta.uploadInfo),b=yield i.readFile(t.filePath);yield F(D.url,{AWSAccessKeyId:D.AWSAccessKeyId,"Content-Type":D["Content-Type"],key:D.key,Signature:D.Signature,Policy:D.Policy,acl:D.acl},b,t.fileName,t.contentType),u.succeed(`${l} ${a.green("✓")} ${a.gray(`(${f}, ${(d=t.size)<1024?`${d} B`:d<1048576?`${(d/1024).toFixed(1)} KB`:d<0x40000000?`${(d/1048576).toFixed(1)} MB`:`${(d/0x40000000).toFixed(1)} GB`})`)}`),v.push({file:t.fileName,id:m.id,status:"success",fileType:f,size:t.size})}catch(e){u.fail(`${l} — ${e.message}`),v.push({file:t.fileName,id:null,status:"failed",error:e.message})}}),function(e,t){return c.apply(this,arguments)}));var _=v.filter(e=>"success"===e.status).length,C=v.filter(e=>"failed"===e.status).length;r.json?console.log(JSON.stringify({boxId:e,results:v,summary:{total:y,success:_,failed:C}},null,2)):(console.log(),0===C?console.log(a.green(`Uploaded ${_}/${y} files`)):console.log(a.yellow(`Uploaded ${_}/${y} files (${C} failed)`))),C>0&&process.exit(1)}catch(e){l.fail(`Upload failed: ${e.message}`),process.exit(1)}}),function(e,t,o){return u.apply(this,arguments)}))},32541(e,t,o){o.d(t,{A:()=>x});var r,n,i,a,s,l,u,c,d,p,f,g,h,m=o(99436),D=o(35679),y=o(73284),v=o(30155),b=o(47988),F=o(29988),_=o(44618),C=o(7586),$=o(56493),E=o(68168),w=o(74049),k=o(98593),S=(e,t)=>(0,k.H_)(e,t,{currentVersion:e?.current_version||null,public:!!e?.is_public}),x=new D.uB("module").description("Module management");x.command("new").description("Create a new module").requiredOption("-n, --name <name>","Module name").option("-d, --description <description>","Module description").option("--layout-width <width>","Layout width",parseInt).option("--layout-height <height>","Layout height",parseInt).option("--public","Make module available to all users").option("--allow-modify","Allow users to modify imported module config").option("--init","Initialize a BRICKS Project after creation").option("-o, --output <dir>","Output directory for --init (default: current directory)").option("-y, --yes","Skip prompts for --init").option("-j, --json","Output as JSON").action((r=m(function*(e){var t=(0,$.requireAuth)(),r=e.json?null:(0,v.default)("Creating module...").start();try{var n={name:e.name};e.description&&(n.description=e.description),e.layoutWidth&&(n.layoutWidth=e.layoutWidth),e.layoutHeight&&(n.layoutHeight=e.layoutHeight),e.public&&(n.isPublic=!0),e.allowModify&&(n.isAllowModify=!0);var i=yield t.createModule(n);if(e.json&&!e.init?console.log(JSON.stringify(i,null,2)):e.json||(r.succeed(`Module created: ${y.default.green(i.name)}`),console.log(` ID: ${y.default.gray(i._id)}`),i.description&&console.log(` ${y.default.gray(i.description)}`),console.log(` Public: ${i.is_public?y.default.green("Yes"):y.default.gray("No")}`),console.log(` Allow Modify: ${i.is_allow_modify?y.default.green("Yes"):y.default.gray("No")}`)),e.init){r&&r.stop();var a=(yield Promise.all([o.e(5658),o.e(4456)]).then(o.bind(o,58891))).initProject;yield a("module",i._id,{output:e.output,yes:e.yes,json:e.json})}}catch(t){e.json?console.error(JSON.stringify({error:t.message})):r.fail(`Failed to create module: ${t.message}`),process.exit(1)}}),function(e){return r.apply(this,arguments)})),x.command("list").description("List all modules").option("-k, --keyword <keyword>","Filter by keyword").option("-j, --json","Output as JSON").action((n=m(function*(e){var t=(0,$.requireAuth)(),o=(0,v.default)("Fetching modules...").start();try{var r=yield t.modules({keyword:e.keyword});if(o.stop(),e.json)return void console.log(JSON.stringify(r,null,2));if(!r||0===r.length)return void console.log(y.default.yellow("No modules found"));console.log(y.default.bold("\nModules")),console.log("─".repeat(80)),r.forEach(e=>{var t=e.current_version?`v${e.current_version}`:y.default.gray("no version");console.log(`● ${y.default.cyan(e.name)} ${y.default.gray(t)}`),console.log(` ID: ${y.default.gray(e._id)}`),e.description&&console.log(` ${y.default.gray(e.description)}`),console.log()})}catch(e){o.fail(`Failed to list modules: ${e.message}`),process.exit(1)}}),function(e){return n.apply(this,arguments)})),x.command("list-public").description("Search public modules").requiredOption("-k, --keyword <keyword>","Search keyword (min 2 characters)").option("-j, --json","Output as JSON").action((i=m(function*(e){var t=(0,(yield(0,F.i)()).createClient)((0,b.getBaseUrl)()),o=(0,v.default)("Searching public modules...").start();try{var r=yield t.publicModules({keyword:e.keyword});if(o.stop(),e.json)return void console.log(JSON.stringify(r,null,2));if(!r||0===r.length)return void console.log(y.default.yellow("No public modules found"));console.log(y.default.bold("\nPublic Modules")),console.log("─".repeat(80)),r.forEach(e=>{var t=e.current_version?`v${e.current_version}`:y.default.gray("no version");console.log(`● ${y.default.cyan(e.name)} ${y.default.gray(t)}`),console.log(` ID: ${y.default.gray(e._id)}`),e.description&&console.log(` ${y.default.gray(e.description)}`),console.log()})}catch(e){o.fail(`Failed to search public modules: ${e.message}`),process.exit(1)}}),function(e){return i.apply(this,arguments)})),x.command("get <id>").description("Get module details").option("-j, --json","Output as JSON").action((a=m(function*(e,t){var o=(0,$.requireAuth)(),r=(0,v.default)("Fetching module...").start();try{var n=yield o.module({id:e});if(r.stop(),n||(console.log(y.default.red("Module not found")),process.exit(1)),t.json)return void console.log(JSON.stringify(n,null,2));if(console.log(y.default.bold(`
89
89
  Module: ${n.name}`)),console.log("─".repeat(60)),console.log(`ID: ${y.default.gray(n._id)}`),console.log(`Description: ${n.description||y.default.gray("N/A")}`),console.log(`Tags: ${n.tags?.join(", ")||y.default.gray("None")}`),console.log(`Created: ${y.default.gray(n.create_datetime)}`),console.log(`Modified: ${y.default.gray(n.last_modify_datetime)}`),console.log(`
90
90
  ${y.default.bold("Version")}`),console.log(`Current: ${n.current_version?`v${n.current_version}`:y.default.gray("No version")}`),console.log(`Unreleased: ${n.has_unreleased_changes?y.default.yellow("Yes"):y.default.green("No")}`),console.log(`
91
91
  ${y.default.bold("Settings")}`),console.log(`Public: ${n.is_public?y.default.green("Yes"):y.default.gray("No")}`),console.log(`Allow Modify: ${n.is_allow_modify?y.default.green("Yes"):y.default.gray("No")}`),console.log(`Short Edit: ${n.short_edit?.enabled?y.default.green("Enabled"):y.default.gray("Disabled")}`),n.short_edit?.enabled&&n.short_edit.ref_map){var i=Object.keys(n.short_edit.ref_map).length;console.log(` References: ${i} editable properties`)}n.use_count?.total_count!=null&&(console.log(`
@@ -93,15 +93,15 @@ ${y.default.bold("Usage")}`),console.log(`Used In: ${n.use_count.total_coun
93
93
  ${y.default.bold("Exposed Properties")} (${n.expose_properties.length})`),n.expose_properties.forEach(e=>{console.log(` - ${y.default.cyan(e)}`)})),console.log("─".repeat(60))}catch(e){r.fail(`Failed to get module: ${e.message}`),process.exit(1)}}),function(e,t){return a.apply(this,arguments)})),x.command("resolve <query>").description("Resolve a module name or ID to stable IDs").option("-l, --limit <limit>","Limit search results",e=>Number.parseInt(e,10),10).option("-j, --json","Output as JSON").action((s=m(function*(e,t){var o=(0,$.requireAuth)(),r=t.json?null:(0,v.default)("Resolving module...").start();try{var n=yield(0,E.Y)(()=>o.module({id:e})),i=n?[n]:yield o.modules({keyword:e,paginate:{limit:t.limit}}),a=(0,E.K)({resource:"module",query:e,items:i||[],fields:["_id","name"],selectedBy:n?"id":null});if(r&&r.stop(),t.json)return void(0,C.GF)(a);if(a.resolved){var s=a.resolved;console.log(y.default.bold("\nResolved Module")),console.log("─".repeat(60)),console.log(`Name: ${y.default.cyan(s.name||"Unnamed")}`),console.log(`ID: ${y.default.gray(s._id)}`),console.log(`Selected By: ${a.selectedBy}`),console.log("─".repeat(60));return}if(0===a.matches.length)return void console.log(y.default.yellow(`No modules matched "${e}"`));console.log(y.default.bold(`
94
94
  Matching Modules (${a.matches.length})`)),console.log("─".repeat(80)),a.matches.forEach(e=>{console.log(`${y.default.cyan(e.name||"Unnamed")} ${y.default.gray(e._id)}`)}),console.log("─".repeat(80))}catch(t){r?r.fail(`Failed to resolve module: ${t.message}`):(0,C.OW)(t.message,{resource:"module",query:e}),process.exit(1)}}),function(e,t){return s.apply(this,arguments)})),x.command("update <id>").description("Update module name, description, and/or configuration").option("-n, --name <name>","Module name").option("-d, --description <description>","Module description").option("-c, --config <json>","Module config as JSON string").option("-f, --file <path>","Module config from file").option("--validate","Validate configuration (default: true when config is set)",!0).option("--no-validate","Skip server-side config validation").option("--last-commit-id <id>","Reject if server config.bricks_project_last_commit_id does not match this value").option("-j, --json","Output as JSON").action((l=m(function*(e,t){var o=(0,$.requireAuth)(),r=t.json?null:(0,v.default)("Updating module...").start();try{var n=yield o.updateModule((0,k.jB)(e,t));t.json?(0,k.yd)({action:"module.update",target:S(n,e),result:{lastCommitId:t.lastCommitId||null},json:!0}):(r.succeed(`Module updated: ${y.default.green(n.name)}`),n.has_unreleased_changes&&console.log(y.default.yellow("Note: Module has unreleased changes")))}catch(o){t.json?(0,C.OW)(o.message,{action:"module.update",target:{id:e}}):r.fail(`Failed to update module: ${o.message}`),process.exit(1)}}),function(e,t){return l.apply(this,arguments)})),x.command("short-edit <id>").description("Short edit module properties").requiredOption("-l, --list <json>","Short edit list as JSON array").action((u=m(function*(e,t){var o=(0,$.requireAuth)(),r=(0,v.default)("Applying short edit...").start();try{var n=JSON.parse(t.list);Array.isArray(n)||(r.fail("List must be a JSON array"),process.exit(1));var i=yield o.shortEditModule({id:e,list:n});r.succeed(`Short edit applied to: ${y.default.green(i.name)}`)}catch(e){r.fail(`Failed to apply short edit: ${e.message}`),process.exit(1)}}),function(e,t){return u.apply(this,arguments)})),x.command("short-refs <id>").description("List short edit references for a module").option("-k, --keyword <keyword>","Filter by shortId or title").option("-t, --types <types>","Comma-separated shortId prefixes to include (e.g. B,C,S)").option("-j, --json","Output as JSON").action((c=m(function*(e,t){var o=(0,$.requireAuth)(),r=(0,v.default)("Fetching short edit references...").start();try{var n=yield o.module({id:e});if(r.stop(),!n?.short_edit?.enabled)return void console.log(y.default.yellow("Short Edit is not enabled for this module"));var i=t.types?t.types.split(",").map(e=>e.trim()).filter(Boolean):[],a=(0,_.V)(n.short_edit.ref_map,{keyword:t.keyword,types:i});if(t.json)return void console.log(JSON.stringify(a,null,2));if(0===a.length)return void console.log(y.default.yellow("No short edit references found"));console.log(y.default.bold(`
95
95
  Short Edit References: ${n.name}`)),a.forEach(e=>{console.log(y.default.cyan(`
96
- ${e.label} (${e.prefix}_)`)),e.refs.forEach(({shortId:e,ref:t})=>{var o=t?.title?y.default.gray(`- ${t.title}`):"";console.log(` ${y.default.green(e)} ${o}`)})}),console.log()}catch(e){r.fail(`Failed to fetch short edit references: ${e.message}`),process.exit(1)}}),function(e,t){return c.apply(this,arguments)})),x.command("remove <id>").description("Remove a module").option("--dry-run","Validate the target and show the removal plan without deleting it").option("-j, --json","Output as JSON").action((d=m(function*(e,t){var o=(0,$.requireAuth)(),r=t.json?null:(0,v.default)("Removing module...").start();try{var n=yield o.module({id:e});if(!n)throw Error("Module not found");var i=S(n,e);if(t.dryRun){r&&r.stop(),(0,k.S5)({action:"module.remove",target:i,request:{id:e},checks:[(0,k.Iy)("module exists",!0,`${i.name} (${i.id})`)],json:t.json});return}var a=yield o.removeModule({id:e});t.json?(0,k.yd)({action:"module.remove",target:i,result:{removed:!!a},json:!0}):r.succeed(`Module removed: ${y.default.green(i.name)}`)}catch(o){t.json?(0,C.OW)(o.message,{action:"module.remove",target:{id:e}}):r.fail(`Failed to remove module: ${o.message}`),process.exit(1)}}),function(e,t){return d.apply(this,arguments)})),x.command("release <id>").description("Release module to BRICKS platform").requiredOption("-c, --config <path|json>","Module config file path or JSON string").option("-n, --name <name>","Update module name as part of the release").option("--version <version>","Version name").option("--changelogs <text>","Release changelogs").option("--dry-run","Validate inputs and show the release plan without publishing").option("-j, --json","Output as JSON").action((p=m(function*(e,t){var o=(0,$.requireAuth)(),r=t.json?null:(0,v.default)("Releasing module...").start();try{var n=(0,w.Ku)(t.config),i=n.config,a=n.source,s=n.sizeBytes,l=yield o.module({id:e});if(!l)throw Error("Module not found");if(l.is_public)throw Error("Public module deployment is temporarily not recommended");var u=t.version||t.name||l.name||"Untitled",c=(0,w.w9)(t.changelogs);if(t.dryRun){r&&r.stop(),(0,k.S5)({action:"module.release",target:S(l,e),request:{name:t.name||null,version:u,changelogs:t.changelogs||null,configSource:a,configSizeBytes:s},checks:[(0,k.Iy)("module exists",!0,`${l.name} (${l._id})`),(0,k.Iy)("module is private",!l.is_public),(0,k.Iy)("release config loaded",!0,`${s} bytes`)],json:t.json});return}var d=yield o.releaseModule({id:e,config:i,...t.name?{name:t.name}:{},releaseCurrentVersion:u,releaseCurrentVersionNote:c});t.json?(0,k.yd)({action:"module.release",target:S(d||l,e),result:{name:t.name||null,version:u,configSource:a,configSizeBytes:s},json:!0}):r.succeed(`Module released: ${y.default.green(d?.name||l.name)}`)}catch(o){t.json?(0,C.OW)(o.message,{action:"module.release",target:{id:e}}):r.fail(`Failed to release module: ${o.message}`),process.exit(1)}}),function(e,t){return p.apply(this,arguments)})),x.command("project-pull <id>").description("Pull module source files from BRICKS platform").option("-j, --json","Output as JSON (for programmatic use)").action((f=m(function*(e,t){var o=(0,$.requireAuth)(),r=t.json?null:(0,v.default)("Pulling module project...").start();try{var n=yield o.moduleProject({id:e,buildApplicationOnly:!0});n||(r?r.fail("Module project not found"):console.error(JSON.stringify({error:"Module project not found"})),process.exit(1)),t.json?console.log(JSON.stringify(n)):(r.succeed(`Module project fetched: ${y.default.green(n.files?.length||0)} files`),console.log(JSON.stringify(n,null,2)))}catch(e){t.json?console.error(JSON.stringify({error:e.message})):r.fail(`Failed to pull module project: ${e.message}`),process.exit(1)}}),function(e,t){return f.apply(this,arguments)})),x.command("doctor <idOrPath>").description("Diagnose a module config: schema validation plus semantic lint rules (data races, layout mistakes, dead config)").option("-j, --json","Output as JSON").option("--strict","Exit with code 1 when warnings are found").option("--only <codes>","Run only these rule codes (comma-separated)").option("--ignore <codes>","Skip these rule codes (comma-separated)").option("--validate-automation","Also validate automation_map and test_map references").action((g=m(function*(e,t){var r=t.json?null:(0,v.default)("Running config doctor...").start();try{var n=yield Promise.all([o.e(866),o.e(645),o.e(430),o.e(10),o.e(511),o.e(563)]).then(o.bind(o,63322)),i=n.runConfigDoctor,a=n.renderConfigDoctorReport,s=yield i("module",e,t),l=s.report,u=s.exitCode;r?.stop(),t.json?(0,C.GF)({...l,exitCode:u}):console.log(a(l)),0!==u&&process.exit(u)}catch(e){r?r.fail(`Config doctor failed: ${e.message}`):(0,C.OW)(e.message),process.exit(1)}}),function(e,t){return g.apply(this,arguments)})),x.command("ctor-init <id>").alias("project-init").description("Initialize a BRICKS Project from a module (deprecated: use `bricks ctor init --type module`)").option("-o, --output <dir>","Output directory (default: current directory)").option("--github-actions","Include GitHub Actions workflow (default: true)").option("--no-github-actions","Skip GitHub Actions workflow setup").option("--agents","Include AGENTS.md (default: true)").option("--no-agents","Skip AGENTS.md setup").option("--claude","Include CLAUDE.md (default: true)").option("--no-claude","Skip CLAUDE.md setup").option("--gemini","Include GEMINI.md (default: false)").option("--no-gemini","Skip GEMINI.md setup").option("--install","Run bun install after generation (default: true)").option("--no-install","Skip bun install after generation").option("--git","Initialize git repository (default: true)").option("--no-git","Skip git initialization").option("-y, --yes","Skip prompts and use defaults/flags").option("-j, --json","Output as JSON (for programmatic use)").action((h=m(function*(e,t){t.json||console.error(y.default.yellow("Note: `bricks module ctor-init` is deprecated. Use `bricks ctor init <id> --type module` instead."));var r=(yield Promise.all([o.e(658),o.e(456)]).then(o.bind(o,58891))).initProject;yield r("module",e,t)}),function(e,t){return h.apply(this,arguments)}))},38311(e,t,o){o.d(t,{D:()=>d});var r,n,i,a=o(99436),s=o(35679),l=o(73284),u=(r=a(function*(){var e=(yield Promise.resolve().then(o.bind(o,30155))).default,t=yield o.e(818).then(o.bind(o,53241)),r=t.detectChannel,n=t.detectInstallMethod,i=yield o.e(405).then(o.bind(o,21068));return{ora:e,detectChannel:r,detectInstallMethod:n,fetchLatestVersionInfo:i.fetchLatestVersionInfo,runUpdateForMethod:i.runUpdateForMethod}}),function(){return r.apply(this,arguments)}),c=(n=a(function*({message:e,defaultValue:t,autoYes:r}){if(r)return!0;(0,(yield Promise.resolve().then(o.bind(o,8479))).isInteractiveTerminal)()||(console.error(l.default.red("Refusing to prompt in a non-interactive shell. Pass -y/--yes to confirm.")),process.exit(1));try{var n=(yield o.e(658).then(o.bind(o,27521))).confirm;return yield n({message:e,default:t})}catch{return!1}}),function(e){return n.apply(this,arguments)}),d=new s.uB("update-cli").description("Update the BRICKS CLI to the latest version").option("-y, --yes","Skip confirmation prompts").option("--channel <channel>","Override channel (release|beta)").option("--check-update","Only check whether a newer version is available and exit").action((i=a(function*(e){var t,o=yield u(),r=o.ora,n=o.detectChannel,i=o.detectInstallMethod,s=o.fetchLatestVersionInfo,d=o.runUpdateForMethod,p="2.25.0-beta.62",f=i(),g=e.channel||n({version:p,execPath:f.execPath});console.log(l.default.bold(e.checkUpdate?"BRICKS CLI Update Check":"BRICKS CLI Update")),console.log("─".repeat(60)),console.log(`Current version : ${l.default.cyan(p)}`),console.log(`Channel : ${l.default.cyan(g)}`),console.log(`Detected method : ${l.default.cyan(f.method)}`),f.execPath&&"binary"===f.method&&console.log(`Binary path : ${l.default.gray(f.execPath)}`),f.installRoot&&console.log(`Install root : ${l.default.gray(f.installRoot)}`);var h="npm"===f.method||"bun"===f.method?"npm":"cdn",m=r(`Fetching latest version info (${h})...`).start(),D=null,y=null;try{D=(yield s(g,f.method)).version,m.succeed(`Latest ${g} (${h}): ${l.default.green(D)}`)}catch(e){y=e,m.warn(`Could not fetch version info: ${e.message}`)}var v=D&&D===p;if(e.checkUpdate){if(y&&process.exit(2),v)return void console.log(l.default.green("\nUp to date."));D&&(console.log(l.default.yellow(`
96
+ ${e.label} (${e.prefix}_)`)),e.refs.forEach(({shortId:e,ref:t})=>{var o=t?.title?y.default.gray(`- ${t.title}`):"";console.log(` ${y.default.green(e)} ${o}`)})}),console.log()}catch(e){r.fail(`Failed to fetch short edit references: ${e.message}`),process.exit(1)}}),function(e,t){return c.apply(this,arguments)})),x.command("remove <id>").description("Remove a module").option("--dry-run","Validate the target and show the removal plan without deleting it").option("-j, --json","Output as JSON").action((d=m(function*(e,t){var o=(0,$.requireAuth)(),r=t.json?null:(0,v.default)("Removing module...").start();try{var n=yield o.module({id:e});if(!n)throw Error("Module not found");var i=S(n,e);if(t.dryRun){r&&r.stop(),(0,k.S5)({action:"module.remove",target:i,request:{id:e},checks:[(0,k.Iy)("module exists",!0,`${i.name} (${i.id})`)],json:t.json});return}var a=yield o.removeModule({id:e});t.json?(0,k.yd)({action:"module.remove",target:i,result:{removed:!!a},json:!0}):r.succeed(`Module removed: ${y.default.green(i.name)}`)}catch(o){t.json?(0,C.OW)(o.message,{action:"module.remove",target:{id:e}}):r.fail(`Failed to remove module: ${o.message}`),process.exit(1)}}),function(e,t){return d.apply(this,arguments)})),x.command("release <id>").description("Release module to BRICKS platform").requiredOption("-c, --config <path|json>","Module config file path or JSON string").option("-n, --name <name>","Update module name as part of the release").option("--version <version>","Version name").option("--changelogs <text>","Release changelogs").option("--dry-run","Validate inputs and show the release plan without publishing").option("-j, --json","Output as JSON").action((p=m(function*(e,t){var o=(0,$.requireAuth)(),r=t.json?null:(0,v.default)("Releasing module...").start();try{var n=(0,w.Ku)(t.config),i=n.config,a=n.source,s=n.sizeBytes,l=yield o.module({id:e});if(!l)throw Error("Module not found");if(l.is_public)throw Error("Public module deployment is temporarily not recommended");var u=t.version||t.name||l.name||"Untitled",c=(0,w.w9)(t.changelogs);if(t.dryRun){r&&r.stop(),(0,k.S5)({action:"module.release",target:S(l,e),request:{name:t.name||null,version:u,changelogs:t.changelogs||null,configSource:a,configSizeBytes:s},checks:[(0,k.Iy)("module exists",!0,`${l.name} (${l._id})`),(0,k.Iy)("module is private",!l.is_public),(0,k.Iy)("release config loaded",!0,`${s} bytes`)],json:t.json});return}var d=yield o.releaseModule({id:e,config:i,...t.name?{name:t.name}:{},releaseCurrentVersion:u,releaseCurrentVersionNote:c});t.json?(0,k.yd)({action:"module.release",target:S(d||l,e),result:{name:t.name||null,version:u,configSource:a,configSizeBytes:s},json:!0}):r.succeed(`Module released: ${y.default.green(d?.name||l.name)}`)}catch(o){t.json?(0,C.OW)(o.message,{action:"module.release",target:{id:e}}):r.fail(`Failed to release module: ${o.message}`),process.exit(1)}}),function(e,t){return p.apply(this,arguments)})),x.command("project-pull <id>").description("Pull module source files from BRICKS platform").option("-j, --json","Output as JSON (for programmatic use)").action((f=m(function*(e,t){var o=(0,$.requireAuth)(),r=t.json?null:(0,v.default)("Pulling module project...").start();try{var n=yield o.moduleProject({id:e,buildApplicationOnly:!0});n||(r?r.fail("Module project not found"):console.error(JSON.stringify({error:"Module project not found"})),process.exit(1)),t.json?console.log(JSON.stringify(n)):(r.succeed(`Module project fetched: ${y.default.green(n.files?.length||0)} files`),console.log(JSON.stringify(n,null,2)))}catch(e){t.json?console.error(JSON.stringify({error:e.message})):r.fail(`Failed to pull module project: ${e.message}`),process.exit(1)}}),function(e,t){return f.apply(this,arguments)})),x.command("doctor <idOrPath>").description("Diagnose a module config: schema validation plus semantic lint rules (data races, layout mistakes, dead config)").option("-j, --json","Output as JSON").option("--strict","Exit with code 1 when warnings are found").option("--only <codes>","Run only these rule codes (comma-separated)").option("--ignore <codes>","Skip these rule codes (comma-separated)").option("--validate-automation","Also validate automation_map and test_map references").action((g=m(function*(e,t){var r=t.json?null:(0,v.default)("Running config doctor...").start();try{var n=yield Promise.all([o.e(9866),o.e(6645),o.e(9430),o.e(1010),o.e(7511),o.e(563)]).then(o.bind(o,63322)),i=n.runConfigDoctor,a=n.renderConfigDoctorReport,s=yield i("module",e,t),l=s.report,u=s.exitCode;r?.stop(),t.json?(0,C.GF)({...l,exitCode:u}):console.log(a(l)),0!==u&&process.exit(u)}catch(e){r?r.fail(`Config doctor failed: ${e.message}`):(0,C.OW)(e.message),process.exit(1)}}),function(e,t){return g.apply(this,arguments)})),x.command("ctor-init <id>").alias("project-init").description("Initialize a BRICKS Project from a module (deprecated: use `bricks ctor init --type module`)").option("-o, --output <dir>","Output directory (default: current directory)").option("--github-actions","Include GitHub Actions workflow (default: true)").option("--no-github-actions","Skip GitHub Actions workflow setup").option("--agents","Include AGENTS.md (default: true)").option("--no-agents","Skip AGENTS.md setup").option("--claude","Include CLAUDE.md (default: true)").option("--no-claude","Skip CLAUDE.md setup").option("--gemini","Include GEMINI.md (default: false)").option("--no-gemini","Skip GEMINI.md setup").option("--install","Run bun install after generation (default: true)").option("--no-install","Skip bun install after generation").option("--git","Initialize git repository (default: true)").option("--no-git","Skip git initialization").option("-y, --yes","Skip prompts and use defaults/flags").option("-j, --json","Output as JSON (for programmatic use)").action((h=m(function*(e,t){t.json||console.error(y.default.yellow("Note: `bricks module ctor-init` is deprecated. Use `bricks ctor init <id> --type module` instead."));var r=(yield Promise.all([o.e(5658),o.e(4456)]).then(o.bind(o,58891))).initProject;yield r("module",e,t)}),function(e,t){return h.apply(this,arguments)}))},38311(e,t,o){o.d(t,{D:()=>d});var r,n,i,a=o(99436),s=o(35679),l=o(73284),u=(r=a(function*(){var e=(yield Promise.resolve().then(o.bind(o,30155))).default,t=yield o.e(6818).then(o.bind(o,53241)),r=t.detectChannel,n=t.detectInstallMethod,i=yield o.e(9405).then(o.bind(o,21068));return{ora:e,detectChannel:r,detectInstallMethod:n,fetchLatestVersionInfo:i.fetchLatestVersionInfo,runUpdateForMethod:i.runUpdateForMethod}}),function(){return r.apply(this,arguments)}),c=(n=a(function*({message:e,defaultValue:t,autoYes:r}){if(r)return!0;(0,(yield Promise.resolve().then(o.bind(o,8479))).isInteractiveTerminal)()||(console.error(l.default.red("Refusing to prompt in a non-interactive shell. Pass -y/--yes to confirm.")),process.exit(1));try{var n=(yield o.e(5658).then(o.bind(o,27521))).confirm;return yield n({message:e,default:t})}catch{return!1}}),function(e){return n.apply(this,arguments)}),d=new s.uB("update-cli").description("Update the BRICKS CLI to the latest version").option("-y, --yes","Skip confirmation prompts").option("--channel <channel>","Override channel (release|beta)").option("--check-update","Only check whether a newer version is available and exit").action((i=a(function*(e){var t,o=yield u(),r=o.ora,n=o.detectChannel,i=o.detectInstallMethod,s=o.fetchLatestVersionInfo,d=o.runUpdateForMethod,p="2.25.0-beta.64",f=i(),g=e.channel||n({version:p,execPath:f.execPath});console.log(l.default.bold(e.checkUpdate?"BRICKS CLI Update Check":"BRICKS CLI Update")),console.log("─".repeat(60)),console.log(`Current version : ${l.default.cyan(p)}`),console.log(`Channel : ${l.default.cyan(g)}`),console.log(`Detected method : ${l.default.cyan(f.method)}`),f.execPath&&"binary"===f.method&&console.log(`Binary path : ${l.default.gray(f.execPath)}`),f.installRoot&&console.log(`Install root : ${l.default.gray(f.installRoot)}`);var h="npm"===f.method||"bun"===f.method?"npm":"cdn",m=r(`Fetching latest version info (${h})...`).start(),D=null,y=null;try{D=(yield s(g,f.method)).version,m.succeed(`Latest ${g} (${h}): ${l.default.green(D)}`)}catch(e){y=e,m.warn(`Could not fetch version info: ${e.message}`)}var v=D&&D===p;if(e.checkUpdate){if(y&&process.exit(2),v)return void console.log(l.default.green("\nUp to date."));D&&(console.log(l.default.yellow(`
97
97
  Update available: ${p} → ${D}. Run 'bricks update-cli' to install.`)),process.exit(1)),console.log(l.default.yellow("\nCould not determine current version.")),process.exit(2)}if(v&&(console.log(l.default.green("\nAlready running the latest version.")),!(yield c({message:"Reinstall anyway?",defaultValue:!1,autoYes:e.yes}))))return void console.log(l.default.gray("Skipped."));var b=["npm","bun","binary"].includes(f.method);b||console.log(l.default.yellow(`Cannot auto-detect installer (method: ${f.method}); falling back to binary install.`));var F=b?f.method:"binary";if(!(yield c({message:`Update CLI using "${F}" method?`,defaultValue:!0,autoYes:e.yes})))return void console.log(l.default.yellow("Cancelled."));var _=(t=a(function*(e){console.log(l.default.cyan(`
98
98
  → Running ${e} update...`));try{return yield d(e,g,f),!0}catch(t){return console.error(l.default.yellow(`
99
- ${e} update failed: ${t.message}`)),!1}}),function(e){return t.apply(this,arguments)}),C=yield _(F);!C&&"binary"!==F&&(console.log(l.default.cyan("\nFalling back to binary install (same method used by the desktop app).")),(yield c({message:"Try the binary installer as a fallback?",defaultValue:!0,autoYes:e.yes}))&&(C=yield _("binary"))),C||(console.error(l.default.red("\nUpdate failed. See messages above.")),process.exit(1)),console.log(l.default.green("\nUpdate complete."))}),function(e){return i.apply(this,arguments)}))},1878(e,t,o){o.a(e,async function(e,r){try{o.d(t,{A:()=>S,e:()=>k});var n,i=o(99436),a=o(35679),s=o(73284),l=o(47988),u=o(8479),c=o(55614),d=o(1983),p=o(17422),f=o(32541),g=o(28634),h=o(12569),m=o(55609),D=o(71335),y=o(429),v=o(80274),b=o(42400),F=o(98247),_=o(70970),C=o(38311),$=o(59845),E=o(22175),w=e([b]);b=(w.then?(await w)():w)[0];var k=(n=i(function*(){var e,t=process.argv.findIndex(e=>"--auth-profile"===e||"-ap"===e);-1!==t&&process.argv[t+1]&&((0,l.setProfileOverride)(process.argv[t+1]),process.argv.splice(t,2)),a.DM.name("bricks").description("BRICKS CLI - Command-line interface for BRICKS Workspace API").version("2.25.0-beta.62","-v, --version","output the version number").enablePositionalOptions(),a.DM.addCommand(c.s),a.DM.addCommand(d._),a.DM.addCommand(p.B),a.DM.addCommand(f.A),a.DM.addCommand(g.p),a.DM.addCommand(h.u),a.DM.addCommand(m.E),a.DM.addCommand(D.oT),a.DM.addCommand(y.K),a.DM.addCommand(v.gf),a.DM.addCommand(b.D),a.DM.addCommand(F.v),a.DM.addCommand(_.l),a.DM.addCommand(C.D),a.DM.addCommand($.Q),a.DM.addCommand(E.g),a.DM.command("interactive").alias("i").description("Start interactive mode with Ink UI").action(i(function*(){try{var e=(yield Promise.all([o.e(370),o.e(785),o.e(332),o.e(209),o.e(690),o.e(907),o.e(940)]).then(o.bind(o,92319))).runInteractiveMode;yield e()}catch(e){console.error(s.default.red(`Failed to start interactive mode: ${e.message}`)),process.exit(1)}})),a.DM.command("workspace").alias("ws").description("Show current workspace information").option("-j, --json","Output as JSON").action((e=i(function*(e){var t=yield Promise.resolve().then(o.bind(o,47988)),r=t.getToken,n=t.getBaseUrl,i=t.getCurrentProfile,a=(yield Promise.all([o.e(370),o.e(785),o.e(332),o.e(209),o.e(907)]).then(o.bind(o,85382))).createClient,l=(yield Promise.resolve().then(o.bind(o,30155))).default,u=i(),c=r(u);c||(console.error(s.default.red("Not logged in. Use `bricks auth login` first.")),process.exit(1));var d=l("Fetching workspace info...").start();try{var p=a(n(),c),f=yield p.workspace();if(d.stop(),e.json)return void console.log(JSON.stringify(f,null,2));console.log(s.default.bold("\nWorkspace Information")),console.log("─".repeat(60)),console.log(`Name: ${s.default.green(f.name)}`),console.log(`ID: ${s.default.gray(f._id)}`),console.log(`Description: ${f.description||s.default.gray("N/A")}`),console.log(`
100
- ${s.default.bold("Data")}`),console.log(`Remote Update: ${f.bank?.enable_remote_update?s.default.green("Enabled"):s.default.gray("Disabled")}`),console.log(`Spacename: ${f.bank?.spacename||s.default.gray("N/A")}`),console.log("─".repeat(60))}catch(e){d.fail(`Failed to get workspace: ${e.message}`),process.exit(1)}}),function(t){return e.apply(this,arguments)})),a.DM.on("--help",()=>{console.log(""),console.log(s.default.bold("Examples:")),console.log(""),console.log(s.default.gray(" # Login with a one-time passcode (recommended)")),console.log(" $ bricks auth login <passcode>"),console.log(""),console.log(s.default.gray(" # List all devices")),console.log(" $ bricks device list"),console.log(""),console.log(s.default.gray(" # Monitor devices in real-time")),console.log(" $ bricks device monitor"),console.log(""),console.log(s.default.gray(" # Control a device")),console.log(" $ bricks device refresh <device-id>"),console.log(" $ bricks device control <device-id> clear-cache"),console.log(""),console.log(s.default.gray(" # Bind a new device")),console.log(' $ bricks device bind <passcode> -n "My Device"'),console.log(""),console.log(s.default.gray(" # List applications")),console.log(" $ bricks app list"),console.log(""),console.log(s.default.gray(" # Start interactive mode")),console.log(" $ bricks interactive"),console.log(""),console.log(s.default.gray(" # Change API endpoint")),console.log(" $ bricks config endpoint beta"),console.log(""),console.log(s.default.gray("Get workspace token from BRICKS Controller:")),console.log(s.default.cyan(" https://control.bricks.tools")),console.log(s.default.gray(" Go to Workspace Settings > API Token"))});var r=process.argv.slice(2);if(0===r.length){if((0,u.shouldStartInteractiveMode)(r))try{var n=(yield Promise.all([o.e(370),o.e(785),o.e(332),o.e(209),o.e(690),o.e(907),o.e(940)]).then(o.bind(o,92319))).runInteractiveMode;yield n();return}catch(e){console.error(s.default.red(`Failed to start interactive mode: ${e.message}`)),process.exit(1)}console.error(s.default.gray("No command provided. Interactive mode requires a TTY, so showing help instead.\n")),a.DM.outputHelp();return}yield a.DM.parseAsync(process.argv)}),function(){return n.apply(this,arguments)});let S=k;r()}catch(e){r(e)}})},31596(e,t,o){o.d(t,{GE:()=>n,YC:()=>r,jR:()=>i});var r=["InSubspace","Global"],n="Data Bank is not enabled for this workspace.",i=e=>{if(e&&!r.includes(e))throw Error(`Invalid meta "${e}" (expected ${r.join(" | ")})`)}},56493(e,t,o){o.r(t),o.d(t,{requireAuth:()=>l});var r=o(99436),n=o(73284),i=o(47988),a=o(29988),s=new Set(["$$typeof","asymmetricMatch","catch","constructor","finally","hasOwnProperty","inspect","nodeType","toJSON","toString","valueOf"]),l=()=>{var e,t,o,l,u=(0,i.getCurrentProfile)(),c=(0,i.getToken)(u);return c||(console.error(n.default.red("Not logged in. Use `bricks auth login` first.")),process.exit(1)),e=(0,i.getBaseUrl)(),t=null,o=r(function*(){return t||=Promise.resolve((0,a.i)()).then(({createClient:t})=>t(e,c))}),l=function(){return o.apply(this,arguments)},new Proxy({},{get:(e,t)=>t===Symbol.toStringTag?"BricksLazyClient":"string"!=typeof t||"then"===t||s.has(t)?void 0:r(function*(...e){var o=yield l(),r=o[t];return"function"==typeof r?r.apply(o,e):r})})}},7586(e,t,o){o.d(t,{$l:()=>i,GF:()=>r,OW:()=>n});var r=e=>{console.log(JSON.stringify(e,null,2))},n=(e,t={})=>{console.error(JSON.stringify({ok:!1,error:{message:e,...t}},null,2))},i=(e,t=4)=>e?e.length<=2*t?"*".repeat(e.length):`${e.slice(0,t)}…${e.slice(-t)}`:null},8479(e,t,o){o.r(t),o.d(t,{isInteractiveTerminal:()=>r,shouldStartInteractiveMode:()=>n});var r=()=>!!(process.stdin.isTTY&&process.stdout.isTTY&&"function"==typeof process.stdin.setRawMode),n=(e=[])=>0===e.length&&r()},47988(e,t,o){o.r(t),o.d(t,{CONFIG_DIR:()=>a,CONFIG_PATH:()=>s,clearBankCredentials:()=>$,clearConfig:()=>k,default:()=>S,getActivityLogBaseUrl:()=>E,getBankCredentials:()=>_,getBaseUrl:()=>u,getCurrentProfile:()=>y,getCurrentProfileSource:()=>v,getToken:()=>p,getTokenInfo:()=>f,getTokens:()=>d,listProfiles:()=>F,removeToken:()=>h,setActivityLogBaseUrl:()=>w,setBankCredentials:()=>C,setBaseUrl:()=>c,setCurrentProfile:()=>b,setProfileOverride:()=>D,setToken:()=>g});var r=o(83440),n=o(16928),i=o(70857),a=n.join(i.homedir(),".bricks-cli"),s=n.join(a,"config.json"),l=new r.default({projectName:"bricks-cli",cwd:a,schema:{tokens:{type:"object",default:{},additionalProperties:{type:"object",properties:{token:{type:"string"},name:{type:"string"},workspaceId:{type:"string"},workspaceName:{type:"string"},workspaceBilling:{type:"object"},createdAt:{type:"string"},baseUrl:{type:"string"},bank:{type:"object"}}}},currentProfile:{type:"string",default:"default"},baseUrl:{type:"string",default:"https://display.bricks.tools"},activityLogBaseUrl:{type:"string",default:"https://activity-log.bricks.tools"},devtoolsTokens:{type:"object",default:{},additionalProperties:{type:"object",additionalProperties:{type:"object",properties:{token:{type:"string"},expiresAt:{type:"string"},jti:{type:"string"},workspaceId:{type:"string"}}}}}}}),u=()=>{var e=y(),t=l.get("tokens");return t[e]?.baseUrl||l.get("baseUrl")},c=(e,t)=>{if(!t)return void l.set("baseUrl",e);var o=l.get("tokens");o[t]||(o[t]={}),o[t].baseUrl=e,l.set("tokens",o)},d=()=>l.get("tokens"),p=(e="default")=>{var t=l.get("tokens");return t[e]?.token},f=(e="default")=>l.get("tokens")[e],g=(e,t)=>{var o=l.get("tokens"),r=o[e];o[e]={...r?.baseUrl?{baseUrl:r.baseUrl}:{},...r?.activityLogBaseUrl?{activityLogBaseUrl:r.activityLogBaseUrl}:{},...t,createdAt:new Date().toISOString()},l.set("tokens",o)},h=e=>{var t=l.get("tokens");delete t[e],l.set("tokens",t)},m=null,D=e=>{m=e},y=()=>m||process.env.BRICKS_PROFILE||l.get("currentProfile"),v=()=>m?"override":process.env.BRICKS_PROFILE?"env":"config",b=e=>l.set("currentProfile",e),F=()=>{var e=l.get("tokens"),t=l.get("currentProfile");return Object.keys(e).map(o=>({...e[o],name:o,current:o===t}))},_=(e="default")=>{var t=l.get("tokens");return t[e]?.bank||null},C=(e,t)=>{var o=l.get("tokens");o[e]||(o[e]={}),o[e].bank=t,l.set("tokens",o)},$=e=>{var t=l.get("tokens");return!!t[e]?.bank&&(delete t[e].bank,l.set("tokens",t),!0)},E=()=>{var e=y(),t=l.get("tokens");return t[e]?.activityLogBaseUrl||l.get("activityLogBaseUrl")},w=(e,t)=>{if(!t)return void l.set("activityLogBaseUrl",e);var o=l.get("tokens");o[t]||(o[t]={}),o[t].activityLogBaseUrl=e,l.set("tokens",o)},k=()=>{l.clear()};let S=l},75646(e,t,o){o.r(t),o.d(t,{discoverDevToolsServers:()=>l,httpProbeSubnet:()=>u,verifyDevToolsServer:()=>c});var r,n,i=o(99436),a=o(19557),s="bricks-devtools",l=({timeout:e=3e3,idleTimeout:t=0}={})=>(0,a.YH)({port:19900,timeout:e,idleTimeout:t,buildQuery:()=>Buffer.from(JSON.stringify({t:"QUERY",v:"1.0",s:s,d:{id:`cli-${(0,a.BW)()}`}})),parseMessage:(e,t)=>{var o=JSON.parse(e.toString());if(o.s!==s||"ANNOUNCE"!==o.t&&"RESPONSE"!==o.t)return null;var r=o.d?.info;if(!r)return null;var n=t.address;return{key:`${n}:${r.port}`,value:{...r,address:n}}}}),u=(r=i(function*({port:e=19851,connectTimeout:t=500,concurrency:o=50,timeout:r=0}={}){var n=(0,a.r9)();if(0===n.length)return[];var s=[],l=r>0?Date.now()+r:0,u=[],d=new Set;for(var p of n){var f=p.address.split(".").slice(0,3).join(".");if(!d.has(f)){d.add(f);for(var g=1;g<255;g++)u.push(`${f}.${g}`)}}for(var h=0;h<u.length&&!(l&&Date.now()>=l);h+=o){var m=u.slice(h,h+o);yield Promise.allSettled(m.map(function(){var o=i(function*(o){var r=yield c(o,e,t);r&&s.push({...r,address:o,port:e})});return function(e){return o.apply(this,arguments)}}()))}return s}),function(){return r.apply(this,arguments)}),c=(n=i(function*(e,t,o=3e3){return(0,a.uE)(`http://${e}:${t}/devtools/info`,o)}),function(e,t){return n.apply(this,arguments)})},29988(e,t,o){o.d(t,{i:()=>r});var r=()=>"u">typeof module&&"function"==typeof module.require?module.require("../gql/client.js"):Promise.all([o.e(370),o.e(785),o.e(332),o.e(209),o.e(907)]).then(o.bind(o,85382))},19557(e,t,o){o.d(t,{BW:()=>s,YH:()=>u,r9:()=>l,uE:()=>c});var r,n=o(99436),i=o(41314),a=o(48161),s=()=>Math.random().toString(36).slice(2,9),l=()=>{var e=[];for(var t of Object.values(a.networkInterfaces()))for(var o of t)if(function(){if("IPv4"!==o.family||o.internal)return 1;var t=o.address.split(".").map(Number),r=o.netmask.split(".").map(Number),n=t.map((e,t)=>(e|255&~r[t]).toString()).join(".");e.push({address:o.address,broadcast:n})}())continue;return e},u=({port:e,timeout:t=3e3,idleTimeout:o=0,buildQuery:r,parseMessage:n})=>new Promise((a,s)=>{var u=new Map,c=i.createSocket("udp4"),d=null,p=null,f=!1,g=()=>{if(!f){f=!0,clearTimeout(d),clearTimeout(p);try{c.close()}catch{}a([...u.values()])}};c.on("error",e=>{if(!f){f=!0,clearTimeout(d),clearTimeout(p);try{c.close()}catch{}s(e)}}),c.on("message",(e,t)=>{try{var r=n(e,t);if(!r||u.has(r.key))return;u.set(r.key,r.value),o&&!f&&(clearTimeout(p),p=setTimeout(g,o))}catch{}}),c.bind(()=>{c.setBroadcast(!0);var o=r();for(var n of(()=>{var e=new Set(["255.255.255.255","127.0.0.1"]);for(var t of l())e.add(t.broadcast);return[...e]})())c.send(o,0,o.length,e,n);d=setTimeout(g,t)})}),c=(r=n(function*(e,t=3e3){var o;try{var r=new AbortController;o=setTimeout(()=>r.abort(),t);var n=yield fetch(e,{signal:r.signal});if(!n.ok)return null;return yield n.json()}catch{return null}finally{void 0!==o&&clearTimeout(o)}}),function(e){return r.apply(this,arguments)})},74049(e,t,o){o.d(t,{Ku:()=>s,w9:()=>a});var r=o(79896),n=o(16928),i=new Set(["CTOR","CTOR Desktop"]),a=e=>{var t,o=`Release by ${(t=process.env.BRICKS_RELEASE_SIGN)&&i.has(t)?t:"BRICKS CLI"}`;return e?`${e}
99
+ ${e} update failed: ${t.message}`)),!1}}),function(e){return t.apply(this,arguments)}),C=yield _(F);!C&&"binary"!==F&&(console.log(l.default.cyan("\nFalling back to binary install (same method used by the desktop app).")),(yield c({message:"Try the binary installer as a fallback?",defaultValue:!0,autoYes:e.yes}))&&(C=yield _("binary"))),C||(console.error(l.default.red("\nUpdate failed. See messages above.")),process.exit(1)),console.log(l.default.green("\nUpdate complete."))}),function(e){return i.apply(this,arguments)}))},1878(e,t,o){o.a(e,async function(e,r){try{o.d(t,{A:()=>S,e:()=>k});var n,i=o(99436),a=o(35679),s=o(73284),l=o(47988),u=o(8479),c=o(55614),d=o(1983),p=o(17422),f=o(32541),g=o(28634),h=o(12569),m=o(55609),D=o(71335),y=o(429),v=o(80274),b=o(42400),F=o(98247),_=o(70970),C=o(38311),$=o(59845),E=o(22175),w=e([b]);b=(w.then?(await w)():w)[0];var k=(n=i(function*(){var e,t=process.argv.findIndex(e=>"--auth-profile"===e||"-ap"===e);-1!==t&&process.argv[t+1]&&((0,l.setProfileOverride)(process.argv[t+1]),process.argv.splice(t,2)),a.DM.name("bricks").description("BRICKS CLI - Command-line interface for BRICKS Workspace API").version("2.25.0-beta.64","-v, --version","output the version number").enablePositionalOptions(),a.DM.addCommand(c.s),a.DM.addCommand(d._),a.DM.addCommand(p.B),a.DM.addCommand(f.A),a.DM.addCommand(g.p),a.DM.addCommand(h.u),a.DM.addCommand(m.E),a.DM.addCommand(D.oT),a.DM.addCommand(y.K),a.DM.addCommand(v.gf),a.DM.addCommand(b.D),a.DM.addCommand(F.v),a.DM.addCommand(_.l),a.DM.addCommand(C.D),a.DM.addCommand($.Q),a.DM.addCommand(E.g),a.DM.command("interactive").alias("i").description("Start interactive mode with Ink UI").action(i(function*(){try{var e=(yield Promise.all([o.e(6370),o.e(5785),o.e(3332),o.e(2209),o.e(3690),o.e(907),o.e(9940)]).then(o.bind(o,92319))).runInteractiveMode;yield e()}catch(e){console.error(s.default.red(`Failed to start interactive mode: ${e.message}`)),process.exit(1)}})),a.DM.command("workspace").alias("ws").description("Show current workspace information").option("-j, --json","Output as JSON").action((e=i(function*(e){var t=yield Promise.resolve().then(o.bind(o,47988)),r=t.getToken,n=t.getBaseUrl,i=t.getCurrentProfile,a=(yield Promise.all([o.e(6370),o.e(5785),o.e(3332),o.e(2209),o.e(907)]).then(o.bind(o,85382))).createClient,l=(yield Promise.resolve().then(o.bind(o,30155))).default,u=i(),c=r(u);c||(console.error(s.default.red("Not logged in. Use `bricks auth login` first.")),process.exit(1));var d=l("Fetching workspace info...").start();try{var p=a(n(),c),f=yield p.workspace();if(d.stop(),e.json)return void console.log(JSON.stringify(f,null,2));console.log(s.default.bold("\nWorkspace Information")),console.log("─".repeat(60)),console.log(`Name: ${s.default.green(f.name)}`),console.log(`ID: ${s.default.gray(f._id)}`),console.log(`Description: ${f.description||s.default.gray("N/A")}`),console.log(`
100
+ ${s.default.bold("Data")}`),console.log(`Remote Update: ${f.bank?.enable_remote_update?s.default.green("Enabled"):s.default.gray("Disabled")}`),console.log(`Spacename: ${f.bank?.spacename||s.default.gray("N/A")}`),console.log("─".repeat(60))}catch(e){d.fail(`Failed to get workspace: ${e.message}`),process.exit(1)}}),function(t){return e.apply(this,arguments)})),a.DM.on("--help",()=>{console.log(""),console.log(s.default.bold("Examples:")),console.log(""),console.log(s.default.gray(" # Login with a one-time passcode (recommended)")),console.log(" $ bricks auth login <passcode>"),console.log(""),console.log(s.default.gray(" # List all devices")),console.log(" $ bricks device list"),console.log(""),console.log(s.default.gray(" # Monitor devices in real-time")),console.log(" $ bricks device monitor"),console.log(""),console.log(s.default.gray(" # Control a device")),console.log(" $ bricks device refresh <device-id>"),console.log(" $ bricks device control <device-id> clear-cache"),console.log(""),console.log(s.default.gray(" # Bind a new device")),console.log(' $ bricks device bind <passcode> -n "My Device"'),console.log(""),console.log(s.default.gray(" # List applications")),console.log(" $ bricks app list"),console.log(""),console.log(s.default.gray(" # Start interactive mode")),console.log(" $ bricks interactive"),console.log(""),console.log(s.default.gray(" # Change API endpoint")),console.log(" $ bricks config endpoint beta"),console.log(""),console.log(s.default.gray("Get workspace token from BRICKS Controller:")),console.log(s.default.cyan(" https://control.bricks.tools")),console.log(s.default.gray(" Go to Workspace Settings > API Token"))});var r=process.argv.slice(2);if(0===r.length){if((0,u.shouldStartInteractiveMode)(r))try{var n=(yield Promise.all([o.e(6370),o.e(5785),o.e(3332),o.e(2209),o.e(3690),o.e(907),o.e(9940)]).then(o.bind(o,92319))).runInteractiveMode;yield n();return}catch(e){console.error(s.default.red(`Failed to start interactive mode: ${e.message}`)),process.exit(1)}console.error(s.default.gray("No command provided. Interactive mode requires a TTY, so showing help instead.\n")),a.DM.outputHelp();return}yield a.DM.parseAsync(process.argv)}),function(){return n.apply(this,arguments)});let S=k;r()}catch(e){r(e)}})},31596(e,t,o){o.d(t,{GE:()=>n,YC:()=>r,jR:()=>i});var r=["InSubspace","Global"],n="Data Bank is not enabled for this workspace.",i=e=>{if(e&&!r.includes(e))throw Error(`Invalid meta "${e}" (expected ${r.join(" | ")})`)}},56493(e,t,o){o.r(t),o.d(t,{requireAuth:()=>l});var r=o(99436),n=o(73284),i=o(47988),a=o(29988),s=new Set(["$$typeof","asymmetricMatch","catch","constructor","finally","hasOwnProperty","inspect","nodeType","toJSON","toString","valueOf"]),l=()=>{var e,t,o,l,u=(0,i.getCurrentProfile)(),c=(0,i.getToken)(u);return c||(console.error(n.default.red("Not logged in. Use `bricks auth login` first.")),process.exit(1)),e=(0,i.getBaseUrl)(),t=null,o=r(function*(){return t||=Promise.resolve((0,a.i)()).then(({createClient:t})=>t(e,c))}),l=function(){return o.apply(this,arguments)},new Proxy({},{get:(e,t)=>t===Symbol.toStringTag?"BricksLazyClient":"string"!=typeof t||"then"===t||s.has(t)?void 0:r(function*(...e){var o=yield l(),r=o[t];return"function"==typeof r?r.apply(o,e):r})})}},7586(e,t,o){o.d(t,{$l:()=>i,GF:()=>r,OW:()=>n});var r=e=>{console.log(JSON.stringify(e,null,2))},n=(e,t={})=>{console.error(JSON.stringify({ok:!1,error:{message:e,...t}},null,2))},i=(e,t=4)=>e?e.length<=2*t?"*".repeat(e.length):`${e.slice(0,t)}…${e.slice(-t)}`:null},8479(e,t,o){o.r(t),o.d(t,{isInteractiveTerminal:()=>r,shouldStartInteractiveMode:()=>n});var r=()=>!!(process.stdin.isTTY&&process.stdout.isTTY&&"function"==typeof process.stdin.setRawMode),n=(e=[])=>0===e.length&&r()},47988(e,t,o){o.r(t),o.d(t,{CONFIG_DIR:()=>a,CONFIG_PATH:()=>s,clearBankCredentials:()=>$,clearConfig:()=>k,default:()=>S,getActivityLogBaseUrl:()=>E,getBankCredentials:()=>_,getBaseUrl:()=>u,getCurrentProfile:()=>y,getCurrentProfileSource:()=>v,getToken:()=>p,getTokenInfo:()=>f,getTokens:()=>d,listProfiles:()=>F,removeToken:()=>h,setActivityLogBaseUrl:()=>w,setBankCredentials:()=>C,setBaseUrl:()=>c,setCurrentProfile:()=>b,setProfileOverride:()=>D,setToken:()=>g});var r=o(83440),n=o(16928),i=o(70857),a=n.join(i.homedir(),".bricks-cli"),s=n.join(a,"config.json"),l=new r.default({projectName:"bricks-cli",cwd:a,schema:{tokens:{type:"object",default:{},additionalProperties:{type:"object",properties:{token:{type:"string"},name:{type:"string"},workspaceId:{type:"string"},workspaceName:{type:"string"},workspaceBilling:{type:"object"},createdAt:{type:"string"},baseUrl:{type:"string"},bank:{type:"object"}}}},currentProfile:{type:"string",default:"default"},baseUrl:{type:"string",default:"https://display.bricks.tools"},activityLogBaseUrl:{type:"string",default:"https://activity-log.bricks.tools"},devtoolsTokens:{type:"object",default:{},additionalProperties:{type:"object",additionalProperties:{type:"object",properties:{token:{type:"string"},expiresAt:{type:"string"},jti:{type:"string"},workspaceId:{type:"string"}}}}}}}),u=()=>{var e=y(),t=l.get("tokens");return t[e]?.baseUrl||l.get("baseUrl")},c=(e,t)=>{if(!t)return void l.set("baseUrl",e);var o=l.get("tokens");o[t]||(o[t]={}),o[t].baseUrl=e,l.set("tokens",o)},d=()=>l.get("tokens"),p=(e="default")=>{var t=l.get("tokens");return t[e]?.token},f=(e="default")=>l.get("tokens")[e],g=(e,t)=>{var o=l.get("tokens"),r=o[e];o[e]={...r?.baseUrl?{baseUrl:r.baseUrl}:{},...r?.activityLogBaseUrl?{activityLogBaseUrl:r.activityLogBaseUrl}:{},...t,createdAt:new Date().toISOString()},l.set("tokens",o)},h=e=>{var t=l.get("tokens");delete t[e],l.set("tokens",t)},m=null,D=e=>{m=e},y=()=>m||process.env.BRICKS_PROFILE||l.get("currentProfile"),v=()=>m?"override":process.env.BRICKS_PROFILE?"env":"config",b=e=>l.set("currentProfile",e),F=()=>{var e=l.get("tokens"),t=l.get("currentProfile");return Object.keys(e).map(o=>({...e[o],name:o,current:o===t}))},_=(e="default")=>{var t=l.get("tokens");return t[e]?.bank||null},C=(e,t)=>{var o=l.get("tokens");o[e]||(o[e]={}),o[e].bank=t,l.set("tokens",o)},$=e=>{var t=l.get("tokens");return!!t[e]?.bank&&(delete t[e].bank,l.set("tokens",t),!0)},E=()=>{var e=y(),t=l.get("tokens");return t[e]?.activityLogBaseUrl||l.get("activityLogBaseUrl")},w=(e,t)=>{if(!t)return void l.set("activityLogBaseUrl",e);var o=l.get("tokens");o[t]||(o[t]={}),o[t].activityLogBaseUrl=e,l.set("tokens",o)},k=()=>{l.clear()};let S=l},75646(e,t,o){o.r(t),o.d(t,{discoverDevToolsServers:()=>l,httpProbeSubnet:()=>u,verifyDevToolsServer:()=>c});var r,n,i=o(99436),a=o(19557),s="bricks-devtools",l=({timeout:e=3e3,idleTimeout:t=0}={})=>(0,a.YH)({port:19900,timeout:e,idleTimeout:t,buildQuery:()=>Buffer.from(JSON.stringify({t:"QUERY",v:"1.0",s:s,d:{id:`cli-${(0,a.BW)()}`}})),parseMessage:(e,t)=>{var o=(0,a.nl)(e,e=>e?.s===s);if(!o)return null;var r=t.address;return{key:`${r}:${o.port}`,value:{...o,address:r}}}}),u=(r=i(function*({port:e=19851,connectTimeout:t=500,concurrency:o=50,timeout:r=0}={}){var n=(0,a.r9)();if(0===n.length)return[];var s=[],l=r>0?Date.now()+r:0,u=[],d=new Set;for(var p of n){var f=p.address.split(".").slice(0,3).join(".");if(!d.has(f)){d.add(f);for(var g=1;g<255;g++)u.push(`${f}.${g}`)}}for(var h=0;h<u.length&&!(l&&Date.now()>=l);h+=o){var m=u.slice(h,h+o);yield Promise.allSettled(m.map(function(){var o=i(function*(o){var r=yield c(o,e,t);r&&s.push({...r,address:o,port:e})});return function(e){return o.apply(this,arguments)}}()))}return s}),function(){return r.apply(this,arguments)}),c=(n=i(function*(e,t,o=3e3){return(0,a.uE)(`http://${e}:${t}/devtools/info`,o)}),function(e,t){return n.apply(this,arguments)})},29988(e,t,o){o.d(t,{i:()=>r});var r=()=>"u">typeof module&&"function"==typeof module.require?module.require("../gql/client.js"):Promise.all([o.e(6370),o.e(5785),o.e(3332),o.e(2209),o.e(907)]).then(o.bind(o,85382))},19557(e,t,o){o.d(t,{BW:()=>s,YH:()=>d,nl:()=>u,r9:()=>c,uE:()=>p});var r,n=o(99436),i=o(41314),a=o(48161),s=()=>Math.random().toString(36).slice(2,9),l=new Set(["ANNOUNCE","RESPONSE"]),u=(e,t)=>{var o=JSON.parse(e.toString());return t(o)&&l.has(o.t)&&o.d?.info||null},c=()=>{var e=[];for(var t of Object.values(a.networkInterfaces()))for(var o of t)if(function(){if("IPv4"!==o.family||o.internal)return 1;var t=o.address.split(".").map(Number),r=o.netmask.split(".").map(Number),n=t.map((e,t)=>(e|255&~r[t]).toString()).join(".");e.push({address:o.address,broadcast:n})}())continue;return e},d=({port:e,timeout:t=3e3,idleTimeout:o=0,buildQuery:r,parseMessage:n})=>new Promise((a,s)=>{var l=new Map,u=i.createSocket("udp4"),d=null,p=null,f=!1,g=()=>{if(!f){f=!0,clearTimeout(d),clearTimeout(p);try{u.close()}catch{}a([...l.values()])}};u.on("error",e=>{if(!f){f=!0,clearTimeout(d),clearTimeout(p);try{u.close()}catch{}s(e)}}),u.on("message",(e,t)=>{try{var r=n(e,t);if(!r||l.has(r.key))return;l.set(r.key,r.value),o&&!f&&(clearTimeout(p),p=setTimeout(g,o))}catch{}}),u.bind(()=>{u.setBroadcast(!0);var o=r();for(var n of(()=>{var e=new Set(["255.255.255.255","127.0.0.1"]);for(var t of c())e.add(t.broadcast);return[...e]})())u.send(o,0,o.length,e,n);d=setTimeout(g,t)})}),p=(r=n(function*(e,t=3e3){var o;try{var r=new AbortController;o=setTimeout(()=>r.abort(),t);var n=yield fetch(e,{signal:r.signal});if(!n.ok)return null;return yield n.json()}catch{return null}finally{void 0!==o&&clearTimeout(o)}}),function(e){return r.apply(this,arguments)})},74049(e,t,o){o.d(t,{Ku:()=>s,w9:()=>a});var r=o(79896),n=o(16928),i=new Set(["CTOR","CTOR Desktop"]),a=e=>{var t,o=`Release by ${(t=process.env.BRICKS_RELEASE_SIGN)&&i.has(t)?t:"BRICKS CLI"}`;return e?`${e}
101
101
 
102
102
  ${o}`:o},s=e=>{if(e.endsWith(".json")||e.includes("/")){if(!r.existsSync(e))throw Error(`Config file not found: ${e}`);var t=r.readFileSync(e,"utf-8");return{config:t,source:{type:"file",path:n.resolve(e)},sizeBytes:Buffer.byteLength(t)}}return{config:e,source:{type:"inline"},sizeBytes:Buffer.byteLength(e)}}},68168(e,t,o){o.d(t,{K:()=>a,Y:()=>s});var r,n=o(99436),i=e=>String(e||"").trim().toLowerCase(),a=({resource:e,query:t,items:o,fields:r,selectedBy:n=null})=>{var a=i(t),s=o.filter(e=>r.some(t=>i(t.split(".").reduce((e,t)=>e?.[t],e)??null)===a)),l=null,u=n;return"id"===n?l=o[0]||null:1===s.length?(l=s[0],u="exact"):1===o.length&&(l=o[0],u="single"),{resource:e,query:t,exactMatchCount:s.length,matchCount:o.length,selectedBy:u,ambiguous:o.length>1&&!l,resolved:l,matches:o}},s=(r=n(function*(e){try{return yield e()}catch(e){if(/not found/i.test(e.message))return null;throw e}}),function(e){return r.apply(this,arguments)})},44618(e,t,o){o.d(t,{V:()=>i});var r={S:"Subspace",B:"Brick",C:"Canvas",A:"Animation",G:"Generator",D:"Data",F:"Data Calc",N:"Calc Node",T:"Test",TC:"Test Case",AT:"Automation Map"},n=e=>e?.split("_")?.[0]||"",i=(e,{keyword:t,types:o}={})=>{var i=t?.trim().toLowerCase()||"",a=o?.length>0?new Set(o.flatMap(e=>{var t=String(e).trim().toUpperCase();return t?[t]:[]})):null;return Object.entries(Object.entries(e||{}).filter(([,e])=>e&&!e.hide).filter(([e,t])=>{var o=n(e);if(a&&!a.has(o))return!1;if(!i)return!0;var r=t?.title?String(t.title).toLowerCase():"";return e.toLowerCase().includes(i)||r.includes(i)}).reduce((e,[t,o])=>{var r=n(t);return e[r]||(e[r]=[]),e[r].push({shortId:t,ref:o}),e},{})).map(([e,t])=>({prefix:e,label:r[e]||e,refs:t.sort((e,t)=>{var o=e.ref?.title||e.shortId,r=t.ref?.title||t.shortId;return String(o).localeCompare(String(r))})})).sort((e,t)=>e.label.localeCompare(t.label))}},94979(e,t,o){o.d(t,{p:()=>i});var r=/^(\d+)(s|m|h|d|w)$/,n={s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5};function i(e){var t=e.match(r);if(t){var o=parseInt(t[1],10),i=n[t[2]];return new Date(Date.now()-o*i).toISOString()}var a=new Date(e);if(isNaN(a.getTime()))throw Error(`Invalid time format: "${e}". Use ISO 8601 or relative (e.g. 1h, 30m, 2d)`);return a.toISOString()}},98593(e,t,o){o.d(t,{H_:()=>s,Iy:()=>a,S5:()=>c,jB:()=>l,yd:()=>d});var r=o(73284),n=o(79896),i=o(7586),a=(e,t,o)=>({label:e,ok:t,detail:o}),s=(e,t,{id:o,name:r,...n}={})=>({id:e?._id||t,name:r||e?.name||"Unnamed",...n}),l=(e,t)=>{var o={id:e};return t.name&&(o.name=t.name),t.description&&(o.description=t.description),t.config?o.config=t.config:t.file&&(o.config=n.readFileSync(t.file,"utf-8")),void 0!==o.config&&(o.validateConfig=!1!==t.validate),t.lastCommitId&&(o.lastCommitId=t.lastCommitId),o},u=e=>null==e?r.default.gray("N/A"):"object"==typeof e?r.default.gray(JSON.stringify(e,null,2)):String(e),c=({action:e,target:t,request:o,checks:n=[],json:a=!1})=>{a?(0,i.GF)({ok:!0,dryRun:!0,action:e,target:t||null,request:o||null,checks:n}):(console.log(r.default.bold(`
103
103
  Dry Run: ${e}`)),console.log("─".repeat(60)),t&&(console.log(r.default.bold("Target")),Object.entries(t).forEach(([e,t])=>{console.log(`${e}: ${u(t)}`)})),o&&(console.log(`
104
104
  ${r.default.bold("Request")}`),Object.entries(o).forEach(([e,t])=>{console.log(`${e}: ${u(t)}`)})),n.length>0&&(console.log(`
105
105
  ${r.default.bold("Checks")}`),n.forEach(e=>{var t=e.ok?r.default.green("OK"):r.default.red("FAIL"),o=e.detail?` ${e.detail}`:"";console.log(`${t} ${e.label}${o}`)})),console.log("─".repeat(60)))},d=({action:e,target:t,result:o=null,json:r=!1,message:n})=>{r?(0,i.GF)({ok:!0,dryRun:!1,action:e,target:t||null,result:o}):n&&console.log(n)}},73284(e,t,o){let r;o.r(t),o.d(t,{foregroundColors:()=>u,default:()=>P,colorNames:()=>d,supportsColor:()=>v,colors:()=>d,supportsColorStderr:()=>b,modifierNames:()=>l,foregroundColorNames:()=>u,chalkStderr:()=>N,Chalk:()=>w,modifiers:()=>l,backgroundColorNames:()=>c,backgroundColors:()=>c});let n=(e=0)=>t=>`\u001B[${t+e}m`,i=(e=0)=>t=>`\u001B[${38+e};5;${t}m`,a=(e=0)=>(t,o,r)=>`\u001B[${38+e};2;${t};${o};${r}m`,s={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},l=Object.keys(s.modifier),u=Object.keys(s.color),c=Object.keys(s.bgColor),d=[...u,...c],p=function(){let e=new Map;for(let[t,o]of Object.entries(s)){for(let[t,r]of Object.entries(o))s[t]={open:`\u001B[${r[0]}m`,close:`\u001B[${r[1]}m`},o[t]=s[t],e.set(r[0],r[1]);Object.defineProperty(s,t,{value:o,enumerable:!1})}return Object.defineProperty(s,"codes",{value:e,enumerable:!1}),s.color.close="\x1b[39m",s.bgColor.close="\x1b[49m",s.color.ansi=n(),s.color.ansi256=i(),s.color.ansi16m=a(),s.bgColor.ansi=n(10),s.bgColor.ansi256=i(10),s.bgColor.ansi16m=a(10),Object.defineProperties(s,{rgbToAnsi256:{value:(e,t,o)=>e===t&&t===o?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(o/255*5),enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[o]=t;3===o.length&&(o=[...o].map(e=>e+e).join(""));let r=Number.parseInt(o,16);return[r>>16&255,r>>8&255,255&r]},enumerable:!1},hexToAnsi256:{value:e=>s.rgbToAnsi256(...s.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){let t,o,r;if(e<8)return 30+e;if(e<16)return 90+(e-8);if(e>=232)o=t=((e-232)*10+8)/255,r=t;else{let n=(e-=16)%36;t=Math.floor(e/36)/5,o=Math.floor(n/6)/5,r=n%6/5}let n=2*Math.max(t,o,r);if(0===n)return 30;let i=30+(Math.round(r)<<2|Math.round(o)<<1|Math.round(t));return 2===n&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,t,o)=>s.ansi256ToAnsi(s.rgbToAnsi256(e,t,o)),enumerable:!1},hexToAnsi:{value:e=>s.ansi256ToAnsi(s.hexToAnsi256(e)),enumerable:!1}}),s}();var f=o(1708),g=o(48161),h=o(7066);function m(e,t=globalThis.Deno?globalThis.Deno.args:f.argv){let o=e.startsWith("-")?"":1===e.length?"-":"--",r=t.indexOf(o+e),n=t.indexOf("--");return -1!==r&&(-1===n||r<n)}let{env:D}=f;function y(e,t={}){var o;return 0!==(o=function(e,{streamIsTTY:t,sniffFlags:o=!0}={}){let n=function(){if("FORCE_COLOR"in D)return"true"===D.FORCE_COLOR?1:"false"===D.FORCE_COLOR?0:0===D.FORCE_COLOR.length?1:Math.min(Number.parseInt(D.FORCE_COLOR,10),3)}();void 0!==n&&(r=n);let i=o?r:n;if(0===i)return 0;if(o){if(m("color=16m")||m("color=full")||m("color=truecolor"))return 3;if(m("color=256"))return 2}if("TF_BUILD"in D&&"AGENT_NAME"in D)return 1;if(e&&!t&&void 0===i)return 0;let a=i||0;if("dumb"===D.TERM)return a;if("win32"===f.platform){let e=g.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in D)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(e=>e in D)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(e=>e in D)||"codeship"===D.CI_NAME?1:a;if("TEAMCITY_VERSION"in D)return+!!/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(D.TEAMCITY_VERSION);if("truecolor"===D.COLORTERM||"xterm-kitty"===D.TERM||"xterm-ghostty"===D.TERM||"wezterm"===D.TERM)return 3;if("TERM_PROGRAM"in D){let e=Number.parseInt((D.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(D.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(D.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(D.TERM)||"COLORTERM"in D?1:a}(e,{streamIsTTY:e&&e.isTTY,...t}))&&{level:o,hasBasic:!0,has256:o>=2,has16m:o>=3}}m("no-color")||m("no-colors")||m("color=false")||m("color=never")?r=0:(m("color")||m("colors")||m("color=true")||m("color=always"))&&(r=1);let{stdout:v,stderr:b}={stdout:y({isTTY:h.isatty(1)}),stderr:y({isTTY:h.isatty(2)})},F=Symbol("GENERATOR"),_=Symbol("STYLER"),C=Symbol("IS_EMPTY"),$=["ansi","ansi","ansi256","ansi16m"],E=Object.create(null);class w{constructor(e){return k(e)}}let k=e=>{let t=(...e)=>e.join(" ");return((e,t={})=>{if(t.level&&!(Number.isInteger(t.level)&&t.level>=0&&t.level<=3))throw Error("The `level` option should be an integer from 0 to 3");let o=v?v.level:0;e.level=void 0===t.level?o:t.level})(t,e),Object.setPrototypeOf(t,S.prototype),t};function S(e){return k(e)}for(let[e,t]of(Object.setPrototypeOf(S.prototype,Function.prototype),Object.entries(p)))E[e]={get(){let o=j(this,A(t.open,t.close,this[_]),this[C]);return Object.defineProperty(this,e,{value:o}),o}};E.visible={get(){let e=j(this,this[_],!0);return Object.defineProperty(this,"visible",{value:e}),e}};let x=(e,t,o,...r)=>"rgb"===e?"ansi16m"===t?p[o].ansi16m(...r):"ansi256"===t?p[o].ansi256(p.rgbToAnsi256(...r)):p[o].ansi(p.rgbToAnsi(...r)):"hex"===e?x("rgb",t,o,...p.hexToRgb(...r)):p[o][e](...r);for(let e of["rgb","hex","ansi256"])E[e]={get(){let{level:t}=this;return function(...o){return j(this,A(x(e,$[t],"color",...o),p.color.close,this[_]),this[C])}}},E["bg"+e[0].toUpperCase()+e.slice(1)]={get(){let{level:t}=this;return function(...o){return j(this,A(x(e,$[t],"bgColor",...o),p.bgColor.close,this[_]),this[C])}}};let O=Object.defineProperties(()=>{},{...E,level:{enumerable:!0,get(){return this[F].level},set(e){this[F].level=e}}}),A=(e,t,o)=>{let r,n;return void 0===o?(r=e,n=t):(r=o.openAll+e,n=t+o.closeAll),{open:e,close:t,openAll:r,closeAll:n,parent:o}},j=(e,t,o)=>{let r=(...e)=>I(r,1===e.length?""+e[0]:e.join(" "));return Object.setPrototypeOf(r,O),r[F]=e,r[_]=t,r[C]=o,r},I=(e,t)=>{if(e.level<=0||!t)return e[C]?"":t;let o=e[_];if(void 0===o)return t;let{openAll:r,closeAll:n}=o;if(t.includes("\x1b"))for(;void 0!==o;)t=function(e,t,o){let r=e.indexOf(t);if(-1===r)return e;let n=t.length,i=0,a="";do a+=e.slice(i,r)+t+o,i=r+n,r=e.indexOf(t,i);while(-1!==r);return a+e.slice(i)}(t,o.close,o.open),o=o.parent;let i=t.indexOf("\n");return -1!==i&&(t=function(e,t,o,r){let n=0,i="";do{let a="\r"===e[r-1];i+=e.slice(n,a?r-1:r)+t+(a?"\r\n":"\n")+o,n=r+1,r=e.indexOf("\n",n)}while(-1!==r);return i+e.slice(n)}(t,n,r,i)),r+t+n};Object.defineProperties(S.prototype,E);let B=k(void 0),N=k({level:b?b.level:0}),P=B},35679(e,t,o){o.d(t,{DM:()=>r,uB:()=>c});let{DM:r,gu:n,er:i,Ww:a,b7:s,Di:l,a2:u,uB:c,ef:d,c$:p,_V:f}=o(65181)},29122(e,t,o){o.d(t,{A:()=>n});var r=o(1708);function n(){let{env:e}=r,{TERM:t,TERM_PROGRAM:o}=e;return"win32"!==r.platform?"linux"!==t:!!e.WT_SESSION||!!e.TERMINUS_SUBLIME||"{cmd::Cmder}"===e.ConEmuTask||"Terminus-Sublime"===o||"vscode"===o||"xterm-256color"===t||"alacritty"===t||"rxvt-unicode"===t||"rxvt-unicode-256color"===t||"JetBrains-JediTerm"===e.TERMINAL_EMULATOR}},30155(e,t,o){let r;o.r(t),o.d(t,{spinners:()=>x,default:()=>J,oraPromise:()=>L});var n=o(1708),i=o(73284);let a=(e,t,o,r)=>{if("length"===o||"prototype"===o||"arguments"===o||"caller"===o)return;let n=Object.getOwnPropertyDescriptor(e,o),i=Object.getOwnPropertyDescriptor(t,o);(s(n,i)||!r)&&Object.defineProperty(e,o,i)},s=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},l=(e,t)=>`/* Wrapped ${e}*/
106
106
  ${t}`,u=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),c=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),d=new WeakMap,p=(e,t={})=>{let o;if("function"!=typeof e)throw TypeError("Expected a function");let r=0,n=e.displayName||e.name||"<anonymous>",i=function(...a){if(d.set(i,++r),1===r)o=e.apply(this,a),e=void 0;else if(!0===t.throw)throw Error(`Function \`${n}\` can only be called once`);return o};return!function(e,t,{ignoreNonConfigurable:o=!1}={}){let r,{name:n}=e;for(let r of Reflect.ownKeys(t))a(e,t,r,o);(r=Object.getPrototypeOf(t))!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r),((e,t,o)=>{let r=""===o?"":`with ${o.trim()}() `,n=l.bind(null,r,t.toString());Object.defineProperty(n,"name",c);let{writable:i,enumerable:a,configurable:s}=u;Object.defineProperty(e,"toString",{value:n,writable:i,enumerable:a,configurable:s})})(e,t,n)}(i,e),d.set(i,r),i};p.callCount=e=>{if(!d.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return d.get(e)};let f=[];f.push("SIGHUP","SIGINT","SIGTERM"),"win32"!==process.platform&&f.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&f.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");let g=e=>!!e&&"object"==typeof e&&"function"==typeof e.removeListener&&"function"==typeof e.emit&&"function"==typeof e.reallyExit&&"function"==typeof e.listeners&&"function"==typeof e.kill&&"number"==typeof e.pid&&"function"==typeof e.on,h=Symbol.for("signal-exit emitter"),m=globalThis,D=Object.defineProperty.bind(Object);class y{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(m[h])return m[h];D(m,h,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let o=this.listeners[e],r=o.indexOf(t);-1!==r&&(0===r&&1===o.length?o.length=0:o.splice(r,1))}emit(e,t,o){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(let n of this.listeners[e])r=!0===n(t,o)||r;return"exit"===e&&(r=this.emit("afterExit",t,o)||r),r}}class v{}class b extends v{#e="win32"===F.platform?"SIGINT":"SIGHUP";#t=new y;#o;#r;#n;#i={};#a=!1;constructor(e){for(let t of(super(),this.#o=e,this.#i={},f))this.#i[t]=()=>{let o=this.#o.listeners(t),{count:r}=this.#t;if("object"==typeof e.__signal_exit_emitter__&&"number"==typeof e.__signal_exit_emitter__.count&&(r+=e.__signal_exit_emitter__.count),o.length===r){this.unload();let o=this.#t.emit("exit",null,t),r="SIGHUP"===t?this.#e:t;o||e.kill(e.pid,r)}};this.#n=e.reallyExit,this.#r=e.emit}onExit(e,t){if(!g(this.#o))return()=>{};!1===this.#a&&this.load();let o=t?.alwaysLast?"afterExit":"exit";return this.#t.on(o,e),()=>{this.#t.removeListener(o,e),0===this.#t.listeners.exit.length&&0===this.#t.listeners.afterExit.length&&this.unload()}}load(){if(!this.#a){for(let e of(this.#a=!0,this.#t.count+=1,f))try{let t=this.#i[e];t&&this.#o.on(e,t)}catch(e){}this.#o.emit=(e,...t)=>this.#s(e,...t),this.#o.reallyExit=e=>this.#l(e)}}unload(){this.#a&&(this.#a=!1,f.forEach(e=>{let t=this.#i[e];if(!t)throw Error("Listener not defined for signal: "+e);try{this.#o.removeListener(e,t)}catch(e){}}),this.#o.emit=this.#r,this.#o.reallyExit=this.#n,this.#t.count-=1)}#l(e){return g(this.#o)?(this.#o.exitCode=e||0,this.#t.emit("exit",this.#o.exitCode,null),this.#n.call(this.#o,this.#o.exitCode)):0}#s(e,...t){let o=this.#r;if(!("exit"===e&&g(this.#o)))return o.call(this.#o,e,...t);{"number"==typeof t[0]&&(this.#o.exitCode=t[0]);let r=o.call(this.#o,e,...t);return this.#t.emit("exit",this.#o.exitCode,null),r}}}let F=globalThis.process,{onExit:_,load:C,unload:$}=(r=g(F)?new b(F):new class extends v{onExit(){return()=>{}}load(){}unload(){}},{onExit:(e,t)=>r.onExit(e,t),load:()=>r.load(),unload:()=>r.unload()}),E=n.stderr.isTTY?n.stderr:n.stdout.isTTY?n.stdout:void 0,w=E?p(()=>{_(()=>{E.write("\x1b[?25h")},{alwaysLast:!0})}):()=>{},k=!1,S={};S.show=(e=n.stderr)=>{e.isTTY&&(k=!1,e.write("\x1b[?25h"))},S.hide=(e=n.stderr)=>{e.isTTY&&(w(),k=!0,e.write("\x1b[?25l"))},S.toggle=(e,t)=>{void 0!==e&&(k=e),k?S.show(t):S.hide(t)};var x=o(47661);let O={info:i.default.blue("ℹ"),success:i.default.green("✔"),warning:i.default.yellow("⚠"),error:i.default.red("✖")},A={info:i.default.blue("i"),success:i.default.green("√"),warning:i.default.yellow("‼"),error:i.default.red("\xd7")},j=("win32"!==n.platform?"linux"!==n.env.TERM:n.env.CI||n.env.WT_SESSION||n.env.TERMINUS_SUBLIME||"{cmd::Cmder}"===n.env.ConEmuTask||"Terminus-Sublime"===n.env.TERM_PROGRAM||"vscode"===n.env.TERM_PROGRAM||"xterm-256color"===n.env.TERM||"alacritty"===n.env.TERM||"JetBrains-JediTerm"===n.env.TERMINAL_EMULATOR)?O:A,I=function({onlyFirst:e=!1}={}){return RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",e?void 0:"g")}();function B(e){if("string"!=typeof e)throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(I,"")}let N=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g,P=new Intl.Segmenter,T=/^\p{Default_Ignorable_Code_Point}$/u;var R=o(29122);let M=new class{#u=0;start(){this.#u++,1===this.#u&&this.#c()}stop(){if(this.#u<=0)throw Error("`stop` called more times than `start`");this.#u--,0===this.#u&&this.#d()}#c(){"win32"!==n.platform&&n.stdin.isTTY&&(n.stdin.setRawMode(!0),n.stdin.on("data",this.#p),n.stdin.resume())}#d(){n.stdin.isTTY&&(n.stdin.off("data",this.#p),n.stdin.pause(),n.stdin.setRawMode(!1))}#p(e){3===e[0]&&n.emit("SIGINT")}};class U{#f=0;#g=!1;#h=0;#m=-1;#D=0;#y;#v;#b;#F;#_;#C;#$;#E;#w;#k;#S;color;constructor(e){"string"==typeof e&&(e={text:e}),this.#y={color:"cyan",stream:n.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#y.color,this.spinner=this.#y.spinner,this.#_=this.#y.interval,this.#b=this.#y.stream,this.#C="boolean"==typeof this.#y.isEnabled?this.#y.isEnabled:function({stream:e=process.stdout}={}){return!!(e&&e.isTTY&&"dumb"!==process.env.TERM&&!("CI"in process.env))}({stream:this.#b}),this.#$="boolean"==typeof this.#y.isSilent&&this.#y.isSilent,this.text=this.#y.text,this.prefixText=this.#y.prefixText,this.suffixText=this.#y.suffixText,this.indent=this.#y.indent}get indent(){return this.#E}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw Error("The `indent` option must be an integer from 0 and up");this.#E=e,this.#x()}get interval(){return this.#_??this.#v.interval??100}get spinner(){return this.#v}set spinner(e){if(this.#m=-1,this.#_=void 0,"object"==typeof e){if(void 0===e.frames)throw Error("The given spinner must have a `frames` property");this.#v=e}else if((0,R.A)())if(void 0===e)this.#v=x.dots;else if("default"!==e&&x[e])this.#v=x[e];else throw Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`);else this.#v=x.line}get text(){return this.#w}set text(e=""){this.#w=e,this.#x()}get prefixText(){return this.#k}set prefixText(e=""){this.#k=e,this.#x()}get suffixText(){return this.#S}set suffixText(e=""){this.#S=e,this.#x()}get isSpinning(){return void 0!==this.#F}#O(e=this.#k,t=" "){return"string"==typeof e&&""!==e?e+t:"function"==typeof e?e()+t:""}#A(e=this.#S,t=" "){return"string"==typeof e&&""!==e?t+e:"function"==typeof e?t+e():""}#x(){let e=this.#b.columns??80,t=this.#O(this.#k,"-"),o=this.#A(this.#S,"-"),r=" ".repeat(this.#E)+t+"--"+this.#w+"--"+o;for(let t of(this.#h=0,B(r).split("\n")))this.#h+=Math.max(1,Math.ceil(function(e,t={}){if("string"!=typeof e||0===e.length)return 0;let{ambiguousIsNarrow:o=!0,countAnsiEscapeCodes:r=!1}=t;if(r||(e=B(e)),0===e.length)return 0;let n=0,i={ambiguousAsWide:!o};for(let{segment:t}of P.segment(e)){let e=t.codePointAt(0);if(!(e<=31)&&(!(e>=127)||!(e<=159))&&(!(e>=8203)||!(e<=8207))&&65279!==e&&(!(e>=768)||!(e<=879))&&(!(e>=6832)||!(e<=6911))&&(!(e>=7616)||!(e<=7679))&&(!(e>=8400)||!(e<=8447))&&(!(e>=65056)||!(e<=65071))&&(!(e>=55296)||!(e<=57343))&&(!(e>=65024)||!(e<=65039))&&!T.test(t)){if(N().test(t)){n+=2;continue}n+=function(e,{ambiguousAsWide:t=!1}={}){var o;if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`);return 12288===e||e>=65281&&e<=65376||e>=65504&&e<=65510||(o=e)>=4352&&o<=4447||8986===o||8987===o||9001===o||9002===o||o>=9193&&o<=9196||9200===o||9203===o||9725===o||9726===o||9748===o||9749===o||o>=9776&&o<=9783||o>=9800&&o<=9811||9855===o||o>=9866&&o<=9871||9875===o||9889===o||9898===o||9899===o||9917===o||9918===o||9924===o||9925===o||9934===o||9940===o||9962===o||9970===o||9971===o||9973===o||9978===o||9981===o||9989===o||9994===o||9995===o||10024===o||10060===o||10062===o||o>=10067&&o<=10069||10071===o||o>=10133&&o<=10135||10160===o||10175===o||11035===o||11036===o||11088===o||11093===o||o>=11904&&o<=11929||o>=11931&&o<=12019||o>=12032&&o<=12245||o>=12272&&o<=12287||o>=12289&&o<=12350||o>=12353&&o<=12438||o>=12441&&o<=12543||o>=12549&&o<=12591||o>=12593&&o<=12686||o>=12688&&o<=12773||o>=12783&&o<=12830||o>=12832&&o<=12871||o>=12880&&o<=42124||o>=42128&&o<=42182||o>=43360&&o<=43388||o>=44032&&o<=55203||o>=63744&&o<=64255||o>=65040&&o<=65049||o>=65072&&o<=65106||o>=65108&&o<=65126||o>=65128&&o<=65131||o>=94176&&o<=94180||o>=94192&&o<=94198||o>=94208&&o<=101589||o>=101631&&o<=101662||o>=101760&&o<=101874||o>=110576&&o<=110579||o>=110581&&o<=110587||110589===o||110590===o||o>=110592&&o<=110882||110898===o||o>=110928&&o<=110930||110933===o||o>=110948&&o<=110951||o>=110960&&o<=111355||o>=119552&&o<=119638||o>=119648&&o<=119670||126980===o||127183===o||127374===o||o>=127377&&o<=127386||o>=127488&&o<=127490||o>=127504&&o<=127547||o>=127552&&o<=127560||127568===o||127569===o||o>=127584&&o<=127589||o>=127744&&o<=127776||o>=127789&&o<=127797||o>=127799&&o<=127868||o>=127870&&o<=127891||o>=127904&&o<=127946||o>=127951&&o<=127955||o>=127968&&o<=127984||127988===o||o>=127992&&o<=128062||128064===o||o>=128066&&o<=128252||o>=128255&&o<=128317||o>=128331&&o<=128334||o>=128336&&o<=128359||128378===o||128405===o||128406===o||128420===o||o>=128507&&o<=128591||o>=128640&&o<=128709||128716===o||o>=128720&&o<=128722||o>=128725&&o<=128728||o>=128732&&o<=128735||128747===o||128748===o||o>=128756&&o<=128764||o>=128992&&o<=129003||129008===o||o>=129292&&o<=129338||o>=129340&&o<=129349||o>=129351&&o<=129535||o>=129648&&o<=129660||o>=129664&&o<=129674||o>=129678&&o<=129734||129736===o||o>=129741&&o<=129756||o>=129759&&o<=129770||o>=129775&&o<=129784||o>=131072&&o<=196605||o>=196608&&o<=262141||t&&(161===e||164===e||167===e||168===e||170===e||173===e||174===e||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||198===e||208===e||215===e||216===e||e>=222&&e<=225||230===e||e>=232&&e<=234||236===e||237===e||240===e||242===e||243===e||e>=247&&e<=250||252===e||254===e||257===e||273===e||275===e||283===e||294===e||295===e||299===e||e>=305&&e<=307||312===e||e>=319&&e<=322||324===e||e>=328&&e<=331||333===e||338===e||339===e||358===e||359===e||363===e||462===e||464===e||466===e||468===e||470===e||472===e||474===e||476===e||593===e||609===e||708===e||711===e||e>=713&&e<=715||717===e||720===e||e>=728&&e<=731||733===e||735===e||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||1025===e||e>=1040&&e<=1103||1105===e||8208===e||e>=8211&&e<=8214||8216===e||8217===e||8220===e||8221===e||e>=8224&&e<=8226||e>=8228&&e<=8231||8240===e||8242===e||8243===e||8245===e||8251===e||8254===e||8308===e||8319===e||e>=8321&&e<=8324||8364===e||8451===e||8453===e||8457===e||8467===e||8470===e||8481===e||8482===e||8486===e||8491===e||8531===e||8532===e||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||8585===e||e>=8592&&e<=8601||8632===e||8633===e||8658===e||8660===e||8679===e||8704===e||8706===e||8707===e||8711===e||8712===e||8715===e||8719===e||8721===e||8725===e||8730===e||e>=8733&&e<=8736||8739===e||8741===e||e>=8743&&e<=8748||8750===e||e>=8756&&e<=8759||8764===e||8765===e||8776===e||8780===e||8786===e||8800===e||8801===e||e>=8804&&e<=8807||8810===e||8811===e||8814===e||8815===e||8834===e||8835===e||8838===e||8839===e||8853===e||8857===e||8869===e||8895===e||8978===e||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||9632===e||9633===e||e>=9635&&e<=9641||9650===e||9651===e||9654===e||9655===e||9660===e||9661===e||9664===e||9665===e||e>=9670&&e<=9672||9675===e||e>=9678&&e<=9681||e>=9698&&e<=9701||9711===e||9733===e||9734===e||9737===e||9742===e||9743===e||9756===e||9758===e||9792===e||9794===e||9824===e||9825===e||e>=9827&&e<=9829||e>=9831&&e<=9834||9836===e||9837===e||9839===e||9886===e||9887===e||9919===e||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||9955===e||9960===e||9961===e||e>=9963&&e<=9969||9972===e||e>=9974&&e<=9977||9979===e||9980===e||9982===e||9983===e||10045===e||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||65533===e||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||127375===e||127376===e||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109)?2:1}(e,i)}}return n}(t,{countAnsiEscapeCodes:!0})/e))}get isEnabled(){return this.#C&&!this.#$}set isEnabled(e){if("boolean"!=typeof e)throw TypeError("The `isEnabled` option must be a boolean");this.#C=e}get isSilent(){return this.#$}set isSilent(e){if("boolean"!=typeof e)throw TypeError("The `isSilent` option must be a boolean");this.#$=e}frame(){let e=Date.now();(-1===this.#m||e-this.#D>=this.interval)&&(this.#m=++this.#m%this.#v.frames.length,this.#D=e);let{frames:t}=this.#v,o=t[this.#m];return this.color&&(o=i.default[this.color](o)),("string"==typeof this.#k&&""!==this.#k?this.#k+" ":"")+o+("string"==typeof this.text?" "+this.text:"")+("string"==typeof this.#S&&""!==this.#S?" "+this.#S:"")}clear(){if(!this.#C||!this.#b.isTTY)return this;this.#b.cursorTo(0);for(let e=0;e<this.#f;e++)e>0&&this.#b.moveCursor(0,-1),this.#b.clearLine(1);return(this.#E||this.lastIndent!==this.#E)&&this.#b.cursorTo(this.#E),this.lastIndent=this.#E,this.#f=0,this}render(){return this.#$||(this.clear(),this.#b.write(this.frame()),this.#f=this.#h),this}start(e){return e&&(this.text=e),this.#$||(this.#C?this.isSpinning||(this.#y.hideCursor&&S.hide(this.#b),this.#y.discardStdin&&n.stdin.isTTY&&(this.#g=!0,M.start()),this.render(),this.#F=setInterval(this.render.bind(this),this.interval)):this.text&&this.#b.write(`- ${this.text}
107
- `)),this}stop(){return this.#C&&(clearInterval(this.#F),this.#F=void 0,this.#m=0,this.clear(),this.#y.hideCursor&&S.show(this.#b),this.#y.discardStdin&&n.stdin.isTTY&&this.#g&&(M.stop(),this.#g=!1)),this}succeed(e){return this.stopAndPersist({symbol:j.success,text:e})}fail(e){return this.stopAndPersist({symbol:j.error,text:e})}warn(e){return this.stopAndPersist({symbol:j.warning,text:e})}info(e){return this.stopAndPersist({symbol:j.info,text:e})}stopAndPersist(e={}){if(this.#$)return this;let t=e.prefixText??this.#k,o=this.#O(t," "),r=e.symbol??" ",n=e.text??this.text,i=e.suffixText??this.#S,a=o+r+("string"==typeof n?(r?" ":"")+n:"")+this.#A(i," ")+"\n";return this.stop(),this.#b.write(a),this}}function J(e){return new U(e)}async function L(e,t){let o="function"==typeof e,r="function"==typeof e.then;if(!o&&!r)throw TypeError("Parameter `action` must be a Function or a Promise");let{successText:n,failText:i}="object"==typeof t?t:{successText:void 0,failText:void 0},a=J(t).start();try{let t=o?e(a):e,r=await t;return a.succeed(void 0===n?void 0:"string"==typeof n?n:n(r)),r}catch(e){throw a.fail(void 0===i?void 0:"string"==typeof i?i:i(e)),e}}},3900(e){e.exports=JSON.parse('{"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"dots13":{"interval":80,"frames":["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},"dots8Bit":{"interval":80,"frames":["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},"sand":{"interval":80,"frames":["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},"line":{"interval":130,"frames":["-","\\\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","\'","\xb4","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","\xb0","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"binary":{"interval":80,"frames":["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["\uD83D\uDE04 ","\uD83D\uDE1D "]},"monkey":{"interval":300,"frames":["\uD83D\uDE48 ","\uD83D\uDE48 ","\uD83D\uDE49 ","\uD83D\uDE4A "]},"hearts":{"interval":100,"frames":["\uD83D\uDC9B ","\uD83D\uDC99 ","\uD83D\uDC9C ","\uD83D\uDC9A ","❤️ "]},"clock":{"interval":100,"frames":["\uD83D\uDD5B ","\uD83D\uDD50 ","\uD83D\uDD51 ","\uD83D\uDD52 ","\uD83D\uDD53 ","\uD83D\uDD54 ","\uD83D\uDD55 ","\uD83D\uDD56 ","\uD83D\uDD57 ","\uD83D\uDD58 ","\uD83D\uDD59 ","\uD83D\uDD5A "]},"earth":{"interval":180,"frames":["\uD83C\uDF0D ","\uD83C\uDF0E ","\uD83C\uDF0F "]},"material":{"interval":17,"frames":["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},"moon":{"interval":80,"frames":["\uD83C\uDF11 ","\uD83C\uDF12 ","\uD83C\uDF13 ","\uD83C\uDF14 ","\uD83C\uDF15 ","\uD83C\uDF16 ","\uD83C\uDF17 ","\uD83C\uDF18 "]},"runner":{"interval":140,"frames":["\uD83D\uDEB6 ","\uD83C\uDFC3 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\\\____________▌","▐_|\\\\___________▌","▐__|\\\\__________▌","▐___|\\\\_________▌","▐____|\\\\________▌","▐_____|\\\\_______▌","▐______|\\\\______▌","▐_______|\\\\_____▌","▐________|\\\\____▌","▐_________|\\\\___▌","▐__________|\\\\__▌","▐___________|\\\\_▌","▐____________|\\\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","\uD83C\uDF24 ","⛅️ ","\uD83C\uDF25 ","☁️ ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","⛈ ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","☁️ ","\uD83C\uDF25 ","⛅️ ","\uD83C\uDF24 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["\uD83C\uDF32","\uD83C\uDF84"]},"grenade":{"interval":80,"frames":["، ","′ "," \xb4 "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},"point":{"interval":125,"frames":["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},"layer":{"interval":150,"frames":["-","=","≡"]},"betaWave":{"interval":80,"frames":["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},"fingerDance":{"interval":160,"frames":["\uD83E\uDD18 ","\uD83E\uDD1F ","\uD83D\uDD96 ","✋ ","\uD83E\uDD1A ","\uD83D\uDC46 "]},"fistBump":{"interval":80,"frames":["\uD83E\uDD1C    \uD83E\uDD1B ","\uD83E\uDD1C    \uD83E\uDD1B ","\uD83E\uDD1C    \uD83E\uDD1B "," \uD83E\uDD1C  \uD83E\uDD1B  ","  \uD83E\uDD1C\uD83E\uDD1B   "," \uD83E\uDD1C✨\uD83E\uDD1B   ","\uD83E\uDD1C ✨ \uD83E\uDD1B  "]},"soccerHeader":{"interval":80,"frames":[" \uD83E\uDDD1⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️\uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 "]},"mindblown":{"interval":160,"frames":["\uD83D\uDE10 ","\uD83D\uDE10 ","\uD83D\uDE2E ","\uD83D\uDE2E ","\uD83D\uDE26 ","\uD83D\uDE26 ","\uD83D\uDE27 ","\uD83D\uDE27 ","\uD83E\uDD2F ","\uD83D\uDCA5 ","✨ ","  ","  ","  "]},"speaker":{"interval":160,"frames":["\uD83D\uDD08 ","\uD83D\uDD09 ","\uD83D\uDD0A ","\uD83D\uDD09 "]},"orangePulse":{"interval":100,"frames":["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 "]},"bluePulse":{"interval":100,"frames":["\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},"orangeBluePulse":{"interval":100,"frames":["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 ","\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},"timeTravel":{"interval":100,"frames":["\uD83D\uDD5B ","\uD83D\uDD5A ","\uD83D\uDD59 ","\uD83D\uDD58 ","\uD83D\uDD57 ","\uD83D\uDD56 ","\uD83D\uDD55 ","\uD83D\uDD54 ","\uD83D\uDD53 ","\uD83D\uDD52 ","\uD83D\uDD51 ","\uD83D\uDD50 "]},"aesthetic":{"interval":80,"frames":["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},"dwarfFortress":{"interval":80,"frames":[" ██████\xa3\xa3\xa3 ","☺██████\xa3\xa3\xa3 ","☺██████\xa3\xa3\xa3 ","☺▓█████\xa3\xa3\xa3 ","☺▓█████\xa3\xa3\xa3 ","☺▒█████\xa3\xa3\xa3 ","☺▒█████\xa3\xa3\xa3 ","☺░█████\xa3\xa3\xa3 ","☺░█████\xa3\xa3\xa3 ","☺ █████\xa3\xa3\xa3 "," ☺█████\xa3\xa3\xa3 "," ☺█████\xa3\xa3\xa3 "," ☺▓████\xa3\xa3\xa3 "," ☺▓████\xa3\xa3\xa3 "," ☺▒████\xa3\xa3\xa3 "," ☺▒████\xa3\xa3\xa3 "," ☺░████\xa3\xa3\xa3 "," ☺░████\xa3\xa3\xa3 "," ☺ ████\xa3\xa3\xa3 "," ☺████\xa3\xa3\xa3 "," ☺████\xa3\xa3\xa3 "," ☺▓███\xa3\xa3\xa3 "," ☺▓███\xa3\xa3\xa3 "," ☺▒███\xa3\xa3\xa3 "," ☺▒███\xa3\xa3\xa3 "," ☺░███\xa3\xa3\xa3 "," ☺░███\xa3\xa3\xa3 "," ☺ ███\xa3\xa3\xa3 "," ☺███\xa3\xa3\xa3 "," ☺███\xa3\xa3\xa3 "," ☺▓██\xa3\xa3\xa3 "," ☺▓██\xa3\xa3\xa3 "," ☺▒██\xa3\xa3\xa3 "," ☺▒██\xa3\xa3\xa3 "," ☺░██\xa3\xa3\xa3 "," ☺░██\xa3\xa3\xa3 "," ☺ ██\xa3\xa3\xa3 "," ☺██\xa3\xa3\xa3 "," ☺██\xa3\xa3\xa3 "," ☺▓█\xa3\xa3\xa3 "," ☺▓█\xa3\xa3\xa3 "," ☺▒█\xa3\xa3\xa3 "," ☺▒█\xa3\xa3\xa3 "," ☺░█\xa3\xa3\xa3 "," ☺░█\xa3\xa3\xa3 "," ☺ █\xa3\xa3\xa3 "," ☺█\xa3\xa3\xa3 "," ☺█\xa3\xa3\xa3 "," ☺▓\xa3\xa3\xa3 "," ☺▓\xa3\xa3\xa3 "," ☺▒\xa3\xa3\xa3 "," ☺▒\xa3\xa3\xa3 "," ☺░\xa3\xa3\xa3 "," ☺░\xa3\xa3\xa3 "," ☺ \xa3\xa3\xa3 "," ☺\xa3\xa3\xa3 "," ☺\xa3\xa3\xa3 "," ☺▓\xa3\xa3 "," ☺▓\xa3\xa3 "," ☺▒\xa3\xa3 "," ☺▒\xa3\xa3 "," ☺░\xa3\xa3 "," ☺░\xa3\xa3 "," ☺ \xa3\xa3 "," ☺\xa3\xa3 "," ☺\xa3\xa3 "," ☺▓\xa3 "," ☺▓\xa3 "," ☺▒\xa3 "," ☺▒\xa3 "," ☺░\xa3 "," ☺░\xa3 "," ☺ \xa3 "," ☺\xa3 "," ☺\xa3 "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & \xa3 "," & ░\xa3 "," & ▒\xa3 "," & ▓\xa3 "," & \xa3\xa3 "," & ░\xa3\xa3 "," & ▒\xa3\xa3 ","& ▓\xa3\xa3 ","& \xa3\xa3\xa3 "," ░\xa3\xa3\xa3 "," ▒\xa3\xa3\xa3 "," ▓\xa3\xa3\xa3 "," █\xa3\xa3\xa3 "," ░█\xa3\xa3\xa3 "," ▒█\xa3\xa3\xa3 "," ▓█\xa3\xa3\xa3 "," ██\xa3\xa3\xa3 "," ░██\xa3\xa3\xa3 "," ▒██\xa3\xa3\xa3 "," ▓██\xa3\xa3\xa3 "," ███\xa3\xa3\xa3 "," ░███\xa3\xa3\xa3 "," ▒███\xa3\xa3\xa3 "," ▓███\xa3\xa3\xa3 "," ████\xa3\xa3\xa3 "," ░████\xa3\xa3\xa3 "," ▒████\xa3\xa3\xa3 "," ▓████\xa3\xa3\xa3 "," █████\xa3\xa3\xa3 "," ░█████\xa3\xa3\xa3 "," ▒█████\xa3\xa3\xa3 "," ▓█████\xa3\xa3\xa3 "," ██████\xa3\xa3\xa3 "," ██████\xa3\xa3\xa3 "]}}')}},h={};function m(e){var t=h[e];if(void 0!==t)return t.exports;var o=h[e]={exports:{}};return g[e].call(o.exports,o,o.exports,m),o.exports}m.m=g,n=(r="function"==typeof Symbol)?Symbol("rspack queues"):"__rspack_queues",i=m.aE=r?Symbol("rspack exports"):"__webpack_exports__",a=r?Symbol("rspack error"):"__rspack_error",s=r?Symbol("rspack done"):"__rspack_done",l=m.zS=r?Symbol("rspack defer"):"__rspack_defer",m.zT=e=>{if(e.some(e=>{var t=h[e];return!t||!1===t[s]}))return{then:(t,o)=>Promise.all(e.map(m)).then(t,o)}},u=e=>{e&&e.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))},m.a=(e,t,o)=>{o&&((r=[]).d=-1);var r,c,d,p,f=new Set,g=e.exports,h=new Promise((e,t)=>{p=t,d=e});h[i]=g,h[n]=e=>{r&&e(r),f.forEach(e),h.catch(()=>{})},e.exports=h,t(e=>{c=e.map(e=>{if(null!==e&&"object"==typeof e){if(!e[n]&&e[l]){var t=m.zT(e[l]);if(!t)return e;var o=e;e={then(e,r){t.then(()=>e(o),r)}}}if(e[n])return e;if(e.then){var r=[];r.d=0,e.then(e=>{s[i]=e,u(r)},e=>{s[a]=e,u(r)});var s={};return s[l]=!1,s[n]=e=>e(r),s}}var c={};return c[n]=()=>{},c[i]=e,c});var t,o=()=>c.map(e=>{if(e[l])return e;if(e[a])throw e[a];return e[i]}),s=new Promise(e=>{(t=()=>e(o)).r=0;var i=e=>e!==r&&!f.has(e)&&(f.add(e),e&&!e.d&&(t.r++,e.push(t)));c.map(e=>e[l]||e[n](i))});return t.r?s:o()},e=>(e?p(h[a]=e):d(g),u(r),h[s]=!0)),r&&r.d<0&&(r.d=0)},m.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return m.d(t,{a:t}),t},d=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,m.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var o=Object.create(null);m.r(o);var r={};c=c||[null,d({}),d([]),d(d)];for(var n=2&t&&e;("object"==typeof n||"function"==typeof n)&&!~c.indexOf(n);n=d(n))Object.getOwnPropertyNames(n).forEach(t=>{r[t]=()=>e[t]});return r.default=()=>e,m.d(o,r),o},m.d=(e,t)=>{for(var o in t)m.o(t,o)&&!m.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},m.f={},m.e=e=>Promise.all(Object.keys(m.f).reduce((t,o)=>(m.f[o](e,t),t),[])),m.u=e=>""+e+".js",m.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),m.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},m.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),p={410:0},f=e=>{var t,o,r=e.__rspack_esm_ids,n=e.__webpack_modules__,i=e.__rspack_esm_runtime,a=0;for(t in n)m.o(n,t)&&(m.m[t]=n[t]);for(i&&i(m);a<r.length;a++)o=r[a],m.o(p,o)&&p[o]&&p[o][0](),p[r[a]]=0},m.f.j=function(e,t){var o=m.o(p,e)?p[e]:void 0;if(0!==o)if(o)t.push(o[1]);else{var r=import("./"+m.u(e)).then(f,t=>{throw 0!==p[e]&&(p[e]=void 0),t}),r=Promise.race([r,new Promise(t=>{o=p[e]=[t]})]);t.push(o[1]=r)}};var D=m(1878),y=(D=await D).A,v=D.e;export{y as default,v as run};
107
+ `)),this}stop(){return this.#C&&(clearInterval(this.#F),this.#F=void 0,this.#m=0,this.clear(),this.#y.hideCursor&&S.show(this.#b),this.#y.discardStdin&&n.stdin.isTTY&&this.#g&&(M.stop(),this.#g=!1)),this}succeed(e){return this.stopAndPersist({symbol:j.success,text:e})}fail(e){return this.stopAndPersist({symbol:j.error,text:e})}warn(e){return this.stopAndPersist({symbol:j.warning,text:e})}info(e){return this.stopAndPersist({symbol:j.info,text:e})}stopAndPersist(e={}){if(this.#$)return this;let t=e.prefixText??this.#k,o=this.#O(t," "),r=e.symbol??" ",n=e.text??this.text,i=e.suffixText??this.#S,a=o+r+("string"==typeof n?(r?" ":"")+n:"")+this.#A(i," ")+"\n";return this.stop(),this.#b.write(a),this}}function J(e){return new U(e)}async function L(e,t){let o="function"==typeof e,r="function"==typeof e.then;if(!o&&!r)throw TypeError("Parameter `action` must be a Function or a Promise");let{successText:n,failText:i}="object"==typeof t?t:{successText:void 0,failText:void 0},a=J(t).start();try{let t=o?e(a):e,r=await t;return a.succeed(void 0===n?void 0:"string"==typeof n?n:n(r)),r}catch(e){throw a.fail(void 0===i?void 0:"string"==typeof i?i:i(e)),e}}},3900(e){e.exports=JSON.parse('{"dots":{"interval":80,"frames":["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},"dots2":{"interval":80,"frames":["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},"dots3":{"interval":80,"frames":["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},"dots4":{"interval":80,"frames":["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},"dots5":{"interval":80,"frames":["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},"dots6":{"interval":80,"frames":["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},"dots7":{"interval":80,"frames":["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},"dots8":{"interval":80,"frames":["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},"dots9":{"interval":80,"frames":["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},"dots10":{"interval":80,"frames":["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},"dots11":{"interval":100,"frames":["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},"dots12":{"interval":80,"frames":["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},"dots13":{"interval":80,"frames":["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},"dots8Bit":{"interval":80,"frames":["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},"sand":{"interval":80,"frames":["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},"line":{"interval":130,"frames":["-","\\\\","|","/"]},"line2":{"interval":100,"frames":["⠂","-","–","—","–","-"]},"pipe":{"interval":100,"frames":["┤","┘","┴","└","├","┌","┬","┐"]},"simpleDots":{"interval":400,"frames":[". ",".. ","..."," "]},"simpleDotsScrolling":{"interval":200,"frames":[". ",".. ","..."," .."," ."," "]},"star":{"interval":70,"frames":["✶","✸","✹","✺","✹","✷"]},"star2":{"interval":80,"frames":["+","x","*"]},"flip":{"interval":70,"frames":["_","_","_","-","`","`","\'","\xb4","-","_","_","_"]},"hamburger":{"interval":100,"frames":["☱","☲","☴"]},"growVertical":{"interval":120,"frames":["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},"growHorizontal":{"interval":120,"frames":["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},"balloon":{"interval":140,"frames":[" ",".","o","O","@","*"," "]},"balloon2":{"interval":120,"frames":[".","o","O","\xb0","O","o","."]},"noise":{"interval":100,"frames":["▓","▒","░"]},"bounce":{"interval":120,"frames":["⠁","⠂","⠄","⠂"]},"boxBounce":{"interval":120,"frames":["▖","▘","▝","▗"]},"boxBounce2":{"interval":100,"frames":["▌","▀","▐","▄"]},"triangle":{"interval":50,"frames":["◢","◣","◤","◥"]},"binary":{"interval":80,"frames":["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},"arc":{"interval":100,"frames":["◜","◠","◝","◞","◡","◟"]},"circle":{"interval":120,"frames":["◡","⊙","◠"]},"squareCorners":{"interval":180,"frames":["◰","◳","◲","◱"]},"circleQuarters":{"interval":120,"frames":["◴","◷","◶","◵"]},"circleHalves":{"interval":50,"frames":["◐","◓","◑","◒"]},"squish":{"interval":100,"frames":["╫","╪"]},"toggle":{"interval":250,"frames":["⊶","⊷"]},"toggle2":{"interval":80,"frames":["▫","▪"]},"toggle3":{"interval":120,"frames":["□","■"]},"toggle4":{"interval":100,"frames":["■","□","▪","▫"]},"toggle5":{"interval":100,"frames":["▮","▯"]},"toggle6":{"interval":300,"frames":["ဝ","၀"]},"toggle7":{"interval":80,"frames":["⦾","⦿"]},"toggle8":{"interval":100,"frames":["◍","◌"]},"toggle9":{"interval":100,"frames":["◉","◎"]},"toggle10":{"interval":100,"frames":["㊂","㊀","㊁"]},"toggle11":{"interval":50,"frames":["⧇","⧆"]},"toggle12":{"interval":120,"frames":["☗","☖"]},"toggle13":{"interval":80,"frames":["=","*","-"]},"arrow":{"interval":100,"frames":["←","↖","↑","↗","→","↘","↓","↙"]},"arrow2":{"interval":80,"frames":["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},"arrow3":{"interval":120,"frames":["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},"bouncingBar":{"interval":80,"frames":["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},"bouncingBall":{"interval":80,"frames":["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},"smiley":{"interval":200,"frames":["\uD83D\uDE04 ","\uD83D\uDE1D "]},"monkey":{"interval":300,"frames":["\uD83D\uDE48 ","\uD83D\uDE48 ","\uD83D\uDE49 ","\uD83D\uDE4A "]},"hearts":{"interval":100,"frames":["\uD83D\uDC9B ","\uD83D\uDC99 ","\uD83D\uDC9C ","\uD83D\uDC9A ","❤️ "]},"clock":{"interval":100,"frames":["\uD83D\uDD5B ","\uD83D\uDD50 ","\uD83D\uDD51 ","\uD83D\uDD52 ","\uD83D\uDD53 ","\uD83D\uDD54 ","\uD83D\uDD55 ","\uD83D\uDD56 ","\uD83D\uDD57 ","\uD83D\uDD58 ","\uD83D\uDD59 ","\uD83D\uDD5A "]},"earth":{"interval":180,"frames":["\uD83C\uDF0D ","\uD83C\uDF0E ","\uD83C\uDF0F "]},"material":{"interval":17,"frames":["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},"moon":{"interval":80,"frames":["\uD83C\uDF11 ","\uD83C\uDF12 ","\uD83C\uDF13 ","\uD83C\uDF14 ","\uD83C\uDF15 ","\uD83C\uDF16 ","\uD83C\uDF17 ","\uD83C\uDF18 "]},"runner":{"interval":140,"frames":["\uD83D\uDEB6 ","\uD83C\uDFC3 "]},"pong":{"interval":80,"frames":["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},"shark":{"interval":120,"frames":["▐|\\\\____________▌","▐_|\\\\___________▌","▐__|\\\\__________▌","▐___|\\\\_________▌","▐____|\\\\________▌","▐_____|\\\\_______▌","▐______|\\\\______▌","▐_______|\\\\_____▌","▐________|\\\\____▌","▐_________|\\\\___▌","▐__________|\\\\__▌","▐___________|\\\\_▌","▐____________|\\\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},"dqpb":{"interval":100,"frames":["d","q","p","b"]},"weather":{"interval":100,"frames":["☀️ ","☀️ ","☀️ ","\uD83C\uDF24 ","⛅️ ","\uD83C\uDF25 ","☁️ ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","⛈ ","\uD83C\uDF28 ","\uD83C\uDF27 ","\uD83C\uDF28 ","☁️ ","\uD83C\uDF25 ","⛅️ ","\uD83C\uDF24 ","☀️ ","☀️ "]},"christmas":{"interval":400,"frames":["\uD83C\uDF32","\uD83C\uDF84"]},"grenade":{"interval":80,"frames":["، ","′ "," \xb4 "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},"point":{"interval":125,"frames":["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},"layer":{"interval":150,"frames":["-","=","≡"]},"betaWave":{"interval":80,"frames":["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},"fingerDance":{"interval":160,"frames":["\uD83E\uDD18 ","\uD83E\uDD1F ","\uD83D\uDD96 ","✋ ","\uD83E\uDD1A ","\uD83D\uDC46 "]},"fistBump":{"interval":80,"frames":["\uD83E\uDD1C    \uD83E\uDD1B ","\uD83E\uDD1C    \uD83E\uDD1B ","\uD83E\uDD1C    \uD83E\uDD1B "," \uD83E\uDD1C  \uD83E\uDD1B  ","  \uD83E\uDD1C\uD83E\uDD1B   "," \uD83E\uDD1C✨\uD83E\uDD1B   ","\uD83E\uDD1C ✨ \uD83E\uDD1B  "]},"soccerHeader":{"interval":80,"frames":[" \uD83E\uDDD1⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️\uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 ","\uD83E\uDDD1 ⚽️ \uD83E\uDDD1 "]},"mindblown":{"interval":160,"frames":["\uD83D\uDE10 ","\uD83D\uDE10 ","\uD83D\uDE2E ","\uD83D\uDE2E ","\uD83D\uDE26 ","\uD83D\uDE26 ","\uD83D\uDE27 ","\uD83D\uDE27 ","\uD83E\uDD2F ","\uD83D\uDCA5 ","✨ ","  ","  ","  "]},"speaker":{"interval":160,"frames":["\uD83D\uDD08 ","\uD83D\uDD09 ","\uD83D\uDD0A ","\uD83D\uDD09 "]},"orangePulse":{"interval":100,"frames":["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 "]},"bluePulse":{"interval":100,"frames":["\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},"orangeBluePulse":{"interval":100,"frames":["\uD83D\uDD38 ","\uD83D\uDD36 ","\uD83D\uDFE0 ","\uD83D\uDFE0 ","\uD83D\uDD36 ","\uD83D\uDD39 ","\uD83D\uDD37 ","\uD83D\uDD35 ","\uD83D\uDD35 ","\uD83D\uDD37 "]},"timeTravel":{"interval":100,"frames":["\uD83D\uDD5B ","\uD83D\uDD5A ","\uD83D\uDD59 ","\uD83D\uDD58 ","\uD83D\uDD57 ","\uD83D\uDD56 ","\uD83D\uDD55 ","\uD83D\uDD54 ","\uD83D\uDD53 ","\uD83D\uDD52 ","\uD83D\uDD51 ","\uD83D\uDD50 "]},"aesthetic":{"interval":80,"frames":["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},"dwarfFortress":{"interval":80,"frames":[" ██████\xa3\xa3\xa3 ","☺██████\xa3\xa3\xa3 ","☺██████\xa3\xa3\xa3 ","☺▓█████\xa3\xa3\xa3 ","☺▓█████\xa3\xa3\xa3 ","☺▒█████\xa3\xa3\xa3 ","☺▒█████\xa3\xa3\xa3 ","☺░█████\xa3\xa3\xa3 ","☺░█████\xa3\xa3\xa3 ","☺ █████\xa3\xa3\xa3 "," ☺█████\xa3\xa3\xa3 "," ☺█████\xa3\xa3\xa3 "," ☺▓████\xa3\xa3\xa3 "," ☺▓████\xa3\xa3\xa3 "," ☺▒████\xa3\xa3\xa3 "," ☺▒████\xa3\xa3\xa3 "," ☺░████\xa3\xa3\xa3 "," ☺░████\xa3\xa3\xa3 "," ☺ ████\xa3\xa3\xa3 "," ☺████\xa3\xa3\xa3 "," ☺████\xa3\xa3\xa3 "," ☺▓███\xa3\xa3\xa3 "," ☺▓███\xa3\xa3\xa3 "," ☺▒███\xa3\xa3\xa3 "," ☺▒███\xa3\xa3\xa3 "," ☺░███\xa3\xa3\xa3 "," ☺░███\xa3\xa3\xa3 "," ☺ ███\xa3\xa3\xa3 "," ☺███\xa3\xa3\xa3 "," ☺███\xa3\xa3\xa3 "," ☺▓██\xa3\xa3\xa3 "," ☺▓██\xa3\xa3\xa3 "," ☺▒██\xa3\xa3\xa3 "," ☺▒██\xa3\xa3\xa3 "," ☺░██\xa3\xa3\xa3 "," ☺░██\xa3\xa3\xa3 "," ☺ ██\xa3\xa3\xa3 "," ☺██\xa3\xa3\xa3 "," ☺██\xa3\xa3\xa3 "," ☺▓█\xa3\xa3\xa3 "," ☺▓█\xa3\xa3\xa3 "," ☺▒█\xa3\xa3\xa3 "," ☺▒█\xa3\xa3\xa3 "," ☺░█\xa3\xa3\xa3 "," ☺░█\xa3\xa3\xa3 "," ☺ █\xa3\xa3\xa3 "," ☺█\xa3\xa3\xa3 "," ☺█\xa3\xa3\xa3 "," ☺▓\xa3\xa3\xa3 "," ☺▓\xa3\xa3\xa3 "," ☺▒\xa3\xa3\xa3 "," ☺▒\xa3\xa3\xa3 "," ☺░\xa3\xa3\xa3 "," ☺░\xa3\xa3\xa3 "," ☺ \xa3\xa3\xa3 "," ☺\xa3\xa3\xa3 "," ☺\xa3\xa3\xa3 "," ☺▓\xa3\xa3 "," ☺▓\xa3\xa3 "," ☺▒\xa3\xa3 "," ☺▒\xa3\xa3 "," ☺░\xa3\xa3 "," ☺░\xa3\xa3 "," ☺ \xa3\xa3 "," ☺\xa3\xa3 "," ☺\xa3\xa3 "," ☺▓\xa3 "," ☺▓\xa3 "," ☺▒\xa3 "," ☺▒\xa3 "," ☺░\xa3 "," ☺░\xa3 "," ☺ \xa3 "," ☺\xa3 "," ☺\xa3 "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & \xa3 "," & ░\xa3 "," & ▒\xa3 "," & ▓\xa3 "," & \xa3\xa3 "," & ░\xa3\xa3 "," & ▒\xa3\xa3 ","& ▓\xa3\xa3 ","& \xa3\xa3\xa3 "," ░\xa3\xa3\xa3 "," ▒\xa3\xa3\xa3 "," ▓\xa3\xa3\xa3 "," █\xa3\xa3\xa3 "," ░█\xa3\xa3\xa3 "," ▒█\xa3\xa3\xa3 "," ▓█\xa3\xa3\xa3 "," ██\xa3\xa3\xa3 "," ░██\xa3\xa3\xa3 "," ▒██\xa3\xa3\xa3 "," ▓██\xa3\xa3\xa3 "," ███\xa3\xa3\xa3 "," ░███\xa3\xa3\xa3 "," ▒███\xa3\xa3\xa3 "," ▓███\xa3\xa3\xa3 "," ████\xa3\xa3\xa3 "," ░████\xa3\xa3\xa3 "," ▒████\xa3\xa3\xa3 "," ▓████\xa3\xa3\xa3 "," █████\xa3\xa3\xa3 "," ░█████\xa3\xa3\xa3 "," ▒█████\xa3\xa3\xa3 "," ▓█████\xa3\xa3\xa3 "," ██████\xa3\xa3\xa3 "," ██████\xa3\xa3\xa3 "]}}')}},h={};function m(e){var t=h[e];if(void 0!==t)return t.exports;var o=h[e]={exports:{}};return g[e].call(o.exports,o,o.exports,m),o.exports}m.m=g,n=(r="function"==typeof Symbol)?Symbol("rspack queues"):"__rspack_queues",i=m.aE=r?Symbol("rspack exports"):"__webpack_exports__",a=r?Symbol("rspack error"):"__rspack_error",s=r?Symbol("rspack done"):"__rspack_done",l=m.zS=r?Symbol("rspack defer"):"__rspack_defer",m.zT=e=>{if(e.some(e=>{var t=h[e];return!t||!1===t[s]}))return{then:(t,o)=>Promise.all(e.map(m)).then(t,o)}},u=e=>{e&&e.d<1&&(e.d=1,e.forEach(e=>e.r--),e.forEach(e=>e.r--?e.r++:e()))},m.a=(e,t,o)=>{o&&((r=[]).d=-1);var r,c,d,p,f=new Set,g=e.exports,h=new Promise((e,t)=>{p=t,d=e});h[i]=g,h[n]=e=>{r&&e(r),f.forEach(e),h.catch(()=>{})},e.exports=h,t(e=>{c=e.map(e=>{if(null!==e&&"object"==typeof e){if(!e[n]&&e[l]){var t=m.zT(e[l]);if(!t)return e;var o=e;e={then(e,r){t.then(()=>e(o),r)}}}if(e[n])return e;if(e.then){var r=[];r.d=0,e.then(e=>{s[i]=e,u(r)},e=>{s[a]=e,u(r)});var s={};return s[l]=!1,s[n]=e=>e(r),s}}var c={};return c[n]=()=>{},c[i]=e,c});var t,o=()=>c.map(e=>{if(e[l])return e;if(e[a])throw e[a];return e[i]}),s=new Promise(e=>{(t=()=>e(o)).r=0;var i=e=>e!==r&&!f.has(e)&&(f.add(e),e&&!e.d&&(t.r++,e.push(t)));c.map(e=>e[l]||e[n](i))});return t.r?s:o()},e=>(e?p(h[a]=e):d(g),u(r),h[s]=!0)),r&&r.d<0&&(r.d=0)},m.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return m.d(t,{a:t}),t},d=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,m.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var o=Object.create(null);m.r(o);var r={};c=c||[null,d({}),d([]),d(d)];for(var n=2&t&&e;("object"==typeof n||"function"==typeof n)&&!~c.indexOf(n);n=d(n))Object.getOwnPropertyNames(n).forEach(t=>{r[t]=()=>e[t]});return r.default=()=>e,m.d(o,r),o},m.d=(e,t)=>{for(var o in t)m.o(t,o)&&!m.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},m.f={},m.e=e=>Promise.all(Object.keys(m.f).reduce((t,o)=>(m.f[o](e,t),t),[])),m.u=e=>""+e+".js",m.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),m.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},m.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),p={8410:0},f=e=>{var t,o,r=e.__rspack_esm_ids,n=e.__webpack_modules__,i=e.__rspack_esm_runtime,a=0;for(t in n)m.o(n,t)&&(m.m[t]=n[t]);for(i&&i(m);a<r.length;a++)o=r[a],m.o(p,o)&&p[o]&&p[o][0](),p[r[a]]=0},m.f.j=function(e,t){var o=m.o(p,e)?p[e]:void 0;if(0!==o)if(o)t.push(o[1]);else{var r=import("./"+m.u(e)).then(f,t=>{throw 0!==p[e]&&(p[e]=void 0),t}),r=Promise.race([r,new Promise(t=>{o=p[e]=[t]})]);t.push(o[1]=r)}};var D=m(1878),y=(D=await D).A,v=D.e;export{y as default,v as run};