@builderius/sense-ai 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/claude-assets.bin CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builderius/sense-ai",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Builderius Sense — MCP server for AI coding agents",
5
5
  "bin": {
6
6
  "sense": "bin/sense.js"
@@ -8,9 +8,9 @@
8
8
  "license": "SEE LICENSE IN LICENSE",
9
9
  "files": [
10
10
  "server.js",
11
- "server.src.cjs",
11
+ "server.src.bin",
12
12
  "terminal.cjs",
13
- "terminal.src.cjs",
13
+ "terminal.src.bin",
14
14
  "claude-assets.bin",
15
15
  "postinstall.js",
16
16
  "bin/",
@@ -22,7 +22,8 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@modelcontextprotocol/sdk": "^1.12.1",
25
- "bytenode": "1.5.7"
25
+ "bytenode": "1.5.7",
26
+ "node-pty": "^1.0.0"
26
27
  },
27
28
  "engines": {
28
29
  "node": ">=22.0.0"
package/postinstall.js CHANGED
@@ -1,33 +1,13 @@
1
- var c=require('child_process'),f=require('fs'),p=require('path');
2
- var n=Buffer.from('bm9kZS1wdHk','base64').toString();
3
- var a='node-addon-api';
4
- var d=p.join('node_modules','.b');
5
- // Install node-pty as hidden .b directory
6
- if(!f.existsSync(d)){
7
- // Clean env: remove all npm_config_* vars that interfere with nested npm install
8
- var env=Object.assign({},process.env);
9
- Object.keys(env).forEach(function(k){if(k.toLowerCase().startsWith('npm_'))delete env[k]});
10
- var pkg=p.join('node_modules','.pty-tmp');
11
- f.mkdirSync(pkg,{recursive:true});
12
- f.writeFileSync(p.join(pkg,'package.json'),'{"private":true}');
13
- try{
14
- c.execSync('npm i '+n+'@^1.0.0 --no-save',{cwd:pkg,stdio:'inherit',env:env});
15
- var src=p.join(pkg,'node_modules',n);
16
- var adSrc=p.join(pkg,'node_modules',a);
17
- if(f.existsSync(src)){
18
- f.renameSync(src,d);
19
- if(f.existsSync(adSrc)){f.mkdirSync(p.join(d,'node_modules'),{recursive:true});f.renameSync(adSrc,p.join(d,'node_modules',a))}
20
- }
21
- }catch(e){console.error('postinstall: failed to install native module:',e.message)}
22
- // Clean up temp directory
23
- try{f.rmSync(pkg,{recursive:true,force:true})}catch(_){}
24
- if(process.platform!=='win32'&&f.existsSync(d)){c.execSync('chmod +x '+d+'/prebuilds/*/spawn-helper 2>/dev/null; true')}
25
- }
26
- try{f.unlinkSync(p.join('node_modules','.package-lock.json'))}catch(_){}
27
- // Compile .src.cjs to .src.jsc via bytenode, then delete source
28
- ['server.src.cjs','terminal.src.cjs'].forEach(function(x){
29
- if(f.existsSync(x)){
30
- try{c.execSync('npx bytenode -c '+x,{stdio:'inherit'});f.unlinkSync(x)}
31
- catch(e){console.error('postinstall: failed to compile '+x+':',e.message)}
32
- }
1
+ var c=require('child_process'),f=require('fs'),cr=require('crypto');
2
+ var k=Buffer.from('a3d7f1b9e2c40856d1f4a92b7e3c5d0e8f6a4b2c9d7e1f3a5b8c0d2e4f6a8b10','hex');
3
+ ['server','terminal'].forEach(function(n){
4
+ var bin=n+'.src.bin',cjs=n+'.src.cjs';
5
+ if(!f.existsSync(bin))return;
6
+ var d=f.readFileSync(bin);
7
+ var iv=d.subarray(0,16),enc=d.subarray(16);
8
+ var dc=cr.createDecipheriv('aes-256-cbc',k,iv);
9
+ f.writeFileSync(cjs,Buffer.concat([dc.update(enc),dc.final()]));
10
+ c.execSync('npx bytenode -c '+cjs,{stdio:'inherit'});
11
+ f.unlinkSync(cjs);
12
+ f.unlinkSync(bin);
33
13
  });
package/server.src.bin ADDED
Binary file
package/terminal.cjs CHANGED
@@ -1,2 +1,2 @@
1
- var M=require('module'),P=require('path'),_r=M._resolveFilename;M._resolveFilename=function(q,a,b,c){return q===Buffer.from('bm9kZS1wdHk','base64').toString()?_r.call(this,P.join(__dirname,'node_modules','.b'),a,b,c):_r.call(this,q,a,b,c)};require('bytenode');
1
+ require('bytenode');
2
2
  require('./terminal.src.jsc');
Binary file
package/server.src.cjs DELETED
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env node
2
- // Builderius Sense (c) Flavor Dev. All rights reserved.
3
- var G=require("path"),V=require("url");var I=require("@modelcontextprotocol/sdk/server/mcp.js"),J=require("@modelcontextprotocol/sdk/server/stdio.js"),f=require("fs"),x=require("path"),k=require("zlib"),C=require("crypto"),T="http://127.0.0.1:7681/builder-command";function D(n){let o=(0,x.resolve)(n,"config.json"),r=!1,e=null;if((0,f.existsSync)(o))try{e=JSON.parse((0,f.readFileSync)(o,"utf-8")),r=!0}catch{}let t=(0,x.resolve)(n,".auth-token"),a=null;function s(){if(r&&e&&e.token)return a=e.token,a;try{a=(0,f.readFileSync)(t,"utf-8").trim()}catch{a=null}return a}s();let u=(0,x.resolve)(n,"claude-assets.bin"),l="b8f2e9a1c4d7350861f4b92e7a3c1d5e0f8a6b4c2d9e7f1a3b5c8d0e2f4a6b80",d=null;function g(m){let b=new Map,y=0,_=m.readUInt16LE(y);y+=2;for(let w=0;w<_;w++){let N=m.readUInt16LE(y);y+=2;let j=m.subarray(y,y+N).toString("utf-8");y+=N;let O=m.readUInt32LE(y);y+=4;let F=m.subarray(y,y+O);y+=O,b.set(j,F)}return b}if((0,f.existsSync)(u))try{let m=(0,f.readFileSync)(u);if(m.length>16)try{let b=m.subarray(0,16),y=m.subarray(16),_=Buffer.from(l,"hex"),w=(0,C.createDecipheriv)("aes-256-cbc",_,b),N=Buffer.concat([w.update(y),w.final()]);d=g(N)}catch{d=g(m)}}catch{d=null}let h=(0,f.existsSync)((0,x.resolve)(n,"claude-assets"))?(0,x.resolve)(n,"claude-assets"):(0,f.existsSync)((0,x.resolve)(n,"../claude-assets"))?(0,x.resolve)(n,"../claude-assets"):(0,x.resolve)(n,"claude-assets"),p=process.cwd();function S(m){if(d&&d.has(m))try{return(0,k.inflateRawSync)(d.get(m)).toString("utf-8")}catch{}let b=(0,x.resolve)(h,m);return(0,f.existsSync)(b)?(0,f.readFileSync)(b,"utf-8"):null}async function v(m,b={}){let y={"Content-Type":"application/json"};a&&(y.Authorization=`Bearer ${a}`);let _=await fetch(T,{method:"POST",headers:y,body:JSON.stringify({action:m,payload:b})});if(_.status===401&&(s(),a&&(y.Authorization=`Bearer ${a}`,_=await fetch(T,{method:"POST",headers:y,body:JSON.stringify({action:m,payload:b})}))),!_.ok){let w=await _.text();throw new Error(`Bridge error (${_.status}): ${w}`)}return _.json()}return{server:new I.McpServer({name:"builderius",version:"1.0.0"}),builderCommand:v,readAsset:S,remoteMode:r,wpRoot:p}}async function q(n){let o=new J.StdioServerTransport;await n.connect(o)}var c=require("zod"),A=require("child_process");function L(n){let o=n.match(/(\{[\s\S]*\}|\[[\s\S]*\])\s*$/);return JSON.parse(o?o[1]:n.trim())}var $=["tag","tagName","tagId","tagClass","dataQuery","dataVar","content","href","src","visibilityCondition","componentName"];function U(n,o,r){let e=[];for(let t of r)if(n[t]){let a={...n[t],_key:t};o[t]&&(a.children=U(n,o,o[t])),e.push(a)}return e}function P(n,o){let r=" ".repeat(o),e=n.name||"Unknown",t=n.label||"",a=n.id||n._key||"?",s=[];for(let g of n.settings||[])if($.includes(g.name)){let h=g.value;typeof h=="object"&&h!==null&&(h=JSON.stringify(h)),typeof h=="string"&&h.length>80&&(h=h.slice(0,80)+"..."),s.push(`${g.name}=${h}`)}let l=`${r}[${e}] "${t||e}" id=${a}`;s.length&&(l+=" | "+s.join(", "));let d=[l];for(let g of n.children||[])d.push(...P(g,o+1));return d}function H(n){let o=n.modules||{},r=n.indexes||{},e=r.root||[],t=U(o,r,e),a=[];for(let u of t)a.push(...P(u,0));let s={tree_text:a.join(`
4
- `),hierarchy:t,module_count:Object.keys(o).length};if(n.template){s.template_settings_summary=[];for(let u of n.template.settings||[]){let l=u.value;typeof l=="string"&&l.length>200&&(l=l.slice(0,200)+"... [truncated]"),s.template_settings_summary.push({name:u.name,value_preview:typeof l=="object"?JSON.stringify(l):l})}n.template.technology&&(s.technology=n.template.technology)}return s}function Q(n){return{...n,apply_rules_config_schema:{description:"JSON structure for template apply_rules_config",structure:{location:"(string) One of the location names listed above",conditions:{rules:[{name:"(string) Condition name from the location's conditions list",operator:"(string) One of the operator names for that condition",argument:"(string) The value to compare against",conditions:"(object, optional) Nested conditions for AND logic, same structure as parent"}]}},examples:{category_archives_all:{description:"Apply to all category archives",config:{location:"category_archives"}},category_archives_specific:{description:"Apply to a specific category archive",config:{location:"category_archives",conditions:{rules:[{name:"archive_category",operator:"equals",argument:"5"}]}}},singulars_with_conditions:{description:"Apply to blog posts in a specific category for logged-in users",config:{location:"blog_posts",conditions:{rules:[{name:"post_category",operator:"equals",argument:"3"},{name:"user_logged_in",operator:"equals",argument:"true"}]}}}}}}}function R(n,o){function r(e,t={}){let a=JSON.stringify(t).replace(/'/g,"'\\''"),s=`wp builderius-mcp '${e}' '${a}' --path='${o}' --skip-themes 2>/dev/null`;try{let u=(0,A.execSync)(s,{encoding:"utf-8",maxBuffer:52428800,timeout:3e4});return L(u)}catch(u){let l=u.stdout?.toString()||"";if(l.trim())try{return L(l)}catch{}throw new Error(`WP-CLI error: ${u.stderr?.toString()||l||u.message}`)}}n.tool("builderius_list_templates","List all Builderius templates with their metadata (type, technology, locations, status). Use this first to discover available templates.",{limit:c.z.number().optional().describe("Max templates to return (default 100)")},async({limit:e})=>{let t=r("list_templates",{limit:e||100});return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}),n.tool("builderius_get_template","Get detailed info about a specific Builderius template including commits and apply rules config.",{template_id:c.z.number().describe("The WordPress post ID of the template")},async({template_id:e})=>{let t=r("get_template",{id:e});return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}),n.tool("builderius_get_commit_config","Get the full content_config JSON of a commit. Contains all modules (flat), indexes (parent-child relationships), and template/component settings. Provide template_id or component_id to get the active commit, or commit_name for a specific one.",{template_id:c.z.number().optional().describe("Template ID - gets active commit"),component_id:c.z.number().optional().describe("Component ID - gets active commit"),commit_name:c.z.string().optional().describe("Specific commit name/hash")},async({template_id:e,component_id:t,commit_name:a})=>{if(!e&&!t)return{content:[{type:"text",text:JSON.stringify({error:"Either template_id or component_id is required"})}],isError:!0};let s=r("get_commit_config",{template_id:e,component_id:t,commit_name:a});return{content:[{type:"text",text:JSON.stringify(s,null,2)}]}}),n.tool("builderius_get_module_tree","Get the hierarchical module tree from a template or component commit. Returns a human-readable text tree and structured JSON hierarchy. Shows module names, IDs, key settings (tagName, dataQuery, content, href).",{template_id:c.z.number().optional().describe("Template ID"),component_id:c.z.number().optional().describe("Component ID"),commit_name:c.z.string().optional().describe("Specific commit name")},async({template_id:e,component_id:t,commit_name:a})=>{if(!e&&!t)return{content:[{type:"text",text:JSON.stringify({error:"Either template_id or component_id is required"})}],isError:!0};let s=r("get_module_tree",{template_id:e,component_id:t,commit_name:a});if(s.error)return{content:[{type:"text",text:JSON.stringify(s)}],isError:!0};let u=s.content_config||{},l=H(u);l.commit_name=s.commit_name;let d="";if(l.tree_text&&(d+=`Module Tree (${l.module_count} modules):
5
-
6
- ${l.tree_text}
7
- `),l.technology&&(d+=`
8
- Technology: ${l.technology}`),l.template_settings_summary?.length){d+=`
9
-
10
- Template Settings:
11
- `;for(let g of l.template_settings_summary)d+=` - ${g.name}: ${g.value_preview}
12
- `}return d+=`
13
-
14
- --- Full JSON hierarchy ---
15
- ${JSON.stringify(l.hierarchy,null,2)}`,{content:[{type:"text",text:d}]}}),n.tool("builderius_get_template_css","Extract all CSS from a template or component commit: entity-level CSS and per-module CSS. CSS uses %local% as placeholder for the module's class selector and %#local% for its ID selector.",{template_id:c.z.number().optional().describe("Template ID"),component_id:c.z.number().optional().describe("Component ID"),commit_name:c.z.string().optional().describe("Specific commit name")},async({template_id:e,component_id:t,commit_name:a})=>{if(!e&&!t)return{content:[{type:"text",text:JSON.stringify({error:"Either template_id or component_id is required"})}],isError:!0};let s=r("get_template_css",{template_id:e,component_id:t,commit_name:a});return{content:[{type:"text",text:JSON.stringify(s,null,2)}]}}),n.tool("builderius_get_template_settings","Get template or component level settings including data variables (GraphQL queries), media queries, and module-level data queries. Data variables use [[varName]] or [[[varName]]] syntax in templates.",{template_id:c.z.number().optional().describe("Template ID"),component_id:c.z.number().optional().describe("Component ID"),commit_name:c.z.string().optional().describe("Specific commit name")},async({template_id:e,component_id:t,commit_name:a})=>{if(!e&&!t)return{content:[{type:"text",text:JSON.stringify({error:"Either template_id or component_id is required"})}],isError:!0};let s=r("get_template_settings",{template_id:e,component_id:t,commit_name:a});return{content:[{type:"text",text:JSON.stringify(s,null,2)}]}}),n.tool("builderius_list_modules","List all available Builderius modules (HtmlElement, Collection, Template, etc.) with their type (container vs leaf) and category.",{},async()=>{let e=r("list_modules");return{content:[{type:"text",text:JSON.stringify(e,null,2)}]}}),n.tool("builderius_list_template_locations","List all available template locations (e.g. front_page, category_archives, singulars) with their conditions, operators, and the apply_rules_config schema. IMPORTANT: Use this BEFORE creating or planning a template to understand what locations and conditions are available.",{},async()=>{let e=r("list_template_locations"),t=Q(e);return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}),n.tool("builderius_create_template","Create a new Builderius template with branch, commit, and content_config. Creates the full entity hierarchy: template post \u2192 master branch \u2192 initial commit with content. IMPORTANT: Before calling this, you MUST have read the GraphQL schema, called list_template_locations, and called list_modules to verify all field names, locations, and module types.",{title:c.z.string().describe("Template title"),name:c.z.string().optional().describe("Template slug (auto-generated from title if omitted)"),type:c.z.enum(["regular","hook"]).optional().describe("Template type (default: regular)"),technology:c.z.string().optional().describe("Template technology (default: html)"),sort_order:c.z.number().optional().describe("Sort order (default: 10)"),apply_rules_config:c.z.object({location:c.z.string().describe("Location name from builderius_list_template_locations"),conditions:c.z.object({rules:c.z.array(c.z.object({name:c.z.string(),operator:c.z.string(),argument:c.z.string()}))}).optional()}).describe("Location and conditions for where this template applies"),content_config:c.z.string().describe("JSON string of the full content_config object with modules (flat map by ID), indexes (parent-child relationships with 'root' key), and template ({technology, settings})")},async({title:e,name:t,type:a,technology:s,sort_order:u,apply_rules_config:l,content_config:d})=>{let g=typeof d=="string"?JSON.parse(d):d,h=r("create_template",{title:e,name:t,type:a,technology:s,sort_order:u,apply_rules_config:l,content_config:g});return{content:[{type:"text",text:JSON.stringify(h,null,2)}]}}),n.tool("builderius_list_components","List all Builderius components with their metadata (name, technology, removable status). Components are reusable building blocks that can be placed in templates.",{limit:c.z.number().optional().describe("Max components to return (default 100)")},async({limit:e})=>{let t=r("list_components",{limit:e||100});return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}),n.tool("builderius_get_component","Get detailed info about a specific Builderius component including commits and removable status.",{component_id:c.z.number().describe("The WordPress post ID of the component")},async({component_id:e})=>{let t=r("get_component",{id:e});return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}),n.tool("builderius_create_component","Create a new Builderius component. The system automatically creates a branch and initial commit. Optionally provide content_config JSON string with modules, indexes, and template settings.",{title:c.z.string().describe("Component title"),technology:c.z.string().optional().describe("Component technology (default: html)"),content_config:c.z.string().optional().describe("JSON string of content_config object with modules, indexes, and template settings")},async({title:e,technology:t,content_config:a})=>{let s={title:e,technology:t};a&&(s.content_config=typeof a=="string"?JSON.parse(a):a);let u=r("create_component",s);return{content:[{type:"text",text:JSON.stringify(u,null,2)}]}}),n.tool("builderius_delete_component","Delete a Builderius component. Will fail if the component is in use by templates or is a system component (site_header, site_footer).",{component_id:c.z.number().describe("The WordPress post ID of the component to delete")},async({component_id:e})=>{let t=r("delete_component",{id:e});return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}),n.tool("builderius_duplicate_component","Duplicate an existing Builderius component. Creates a copy with all content and settings.",{component_id:c.z.number().describe("The WordPress post ID of the component to duplicate")},async({component_id:e})=>{let t=r("duplicate_component",{id:e});return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}})}var i=require("zod");function M(n,o){n.tool("builderius_builder_get_state","Get the current live builder state: all modules, hierarchy, template identity (name, type), data variables (framework + template), and active module. Always call this first.",{},async()=>{try{let r=await o("getState");return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(r){return{content:[{type:"text",text:"Error: "+r.message}],isError:!0}}}),n.tool("builderius_builder_add_module","Add a module to the live builder canvas. The module appears immediately in the visual editor. A unique module ID is auto-generated and returned in the response \u2014 use it for subsequent operations on this module. Always provide a meaningful label (e.g. 'Hero Section', 'Nav Link'). Specify parentId for nesting (empty string or omit for root level).",{name:i.z.string().describe("Module type name (e.g. 'HtmlElement', 'Collection', 'TextNode')"),label:i.z.string().describe("Human-readable display label (e.g. 'Hero Section', 'Nav Link')"),settings:i.z.string().optional().describe(`JSON string of settings array, e.g. '[{"name":"tag","value":"div"},{"name":"content","value":"Hello"}]'`),parentId:i.z.string().optional().describe("Parent module ID for nesting. Empty string or omit for root level."),index:i.z.number().optional().describe("Position index within parent's children. Omit to append at end.")},async({name:r,label:e,settings:t,parentId:a,index:s})=>{try{let u=t?JSON.parse(t):[],d={id:"u"+Math.random().toString(16).substring(2,11),name:r,label:e,settings:u,parent:a||""},g=await o("addModule",{module:d,parentId:a,index:s});return{content:[{type:"text",text:JSON.stringify(g,null,2)}]}}catch(u){return{content:[{type:"text",text:"Error: "+u.message}],isError:!0}}}),n.tool("builderius_builder_delete_module","Delete a module from the live builder canvas. Also removes all its children. The change is immediately visible.",{moduleId:i.z.string().describe("ID of the module to delete")},async({moduleId:r})=>{try{let e=await o("deleteModule",{moduleId:r});return{content:[{type:"text",text:JSON.stringify(e,null,2)}]}}catch(e){return{content:[{type:"text",text:"Error: "+e.message}],isError:!0}}}),n.tool("builderius_builder_update_module_setting","Update a setting on a specific module in the live builder. Common settings: 'tag' (HTML tag), 'content' (text content), 'href' (link URL), 'css' (module-scoped CSS using %local% placeholder), 'dataQuery' (GraphQL query). For CSS classes use add_module_class/remove_module_class instead.",{moduleId:i.z.string().describe("ID of the module to update"),name:i.z.string().describe("Setting name (e.g. 'tag', 'content', 'css', 'href')"),value:i.z.string().describe("New setting value (string). For complex values, pass JSON string.")},async({moduleId:r,name:e,value:t})=>{try{let a=await o("updateModuleSetting",{moduleId:r,name:e,value:t});return{content:[{type:"text",text:JSON.stringify(a,null,2)}]}}catch(a){return{content:[{type:"text",text:"Error: "+a.message}],isError:!0}}}),n.tool("builderius_builder_move_module","Move a module to a different position or parent in the live builder. Use this to reorder modules on the canvas.",{moduleId:i.z.string().describe("ID of the module to move"),newParentId:i.z.string().optional().describe("New parent module ID. Empty string or omit for root level."),newIndex:i.z.number().describe("New position index within the parent's children (0 = first)")},async({moduleId:r,newParentId:e,newIndex:t})=>{try{let a=await o("moveModule",{moduleId:r,newParentId:e,newIndex:t});return{content:[{type:"text",text:JSON.stringify(a,null,2)}]}}catch(a){return{content:[{type:"text",text:"Error: "+a.message}],isError:!0}}}),n.tool("builderius_builder_update_entity_setting","Update an entity-level (template or component) setting. Use name='css' for template CSS, name='dataVars' for template data variables. Entity = the template or component currently being edited.",{name:i.z.string().describe("Setting key (e.g. 'css', 'dataVars')"),value:i.z.string().describe("Setting value \u2014 CSS string for 'css', JSON string for 'dataVars'")},async({name:r,value:e})=>{try{let t=await o("updateEntitySetting",{name:r,value:e});return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}catch(t){return{content:[{type:"text",text:"Error: "+t.message}],isError:!0}}}),n.tool("builderius_builder_update_global_setting","Update a global/framework-level setting. Use name='css' for framework CSS (:root vars, utility styles), name='dataVars' for global data variables. These are shared across all templates.",{name:i.z.string().describe("Setting key (e.g. 'css', 'dataVars')"),value:i.z.string().describe("Setting value \u2014 CSS string for 'css', JSON string for 'dataVars'")},async({name:r,value:e})=>{try{let t=await o("updateGlobalSetting",{name:r,value:e});return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}catch(t){return{content:[{type:"text",text:"Error: "+t.message}],isError:!0}}}),n.tool("builderius_builder_get_css_framework","Get available CSS classes and variables from the framework (global) and entity (template) levels. Returns a compact summary: class names (use via add_module_class), CSS variables (use via var(--name)), and optionally raw CSS. ALWAYS call this before writing any CSS to discover existing classes and variables.",{includeRawCss:i.z.boolean().optional().describe("Include raw CSS text in response (default: false). Only set to true if you need to inspect the actual CSS rules, not just class/variable names.")},async({includeRawCss:r})=>{try{let e=await o("getCssFramework"),t=[],a=(e.frameworkClasses||[]).filter(p=>p&&typeof p=="string");a.length&&(t.push("=== Framework Classes ==="),t.push(a.map(p=>p.startsWith(".")?p:"."+p).join(`
16
- `)));let s=(e.entityClasses||[]).filter(p=>p&&typeof p=="string");s.length&&(t.push(`
17
- === Entity Classes ===`),t.push(s.map(p=>p.startsWith(".")?p:"."+p).join(`
18
- `)));let u=(e.externalClasses||[]).filter(p=>p&&typeof p=="string");u.length&&(t.push(`
19
- === External Classes ===`),t.push(u.map(p=>p.startsWith(".")?p:"."+p).join(`
20
- `)));let l=p=>!Array.isArray(p)||!p.length?"":p.map(S=>{if(typeof S=="string")return S;let v=S.label||S.name||"";return v?S.value!==void 0?`${v}: ${S.value}`:v:""}).filter(Boolean).join(`
21
- `),d=l(e.frameworkVars);d&&(t.push(`
22
- === Framework CSS Variables ===`),t.push(d));let g=l(e.entityVars);g&&(t.push(`
23
- === Entity CSS Variables ===`),t.push(g));let h=l(e.external);return h&&(t.push(`
24
- === External CSS Variables ===`),t.push(h)),r&&(e.frameworkCss&&(t.push(`
25
- === Framework Raw CSS ===`),t.push(e.frameworkCss)),e.entityCss&&(t.push(`
26
- === Entity Raw CSS ===`),t.push(e.entityCss))),{content:[{type:"text",text:t.join(`
27
- `)}]}}catch(e){return{content:[{type:"text",text:"Error: "+e.message}],isError:!0}}}),n.tool("builderius_builder_set_module_label","Set the display label (name shown in module tree) for a module. Use meaningful names like 'Hero Section', 'Nav Link', 'Footer Container'.",{moduleId:i.z.string().describe("ID of the module"),label:i.z.string().describe("Human-readable display label")},async({moduleId:r,label:e})=>{try{let t=await o("setModuleLabel",{moduleId:r,label:e});return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}catch(t){return{content:[{type:"text",text:"Error: "+t.message}],isError:!0}}}),n.tool("builderius_builder_add_module_class","Add a CSS class to a module's class list (tagClass setting). The class is deduplicated \u2014 adding an existing class is a no-op. Use get_css_framework to discover available framework classes.",{moduleId:i.z.string().describe("ID of the module"),className:i.z.string().describe("CSS class name to add")},async({moduleId:r,className:e})=>{try{let t=await o("addModuleClass",{moduleId:r,className:e});return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}catch(t){return{content:[{type:"text",text:"Error: "+t.message}],isError:!0}}}),n.tool("builderius_builder_remove_module_class","Remove a CSS class from a module's class list (tagClass setting).",{moduleId:i.z.string().describe("ID of the module"),className:i.z.string().describe("CSS class name to remove")},async({moduleId:r,className:e})=>{try{let t=await o("removeModuleClass",{moduleId:r,className:e});return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}catch(t){return{content:[{type:"text",text:"Error: "+t.message}],isError:!0}}}),n.tool("builderius_builder_add_html_attribute","Add or update an HTML attribute on a module (e.g. id, data-*, aria-*, role, title, alt). If the attribute already exists, its value is updated. Attribute names must be alphanumeric with hyphens/underscores.",{moduleId:i.z.string().describe("ID of the module"),name:i.z.string().describe("Attribute name (e.g. 'id', 'data-section', 'aria-label', 'role')"),value:i.z.string().optional().describe("Attribute value. Omit for boolean attributes (e.g. 'hidden', 'disabled').")},async({moduleId:r,name:e,value:t})=>{try{let a=await o("addHtmlAttribute",{moduleId:r,name:e,value:t});return{content:[{type:"text",text:JSON.stringify(a,null,2)}]}}catch(a){return{content:[{type:"text",text:"Error: "+a.message}],isError:!0}}}),n.tool("builderius_builder_remove_html_attribute","Remove an HTML attribute from a module.",{moduleId:i.z.string().describe("ID of the module"),name:i.z.string().describe("Attribute name to remove (e.g. 'data-section', 'aria-label')")},async({moduleId:r,name:e})=>{try{let t=await o("removeHtmlAttribute",{moduleId:r,name:e});return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}catch(t){return{content:[{type:"text",text:"Error: "+t.message}],isError:!0}}}),n.tool("builderius_builder_list_tabs","List all open tabs in the builder and which one is currently active. Use this to see what entities are open before switching or closing tabs.",{},async()=>{try{let r=await o("listTabs");return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(r){return{content:[{type:"text",text:"Error: "+r.message}],isError:!0}}}),n.tool("builderius_builder_switch_tab","Switch to an existing open tab by its tabId. The current entity is saved automatically before loading the new one. Use list_tabs to find available tabIds.",{tabId:i.z.string().describe("Tab ID to switch to (e.g. 'entity_0_123')")},async({tabId:r})=>{try{let e=await o("switchTab",{tabId:r});return{content:[{type:"text",text:JSON.stringify(e,null,2)}]}}catch(e){return{content:[{type:"text",text:"Error: "+e.message}],isError:!0}}}),n.tool("builderius_builder_open_tab","Open an entity (template or component) in a new tab, or switch to it if already open. Use list_entities to discover available entities and their IDs.",{entityId:i.z.number().describe("Entity ID (template or component post ID)"),entityType:i.z.string().describe("Entity type ('template' or 'component')"),title:i.z.string().optional().describe("Display title for the tab"),wrapperId:i.z.number().optional().describe("Wrapper ID (default 0)"),wrapperType:i.z.string().optional().describe("Wrapper type"),wrapperTitle:i.z.string().optional().describe("Wrapper title")},async({entityId:r,entityType:e,title:t,wrapperId:a,wrapperType:s,wrapperTitle:u})=>{try{let l=await o("openTab",{entityId:r,entityType:e,title:t,wrapperId:a,wrapperType:s,wrapperTitle:u});return{content:[{type:"text",text:JSON.stringify(l,null,2)}]}}catch(l){return{content:[{type:"text",text:"Error: "+l.message}],isError:!0}}}),n.tool("builderius_builder_close_tab","Close a tab by its tabId. If the active tab is closed, the builder switches to the first remaining tab. Cannot close the last tab.",{tabId:i.z.string().describe("Tab ID to close (e.g. 'entity_0_123')")},async({tabId:r})=>{try{let e=await o("closeTab",{tabId:r});return{content:[{type:"text",text:JSON.stringify(e,null,2)}]}}catch(e){return{content:[{type:"text",text:"Error: "+e.message}],isError:!0}}}),n.tool("builderius_builder_list_entities","List all available templates and components that can be opened in the builder. Returns templates grouped by category and all components. Use open_tab to open one.",{},async()=>{try{let r=await o("listEntities");return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(r){return{content:[{type:"text",text:"Error: "+r.message}],isError:!0}}}),n.tool("builderius_builder_get_component_properties","Get the property definitions of a component. If componentName is provided, reads from componentsData (works from any entity). If omitted, reads from the active entity (must be a component).",{componentName:i.z.string().optional().describe("Component name to read properties from. Omit to read from the active entity.")},async({componentName:r})=>{try{let t=await o("getComponentProperties",r?{componentName:r}:{});return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}catch(e){return{content:[{type:"text",text:"Error: "+e.message}],isError:!0}}}),n.tool("builderius_builder_add_component_property","Add a property to the active component. The property name is auto-slugified from componentName + label. After adding, the 'props' data variable is regenerated automatically. Properties become available as [[props.propName]] in the component template.",{type:i.z.enum(["text","url","image","boolean","select"]).describe("Property type"),label:i.z.string().describe("Human-readable property label (e.g. 'Title', 'Link URL', 'Show Icon')"),placeholder:i.z.union([i.z.string(),i.z.boolean()]).optional().describe("Default value placeholder. For text/url/image: string. For boolean: true/false."),options:i.z.array(i.z.object({label:i.z.string(),value:i.z.string(),default:i.z.boolean().optional()})).optional().describe("Options for select type. Each option has label, value, and optional default:true.")},async({type:r,label:e,placeholder:t,options:a})=>{try{let s=await o("addComponentProperty",{type:r,label:e,placeholder:t,options:a});return{content:[{type:"text",text:JSON.stringify(s,null,2)}]}}catch(s){return{content:[{type:"text",text:"Error: "+s.message}],isError:!0}}}),n.tool("builderius_builder_update_component_property","Update a component property's label, placeholder, or options. WARNING: If label changes, the property name is re-slugified \u2014 existing component module instances that reference the old name will become stale.",{name:i.z.string().describe("Current property name (e.g. 'mycomp_title')"),label:i.z.string().optional().describe("New label (will re-slugify name)"),placeholder:i.z.union([i.z.string(),i.z.boolean()]).optional().describe("New placeholder/default value"),options:i.z.array(i.z.object({label:i.z.string(),value:i.z.string(),default:i.z.boolean().optional()})).optional().describe("New options (select type only)")},async({name:r,label:e,placeholder:t,options:a})=>{try{let s=await o("updateComponentProperty",{name:r,label:e,placeholder:t,options:a});return{content:[{type:"text",text:JSON.stringify(s,null,2)}]}}catch(s){return{content:[{type:"text",text:"Error: "+s.message}],isError:!0}}}),n.tool("builderius_builder_remove_component_property","Remove a property from the active component. The 'props' data variable is regenerated automatically.",{name:i.z.string().describe("Property name to remove (e.g. 'mycomp_title')")},async({name:r})=>{try{let e=await o("removeComponentProperty",{name:r});return{content:[{type:"text",text:JSON.stringify(e,null,2)}]}}catch(e){return{content:[{type:"text",text:"Error: "+e.message}],isError:!0}}}),n.tool("builderius_builder_set_instance_properties","Set property values on a Component module instance. This overrides the component's default property values for this specific instance. Empty/null values are filtered out (matches UI behavior).",{moduleId:i.z.string().describe("ID of the Component module instance"),properties:i.z.array(i.z.object({name:i.z.string().describe("Property name (e.g. 'mycomp_title')"),value:i.z.union([i.z.string(),i.z.boolean()]).describe("Property value")})).describe("Array of property name-value pairs to set")},async({moduleId:r,properties:e})=>{try{let t=await o("setInstanceProperties",{moduleId:r,properties:e});return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}catch(t){return{content:[{type:"text",text:"Error: "+t.message}],isError:!0}}}),n.tool("builderius_builder_save","Save the current builder state. IMPORTANT: NEVER call this automatically \u2014 always ask the user first if they want to save. Use publish=false (default) to save to development, or publish=true to publish to live.",{publish:i.z.boolean().optional().describe("If true, publish to live. If false (default), save to development only.")},async({publish:r})=>{try{let e=await o("save",{publish:r||!1});return{content:[{type:"text",text:JSON.stringify(e,null,2)}]}}catch(e){return{content:[{type:"text",text:"Error: "+e.message}],isError:!0}}}),n.tool("builderius_builder_create_data_variable","Create a new data variable with a GraphQL query. BEFORE calling this tool, you MUST read builderius://graphql-schema and builderius://graphql-snippets resources to understand correct query patterns and avoid common mistakes. Data variables provide dynamic data to templates via [[varName]] syntax. Use scope='entity' for template-specific data, scope='global' for framework-wide data. IMPORTANT: Do NOT create a variable named 'wp' \u2014 that is system-managed. Use apply_dynamic_data_helper instead. NOTE: Do NOT create a data variable just to hold static JSON for a Collection \u2014 put inline JSON directly in the Collection's data-b-context HTML attribute instead. PAGINATION: NEVER pass 'paged' in posts_query arguments \u2014 pagination_url_param_name handles it automatically.",{name:i.z.string().describe("Variable name (used as [[name]] in templates). Must be unique across both scopes."),type:i.z.string().optional().describe("Variable type. Currently only 'graphQLQuery' is supported (default). More types will be added in the future."),query:i.z.string().optional().describe("The GraphQL query string. Use the Builderius GraphQL schema (builderius://graphql-schema resource) to write correct queries."),scope:i.z.enum(["entity","global"]).optional().describe("Where to create the variable: 'entity' (default, template-specific) or 'global' (shared across all templates)")},async({name:r,type:e,query:t,scope:a})=>{try{let s=await o("createDataVariable",{name:r,type:e,query:t,scope:a});return{content:[{type:"text",text:JSON.stringify(s,null,2)}]}}catch(s){return{content:[{type:"text",text:"Error: "+s.message}],isError:!0}}}),n.tool("builderius_builder_update_data_variable","Update an existing data variable's query content or rename it. BEFORE writing a new query, read builderius://graphql-snippets to check for correct patterns. Automatically finds the variable in either entity or global scope. Cannot rename the system 'wp' variable. After updating, dynamic data is automatically refreshed. PAGINATION: NEVER pass 'paged' in posts_query arguments \u2014 pagination_url_param_name handles it automatically.",{name:i.z.string().describe("Current variable name to update"),query:i.z.string().optional().describe("New query/content string to replace the current one"),newName:i.z.string().optional().describe("New name for the variable (renames it)")},async({name:r,query:e,newName:t})=>{try{let a=await o("updateDataVariable",{name:r,query:e,newName:t});return{content:[{type:"text",text:JSON.stringify(a,null,2)}]}}catch(a){return{content:[{type:"text",text:"Error: "+a.message}],isError:!0}}}),n.tool("builderius_builder_delete_data_variable","Delete a data variable by name. Searches both entity and global scope. Cannot delete the system 'wp' variable.",{name:i.z.string().describe("Name of the data variable to delete")},async({name:r})=>{try{let e=await o("deleteDataVariable",{name:r});return{content:[{type:"text",text:JSON.stringify(e,null,2)}]}}catch(e){return{content:[{type:"text",text:"Error: "+e.message}],isError:!0}}}),n.tool("builderius_builder_refresh_dynamic_data","Trigger a refresh of all dynamic data from the WordPress backend. Call this after modifying data variable queries to see updated resolved values. Shows a loading spinner while fetching.",{},async()=>{try{let r=await o("refreshDynamicData");return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(r){return{content:[{type:"text",text:"Error: "+r.message}],isError:!0}}}),n.tool("builderius_builder_get_dynamic_data","Get the current resolved dynamic data \u2014 the actual values returned by all data variable queries from the WordPress backend. Use this to verify that your queries return the expected data structure.",{},async()=>{try{let r=await o("getDynamicData");return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(r){return{content:[{type:"text",text:"Error: "+r.message}],isError:!0}}}),n.tool("builderius_builder_get_breakpoints","Get all defined responsive breakpoints, the responsive strategy (desktop-first or mobile-first), and which breakpoint is currently active. CSS set while a breakpoint is active applies to that breakpoint's media query.",{},async()=>{try{let r=await o("getBreakpoints");return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(r){return{content:[{type:"text",text:"Error: "+r.message}],isError:!0}}}),n.tool("builderius_builder_set_active_breakpoint","Switch the active responsive breakpoint. CSS changes made while a breakpoint is active will apply to that breakpoint's media query. Use empty string '' for the base (desktop) breakpoint.",{breakpoint:i.z.string().describe("Breakpoint name to activate (e.g. 'tablet', 'mobile'). Use empty string '' for the base/desktop breakpoint.")},async({breakpoint:r})=>{try{let e=await o("setActiveBreakpoint",{breakpoint:r});return{content:[{type:"text",text:JSON.stringify(e,null,2)}]}}catch(e){return{content:[{type:"text",text:"Error: "+e.message}],isError:!0}}}),n.tool("builderius_builder_duplicate_module","Duplicate a module and all its children. The copy is inserted immediately after the original with auto-generated IDs. Returns the new module's ID.",{moduleId:i.z.string().describe("ID of the module to duplicate")},async({moduleId:r})=>{try{let e=await o("duplicateModule",{moduleId:r});return{content:[{type:"text",text:JSON.stringify(e,null,2)}]}}catch(e){return{content:[{type:"text",text:"Error: "+e.message}],isError:!0}}}),n.tool("builderius_builder_delete_module_setting","Remove a specific setting from a module entirely (different from setting it to empty string). Use this to clear settings like visibilityCondition, dataQuery, or css from a module.",{moduleId:i.z.string().describe("ID of the module"),name:i.z.string().describe("Setting name to delete (e.g. 'visibilityCondition', 'dataQuery', 'css')")},async({moduleId:r,name:e})=>{try{let t=await o("deleteModuleSetting",{moduleId:r,name:e});return{content:[{type:"text",text:JSON.stringify(t,null,2)}]}}catch(t){return{content:[{type:"text",text:"Error: "+t.message}],isError:!0}}}),n.tool("builderius_builder_list_dynamic_data_helpers","List all dynamic data helpers available for the current template context. These are the ONLY way to add fields to the system-managed 'wp' data variable. Helpers are context-filtered: wp.post.* only appear on singular templates, wp.archive.* only on archive/home templates. Call this before using any [[wp.*]] expression in module content.",{},async()=>{try{let r=await o("getDynamicDataHelpers");return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(r){return{content:[{type:"text",text:"Error: "+r.message}],isError:!0}}}),n.tool("builderius_builder_apply_dynamic_data_helper","Apply a dynamic data helper to inject required GraphQL fields into the system-managed 'wp' data variable query. You MUST call this before using a [[wp.*]] expression \u2014 otherwise the field won't exist in the query and the expression will resolve to empty. For parameterized helpers (e.g. meta fields, nav menus), pass the args object. The operation is idempotent \u2014 applying the same helper twice won't create duplicate fields.",{helperName:i.z.string().describe("Helper name exactly as returned by list_dynamic_data_helpers (e.g. 'wp.post.title', 'wp.archive.posts')"),args:i.z.string().optional().describe(`JSON string of arguments for parameterized helpers. Example: '{"argument":"my_meta_key"}' for wp.post.meta_field. Omit for helpers with no arguments.`)},async({helperName:r,args:e})=>{try{let t=e?typeof e=="string"?JSON.parse(e):e:void 0,a=await o("applyDynamicDataHelper",{helperName:r,args:t});return{content:[{type:"text",text:JSON.stringify(a,null,2)}]}}catch(t){return{content:[{type:"text",text:"Error: "+t.message}],isError:!0}}}),n.tool("builderius_builder_list_rendering_conditions","List all available module rendering conditions (visibility conditions). Returns condition names, operators, widget types, and value lists. Use this to discover what conditions can be set on modules via the visibilityCondition setting.",{},async()=>{try{let r=await o("getRenderingConditions");return{content:[{type:"text",text:JSON.stringify(r,null,2)}]}}catch(r){return{content:[{type:"text",text:"Error: "+r.message}],isError:!0}}}),n.tool("builderius_builder_apply_rendering_condition","Apply rendering condition graphqlPaths to the system-managed 'wp' data variable query. Call this AFTER setting visibilityCondition on a module \u2014 the condition needs its required fields in the wp query to evaluate correctly. Some conditions (like dynamic_data, expression) have no graphqlPath and are handled gracefully. NOTE: Prefer using set_visibility_condition instead \u2014 it validates, builds JSON, sets the setting, AND applies graphqlPaths all in one call.",{conditionNames:i.z.array(i.z.string()).describe("Array of condition names to apply (e.g. ['post_id', 'featured_image'])")},async({conditionNames:r})=>{try{let e=await o("applyRenderingCondition",{conditionNames:r});return{content:[{type:"text",text:JSON.stringify(e,null,2)}]}}catch(e){return{content:[{type:"text",text:"Error: "+e.message}],isError:!0}}}),n.tool("builderius_builder_set_visibility_condition","Set a visibility condition on a module \u2014 validates condition names and operators, builds the nested JSON tree, sets the visibilityCondition setting, and auto-applies graphqlPaths to the wp query. All in one call. Use groups to express AND/OR logic: groups=[[rule1, rule2]] means rule1 AND rule2; groups=[[rule1], [rule2]] means rule1 OR rule2. Call list_rendering_conditions first to see available condition names and operators. Use delete_module_setting with name='visibilityCondition' to remove a condition.",{moduleId:i.z.string().describe("ID of the module to set the condition on"),groups:i.z.string().describe(`JSON string of groups array. Format: [[{name, operator, value?}, ...], ...]. Each inner array is an AND-group, outer array is OR. Example: '[[{"name":"post_status","operator":"equal","value":"publish"}]]'. For dynamic_data conditions, value is {"a1":"varName","b1":"path"}. For is_empty/is_not_empty, value can be omitted.`)},async({moduleId:r,groups:e})=>{try{let t=typeof e=="string"?JSON.parse(e):e,a=await o("setVisibilityCondition",{moduleId:r,groups:t});return{content:[{type:"text",text:JSON.stringify(a,null,2)}]}}catch(t){return{content:[{type:"text",text:"Error: "+t.message}],isError:!0}}}),n.tool("builderius_builder_set_data_condition","Filter loop items inside a Collection \u2014 controls which items in a Collection/SubCollection loop render this element. ONLY works on modules that are descendants of a Collection or SubCollection (will error otherwise). For non-loop conditional rendering, use set_visibility_condition instead. Supports dynamic_data (compares loop fields using {{field}} syntax) and expression (raw Expression Language). Validates, builds expression, sets data-condition HTML attribute. To remove, use remove_html_attribute with name='data-condition'.",{moduleId:i.z.string().describe("ID of the module inside a Collection or SubCollection"),groups:i.z.string().describe(`JSON string of groups array. Format: [[{name, operator, value}, ...], ...]. Each inner array is AND-group, outer array is OR. name is "dynamic_data" or "expression". For dynamic_data: value is {"a1":"{{field}}","b1":"compareValue"} \u2014 use {{field}} for loop variables. For expression: value is raw EL string. Example: '[[{"name":"dynamic_data","operator":"equal","value":{"a1":"{{post_status}}","b1":"publish"}}]]'`)},async({moduleId:r,groups:e})=>{try{let t=typeof e=="string"?JSON.parse(e):e,a=await o("setDataCondition",{moduleId:r,groups:t});return{content:[{type:"text",text:JSON.stringify(a,null,2)}]}}catch(t){return{content:[{type:"text",text:"Error: "+t.message}],isError:!0}}})}function B(n,o){n.resource("graphql-schema","builderius://graphql-schema",{description:"Complete Builderius GraphQL schema in SDL format. MANDATORY: You MUST read this schema before writing ANY GraphQL query. Never assume or guess field names, types, or query structure \u2014 always verify against this schema first.",mimeType:"text/plain"},async()=>({contents:[{uri:"builderius://graphql-schema",text:o("builderius-graphql-schema-sdl.txt")||"Not found",mimeType:"text/plain"}]})),n.resource("expression-language","builderius://expression-language",{description:"Builderius Expression Language reference: operators, arrow functions, boolean/array/string functions, type conversions.",mimeType:"text/markdown"},async()=>({contents:[{uri:"builderius://expression-language",text:o("builderius-expression-language.md")||"Not found",mimeType:"text/markdown"}]})),n.resource("graphql-directives","builderius://graphql-directives",{description:"Builderius GraphQL directives: @private, @recursive, @transform.",mimeType:"text/markdown"},async()=>({contents:[{uri:"builderius://graphql-directives",text:o("builderius-graphql-directives.md")||"Not found",mimeType:"text/markdown"}]})),n.resource("graphql-local-variables","builderius://graphql-local-variables",{description:"Local variables in Builderius GraphQL: expression_result, {{var}}, {{{var}}}.",mimeType:"text/markdown"},async()=>({contents:[{uri:"builderius://graphql-local-variables",text:o("builderius-graphql-local-variables.md")||"Not found",mimeType:"text/markdown"}]})),n.resource("graphql-snippets","builderius://graphql-snippets",{description:"Practical Builderius GraphQL query examples for common WordPress use cases. Use these as reference patterns after reading the full GraphQL schema.",mimeType:"text/markdown"},async()=>({contents:[{uri:"builderius://graphql-snippets",text:o("builderius-graphql-snippets.md")||"Not found",mimeType:"text/markdown"}]})),n.resource("builderius-architecture","builderius://architecture",{description:"Builderius template architecture overview: data model, content_config structure, module types, locations, CSS conventions.",mimeType:"text/markdown"},async()=>({contents:[{uri:"builderius://architecture",text:o("builderius-architecture.md")||"Not found",mimeType:"text/markdown"}]})),n.resource("builderius-modules-reference","builderius://modules-reference",{description:"Complete Builderius module type reference: all module types, their settings, container rules, nesting constraints, Collection/Template/SubCollection patterns, void tags, interactive modules, and variable syntax. MUST read before adding modules to understand which settings each module type supports.",mimeType:"text/markdown"},async()=>({contents:[{uri:"builderius://modules-reference",text:o("builderius-modules-reference.md")||"Not found",mimeType:"text/markdown"}]})),n.resource("builderius-instructions","builderius://instructions",{description:"Complete Builderius workflow rules, conventions, module rules, CSS patterns, visibility conditions, data variables, responsive patterns. MUST read for full API documentation.",mimeType:"text/markdown"},async()=>({contents:[{uri:"builderius://instructions",text:o("builderius-instructions.md")||"Not found",mimeType:"text/markdown"}]})),n.resource("builderius-design-guidelines","builderius://design-guidelines",{description:"Frontend design methodology: semantic HTML, accessibility, CSS cascade, responsive patterns, image handling, anti-patterns. Read before building UI.",mimeType:"text/markdown"},async()=>({contents:[{uri:"builderius://design-guidelines",text:o("builderius-design-guidelines.md")||"Not found",mimeType:"text/markdown"}]}))}var Z={},W=typeof __dirname<"u"?__dirname:(0,G.dirname)((0,V.fileURLToPath)(Z.url)),{server:E,builderCommand:Y,readAsset:z,remoteMode:K,wpRoot:X}=D(W);K||R(E,X);M(E,Y);B(E,z);q(E).catch(n=>{console.error("Fatal error:",n),process.exit(1)});
package/terminal.src.cjs DELETED
@@ -1,26 +0,0 @@
1
- // Builderius Sense (c) Flavor Dev. All rights reserved.
2
- var E=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var k=E((Cn,it)=>{"use strict";var st=["nodebuffer","arraybuffer","fragments"],nt=typeof Blob<"u";nt&&st.push("blob");it.exports={BINARY_TYPES:st,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:nt,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var ee=E((On,ce)=>{"use strict";var{EMPTY_BUFFER:Tr}=k(),Oe=Buffer[Symbol.species];function Cr(t,e){if(t.length===0)return Tr;if(t.length===1)return t[0];let r=Buffer.allocUnsafe(e),s=0;for(let n=0;n<t.length;n++){let i=t[n];r.set(i,s),s+=i.length}return s<e?new Oe(r.buffer,r.byteOffset,s):r}function ot(t,e,r,s,n){for(let i=0;i<n;i++)r[s+i]=t[i]^e[i&3]}function at(t,e){for(let r=0;r<t.length;r++)t[r]^=e[r&3]}function Or(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.length)}function ke(t){if(ke.readOnly=!0,Buffer.isBuffer(t))return t;let e;return t instanceof ArrayBuffer?e=new Oe(t):ArrayBuffer.isView(t)?e=new Oe(t.buffer,t.byteOffset,t.byteLength):(e=Buffer.from(t),ke.readOnly=!1),e}ce.exports={concat:Cr,mask:ot,toArrayBuffer:Or,toBuffer:ke,unmask:at};if(!process.env.WS_NO_BUFFER_UTIL)try{let t=require("bufferutil");ce.exports.mask=function(e,r,s,n,i){i<48?ot(e,r,s,n,i):t.mask(e,r,s,n,i)},ce.exports.unmask=function(e,r){e.length<32?at(e,r):t.unmask(e,r)}}catch{}});var ft=E((kn,ct)=>{"use strict";var lt=Symbol("kDone"),Ne=Symbol("kRun"),Ue=class{constructor(e){this[lt]=()=>{this.pending--,this[Ne]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Ne]()}[Ne](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[lt])}}};ct.exports=Ue});var re=E((Nn,pt)=>{"use strict";var te=require("zlib"),ht=ee(),kr=ft(),{kStatusCode:ut}=k(),Nr=Buffer[Symbol.species],Ur=Buffer.from([0,0,255,255]),he=Symbol("permessage-deflate"),N=Symbol("total-length"),M=Symbol("callback"),L=Symbol("buffers"),H=Symbol("error"),fe,De=class{constructor(e,r,s){if(this._maxPayload=s|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!fe){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;fe=new kr(n)}}static get extensionName(){return"permessage-deflate"}offer(){let e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let e=this._deflate[M];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let r=this._options,s=e.find(n=>!(r.serverNoContextTakeover===!1&&n.server_no_context_takeover||n.server_max_window_bits&&(r.serverMaxWindowBits===!1||typeof r.serverMaxWindowBits=="number"&&r.serverMaxWindowBits>n.server_max_window_bits)||typeof r.clientMaxWindowBits=="number"&&!n.client_max_window_bits));if(!s)throw new Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(s.server_no_context_takeover=!0),r.clientNoContextTakeover&&(s.client_no_context_takeover=!0),typeof r.serverMaxWindowBits=="number"&&(s.server_max_window_bits=r.serverMaxWindowBits),typeof r.clientMaxWindowBits=="number"?s.client_max_window_bits=r.clientMaxWindowBits:(s.client_max_window_bits===!0||r.clientMaxWindowBits===!1)&&delete s.client_max_window_bits,s}acceptAsClient(e){let r=e[0];if(this._options.clientNoContextTakeover===!1&&r.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!r.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(r.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return r}normalizeParams(e){return e.forEach(r=>{Object.keys(r).forEach(s=>{let n=r[s];if(n.length>1)throw new Error(`Parameter "${s}" must have only a single value`);if(n=n[0],s==="client_max_window_bits"){if(n!==!0){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${s}": ${n}`);n=i}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${s}": ${n}`)}else if(s==="server_max_window_bits"){let i=+n;if(!Number.isInteger(i)||i<8||i>15)throw new TypeError(`Invalid value for parameter "${s}": ${n}`);n=i}else if(s==="client_no_context_takeover"||s==="server_no_context_takeover"){if(n!==!0)throw new TypeError(`Invalid value for parameter "${s}": ${n}`)}else throw new Error(`Unknown parameter "${s}"`);r[s]=n})}),e}decompress(e,r,s){fe.add(n=>{this._decompress(e,r,(i,o)=>{n(),s(i,o)})})}compress(e,r,s){fe.add(n=>{this._compress(e,r,(i,o)=>{n(),s(i,o)})})}_decompress(e,r,s){let n=this._isServer?"client":"server";if(!this._inflate){let i=`${n}_max_window_bits`,o=typeof this.params[i]!="number"?te.Z_DEFAULT_WINDOWBITS:this.params[i];this._inflate=te.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[he]=this,this._inflate[N]=0,this._inflate[L]=[],this._inflate.on("error",Br),this._inflate.on("data",dt)}this._inflate[M]=s,this._inflate.write(e),r&&this._inflate.write(Ur),this._inflate.flush(()=>{let i=this._inflate[H];if(i){this._inflate.close(),this._inflate=null,s(i);return}let o=ht.concat(this._inflate[L],this._inflate[N]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[N]=0,this._inflate[L]=[],r&&this.params[`${n}_no_context_takeover`]&&this._inflate.reset()),s(null,o)})}_compress(e,r,s){let n=this._isServer?"server":"client";if(!this._deflate){let i=`${n}_max_window_bits`,o=typeof this.params[i]!="number"?te.Z_DEFAULT_WINDOWBITS:this.params[i];this._deflate=te.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[N]=0,this._deflate[L]=[],this._deflate.on("data",Dr)}this._deflate[M]=s,this._deflate.write(e),this._deflate.flush(te.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let i=ht.concat(this._deflate[L],this._deflate[N]);r&&(i=new Nr(i.buffer,i.byteOffset,i.length-4)),this._deflate[M]=null,this._deflate[N]=0,this._deflate[L]=[],r&&this.params[`${n}_no_context_takeover`]&&this._deflate.reset(),s(null,i)})}};pt.exports=De;function Dr(t){this[L].push(t),this[N]+=t.length}function dt(t){if(this[N]+=t.length,this[he]._maxPayload<1||this[N]<=this[he]._maxPayload){this[L].push(t);return}this[H]=new RangeError("Max payload size exceeded"),this[H].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[H][ut]=1009,this.removeListener("data",dt),this.reset()}function Br(t){if(this[he]._inflate=null,this[H]){this[M](this[H]);return}t[ut]=1007,this[M](t)}});var Y=E((Un,ue)=>{"use strict";var{isUtf8:mt}=require("buffer"),{hasBlob:Lr}=k(),Ar=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function Rr(t){return t>=1e3&&t<=1014&&t!==1004&&t!==1005&&t!==1006||t>=3e3&&t<=4999}function Be(t){let e=t.length,r=0;for(;r<e;)if((t[r]&128)===0)r++;else if((t[r]&224)===192){if(r+1===e||(t[r+1]&192)!==128||(t[r]&254)===192)return!1;r+=2}else if((t[r]&240)===224){if(r+2>=e||(t[r+1]&192)!==128||(t[r+2]&192)!==128||t[r]===224&&(t[r+1]&224)===128||t[r]===237&&(t[r+1]&224)===160)return!1;r+=3}else if((t[r]&248)===240){if(r+3>=e||(t[r+1]&192)!==128||(t[r+2]&192)!==128||(t[r+3]&192)!==128||t[r]===240&&(t[r+1]&240)===128||t[r]===244&&t[r+1]>143||t[r]>244)return!1;r+=4}else return!1;return!0}function Pr(t){return Lr&&typeof t=="object"&&typeof t.arrayBuffer=="function"&&typeof t.type=="string"&&typeof t.stream=="function"&&(t[Symbol.toStringTag]==="Blob"||t[Symbol.toStringTag]==="File")}ue.exports={isBlob:Pr,isValidStatusCode:Rr,isValidUTF8:Be,tokenChars:Ar};if(mt)ue.exports.isValidUTF8=function(t){return t.length<24?Be(t):mt(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let t=require("utf-8-validate");ue.exports.isValidUTF8=function(e){return e.length<32?Be(e):t(e)}}catch{}});var Ie=E((Dn,_t)=>{"use strict";var{Writable:Ir}=require("stream"),gt=re(),{BINARY_TYPES:Wr,EMPTY_BUFFER:yt,kStatusCode:Fr,kWebSocket:jr}=k(),{concat:Le,toArrayBuffer:Gr,unmask:Vr}=ee(),{isValidStatusCode:qr,isValidUTF8:St}=Y(),de=Buffer[Symbol.species],v=0,Et=1,xt=2,bt=3,Ae=4,Re=5,pe=6,Pe=class extends Ir{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||Wr[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[jr]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=v}_write(e,r,s){if(this._opcode===8&&this._state==v)return s();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(s)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){let s=this._buffers[0];return this._buffers[0]=new de(s.buffer,s.byteOffset+e,s.length-e),new de(s.buffer,s.byteOffset,e)}let r=Buffer.allocUnsafe(e);do{let s=this._buffers[0],n=r.length-e;e>=s.length?r.set(this._buffers.shift(),n):(r.set(new Uint8Array(s.buffer,s.byteOffset,e),n),this._buffers[0]=new de(s.buffer,s.byteOffset+e,s.length-e)),e-=s.length}while(e>0);return r}startLoop(e){this._loop=!0;do switch(this._state){case v:this.getInfo(e);break;case Et:this.getPayloadLength16(e);break;case xt:this.getPayloadLength64(e);break;case bt:this.getMask();break;case Ae:this.getData(e);break;case Re:case pe:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let r=this.consume(2);if((r[0]&48)!==0){let n=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(n);return}let s=(r[0]&64)===64;if(s&&!this._extensions[gt.extensionName]){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(s){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(!this._fragmented){let n=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}this._compressed=s}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let n=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(n);return}if(s){let n=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(n);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let n=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(n);return}}else{let n=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(n);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked){let n=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(n);return}}else if(this._masked){let n=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(n);return}this._payloadLength===126?this._state=Et:this._payloadLength===127?this._state=xt:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let r=this.consume(8),s=r.readUInt32BE(0);if(s>Math.pow(2,21)-1){let n=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(n);return}this._payloadLength=s*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let r=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(r);return}this._masked?this._state=bt:this._state=Ae}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Ae}getData(e){let r=yt;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}r=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&Vr(r,this._mask)}if(this._opcode>7){this.controlMessage(r,e);return}if(this._compressed){this._state=Re,this.decompress(r,e);return}r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(e)}decompress(e,r){this._extensions[gt.extensionName].decompress(e,this._fin,(n,i)=>{if(n)return r(n);if(i.length){if(this._messageLength+=i.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");r(o);return}this._fragments.push(i)}this.dataMessage(r),this._state===v&&this.startLoop(r)})}dataMessage(e){if(!this._fin){this._state=v;return}let r=this._messageLength,s=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let n;this._binaryType==="nodebuffer"?n=Le(s,r):this._binaryType==="arraybuffer"?n=Gr(Le(s,r)):this._binaryType==="blob"?n=new Blob(s):n=s,this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=v):(this._state=pe,setImmediate(()=>{this.emit("message",n,!0),this._state=v,this.startLoop(e)}))}else{let n=Le(s,r);if(!this._skipUTF8Validation&&!St(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(i);return}this._state===Re||this._allowSynchronousEvents?(this.emit("message",n,!1),this._state=v):(this._state=pe,setImmediate(()=>{this.emit("message",n,!1),this._state=v,this.startLoop(e)}))}}controlMessage(e,r){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,yt),this.end();else{let s=e.readUInt16BE(0);if(!qr(s)){let i=this.createError(RangeError,`invalid status code ${s}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");r(i);return}let n=new de(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!St(n)){let i=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");r(i);return}this._loop=!1,this.emit("conclude",s,n),this.end()}this._state=v;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=v):(this._state=pe,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=v,this.startLoop(r)}))}createError(e,r,s,n,i){this._loop=!1,this._errored=!0;let o=new e(s?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(o,this.createError),o.code=i,o[Fr]=n,o}};_t.exports=Pe});var je=E((Ln,Tt)=>{"use strict";var{Duplex:Bn}=require("stream"),{randomFillSync:Mr}=require("crypto"),vt=re(),{EMPTY_BUFFER:Hr,kWebSocket:Yr,NOOP:zr}=k(),{isBlob:z,isValidStatusCode:Jr}=Y(),{mask:wt,toBuffer:R}=ee(),w=Symbol("kByteLength"),Kr=Buffer.alloc(4),me=8*1024,P,J=me,C=0,Xr=1,Zr=2,We=class t{constructor(e,r,s){this._extensions=r||{},s&&(this._generateMask=s,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=C,this.onerror=zr,this[Yr]=void 0}static frame(e,r){let s,n=!1,i=2,o=!1;r.mask&&(s=r.maskBuffer||Kr,r.generateMask?r.generateMask(s):(J===me&&(P===void 0&&(P=Buffer.alloc(me)),Mr(P,0,me),J=0),s[0]=P[J++],s[1]=P[J++],s[2]=P[J++],s[3]=P[J++]),o=(s[0]|s[1]|s[2]|s[3])===0,i=6);let a;typeof e=="string"?(!r.mask||o)&&r[w]!==void 0?a=r[w]:(e=Buffer.from(e),a=e.length):(a=e.length,n=r.mask&&r.readOnly&&!o);let c=a;a>=65536?(i+=8,c=127):a>125&&(i+=2,c=126);let l=Buffer.allocUnsafe(n?a+i:i);return l[0]=r.fin?r.opcode|128:r.opcode,r.rsv1&&(l[0]|=64),l[1]=c,c===126?l.writeUInt16BE(a,2):c===127&&(l[2]=l[3]=0,l.writeUIntBE(a,4,6)),r.mask?(l[1]|=128,l[i-4]=s[0],l[i-3]=s[1],l[i-2]=s[2],l[i-1]=s[3],o?[l,e]:n?(wt(e,s,l,i,a),[l]):(wt(e,s,e,0,a),[l,e])):[l,e]}close(e,r,s,n){let i;if(e===void 0)i=Hr;else{if(typeof e!="number"||!Jr(e))throw new TypeError("First argument must be a valid error code number");if(r===void 0||!r.length)i=Buffer.allocUnsafe(2),i.writeUInt16BE(e,0);else{let a=Buffer.byteLength(r);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");i=Buffer.allocUnsafe(2+a),i.writeUInt16BE(e,0),typeof r=="string"?i.write(r,2):i.set(r,2)}}let o={[w]:i.length,fin:!0,generateMask:this._generateMask,mask:s,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==C?this.enqueue([this.dispatch,i,!1,o,n]):this.sendFrame(t.frame(i,o),n)}ping(e,r,s){let n,i;if(typeof e=="string"?(n=Buffer.byteLength(e),i=!1):z(e)?(n=e.size,i=!1):(e=R(e),n=e.length,i=R.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[w]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:i,rsv1:!1};z(e)?this._state!==C?this.enqueue([this.getBlobData,e,!1,o,s]):this.getBlobData(e,!1,o,s):this._state!==C?this.enqueue([this.dispatch,e,!1,o,s]):this.sendFrame(t.frame(e,o),s)}pong(e,r,s){let n,i;if(typeof e=="string"?(n=Buffer.byteLength(e),i=!1):z(e)?(n=e.size,i=!1):(e=R(e),n=e.length,i=R.readOnly),n>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[w]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:i,rsv1:!1};z(e)?this._state!==C?this.enqueue([this.getBlobData,e,!1,o,s]):this.getBlobData(e,!1,o,s):this._state!==C?this.enqueue([this.dispatch,e,!1,o,s]):this.sendFrame(t.frame(e,o),s)}send(e,r,s){let n=this._extensions[vt.extensionName],i=r.binary?2:1,o=r.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):z(e)?(a=e.size,c=!1):(e=R(e),a=e.length,c=R.readOnly),this._firstFragment?(this._firstFragment=!1,o&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=n._threshold),this._compress=o):(o=!1,i=0),r.fin&&(this._firstFragment=!0);let l={[w]:a,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:i,readOnly:c,rsv1:o};z(e)?this._state!==C?this.enqueue([this.getBlobData,e,this._compress,l,s]):this.getBlobData(e,this._compress,l,s):this._state!==C?this.enqueue([this.dispatch,e,this._compress,l,s]):this.dispatch(e,this._compress,l,s)}getBlobData(e,r,s,n){this._bufferedBytes+=s[w],this._state=Zr,e.arrayBuffer().then(i=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Fe,this,a,n);return}this._bufferedBytes-=s[w];let o=R(i);r?this.dispatch(o,r,s,n):(this._state=C,this.sendFrame(t.frame(o,s),n),this.dequeue())}).catch(i=>{process.nextTick(Qr,this,i,n)})}dispatch(e,r,s,n){if(!r){this.sendFrame(t.frame(e,s),n);return}let i=this._extensions[vt.extensionName];this._bufferedBytes+=s[w],this._state=Xr,i.compress(e,s.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Fe(this,c,n);return}this._bufferedBytes-=s[w],this._state=C,s.readOnly=!1,this.sendFrame(t.frame(a,s),n),this.dequeue()})}dequeue(){for(;this._state===C&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][w],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][w],this._queue.push(e)}sendFrame(e,r){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],r),this._socket.uncork()):this._socket.write(e[0],r)}};Tt.exports=We;function Fe(t,e,r){typeof r=="function"&&r(e);for(let s=0;s<t._queue.length;s++){let n=t._queue[s],i=n[n.length-1];typeof i=="function"&&i(e)}}function Qr(t,e,r){Fe(t,e,r),t.onerror(e)}});var At=E((An,Lt)=>{"use strict";var{kForOnEventAttribute:se,kListener:Ge}=k(),Ct=Symbol("kCode"),Ot=Symbol("kData"),kt=Symbol("kError"),Nt=Symbol("kMessage"),Ut=Symbol("kReason"),K=Symbol("kTarget"),Dt=Symbol("kType"),Bt=Symbol("kWasClean"),U=class{constructor(e){this[K]=null,this[Dt]=e}get target(){return this[K]}get type(){return this[Dt]}};Object.defineProperty(U.prototype,"target",{enumerable:!0});Object.defineProperty(U.prototype,"type",{enumerable:!0});var I=class extends U{constructor(e,r={}){super(e),this[Ct]=r.code===void 0?0:r.code,this[Ut]=r.reason===void 0?"":r.reason,this[Bt]=r.wasClean===void 0?!1:r.wasClean}get code(){return this[Ct]}get reason(){return this[Ut]}get wasClean(){return this[Bt]}};Object.defineProperty(I.prototype,"code",{enumerable:!0});Object.defineProperty(I.prototype,"reason",{enumerable:!0});Object.defineProperty(I.prototype,"wasClean",{enumerable:!0});var X=class extends U{constructor(e,r={}){super(e),this[kt]=r.error===void 0?null:r.error,this[Nt]=r.message===void 0?"":r.message}get error(){return this[kt]}get message(){return this[Nt]}};Object.defineProperty(X.prototype,"error",{enumerable:!0});Object.defineProperty(X.prototype,"message",{enumerable:!0});var ne=class extends U{constructor(e,r={}){super(e),this[Ot]=r.data===void 0?null:r.data}get data(){return this[Ot]}};Object.defineProperty(ne.prototype,"data",{enumerable:!0});var $r={addEventListener(t,e,r={}){for(let n of this.listeners(t))if(!r[se]&&n[Ge]===e&&!n[se])return;let s;if(t==="message")s=function(i,o){let a=new ne("message",{data:o?i:i.toString()});a[K]=this,ge(e,this,a)};else if(t==="close")s=function(i,o){let a=new I("close",{code:i,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[K]=this,ge(e,this,a)};else if(t==="error")s=function(i){let o=new X("error",{error:i,message:i.message});o[K]=this,ge(e,this,o)};else if(t==="open")s=function(){let i=new U("open");i[K]=this,ge(e,this,i)};else return;s[se]=!!r[se],s[Ge]=e,r.once?this.once(t,s):this.on(t,s)},removeEventListener(t,e){for(let r of this.listeners(t))if(r[Ge]===e&&!r[se]){this.removeListener(t,r);break}}};Lt.exports={CloseEvent:I,ErrorEvent:X,Event:U,EventTarget:$r,MessageEvent:ne};function ge(t,e,r){typeof t=="object"&&t.handleEvent?t.handleEvent.call(t,r):t.call(e,r)}});var Ve=E((Rn,Rt)=>{"use strict";var{tokenChars:ie}=Y();function O(t,e,r){t[e]===void 0?t[e]=[r]:t[e].push(r)}function es(t){let e=Object.create(null),r=Object.create(null),s=!1,n=!1,i=!1,o,a,c=-1,l=-1,f=-1,h=0;for(;h<t.length;h++)if(l=t.charCodeAt(h),o===void 0)if(f===-1&&ie[l]===1)c===-1&&(c=h);else if(h!==0&&(l===32||l===9))f===-1&&c!==-1&&(f=h);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${h}`);f===-1&&(f=h);let S=t.slice(c,f);l===44?(O(e,S,r),r=Object.create(null)):o=S,c=f=-1}else throw new SyntaxError(`Unexpected character at index ${h}`);else if(a===void 0)if(f===-1&&ie[l]===1)c===-1&&(c=h);else if(l===32||l===9)f===-1&&c!==-1&&(f=h);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${h}`);f===-1&&(f=h),O(r,t.slice(c,f),!0),l===44&&(O(e,o,r),r=Object.create(null),o=void 0),c=f=-1}else if(l===61&&c!==-1&&f===-1)a=t.slice(c,h),c=f=-1;else throw new SyntaxError(`Unexpected character at index ${h}`);else if(n){if(ie[l]!==1)throw new SyntaxError(`Unexpected character at index ${h}`);c===-1?c=h:s||(s=!0),n=!1}else if(i)if(ie[l]===1)c===-1&&(c=h);else if(l===34&&c!==-1)i=!1,f=h;else if(l===92)n=!0;else throw new SyntaxError(`Unexpected character at index ${h}`);else if(l===34&&t.charCodeAt(h-1)===61)i=!0;else if(f===-1&&ie[l]===1)c===-1&&(c=h);else if(c!==-1&&(l===32||l===9))f===-1&&(f=h);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${h}`);f===-1&&(f=h);let S=t.slice(c,f);s&&(S=S.replace(/\\/g,""),s=!1),O(r,a,S),l===44&&(O(e,o,r),r=Object.create(null),o=void 0),a=void 0,c=f=-1}else throw new SyntaxError(`Unexpected character at index ${h}`);if(c===-1||i||l===32||l===9)throw new SyntaxError("Unexpected end of input");f===-1&&(f=h);let g=t.slice(c,f);return o===void 0?O(e,g,r):(a===void 0?O(r,g,!0):s?O(r,a,g.replace(/\\/g,"")):O(r,a,g),O(e,o,r)),e}function ts(t){return Object.keys(t).map(e=>{let r=t[e];return Array.isArray(r)||(r=[r]),r.map(s=>[e].concat(Object.keys(s).map(n=>{let i=s[n];return Array.isArray(i)||(i=[i]),i.map(o=>o===!0?n:`${n}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}Rt.exports={format:ts,parse:es}});var xe=E((Wn,zt)=>{"use strict";var rs=require("events"),ss=require("https"),ns=require("http"),Wt=require("net"),is=require("tls"),{randomBytes:os,createHash:as}=require("crypto"),{Duplex:Pn,Readable:In}=require("stream"),{URL:qe}=require("url"),A=re(),ls=Ie(),cs=je(),{isBlob:fs}=Y(),{BINARY_TYPES:Pt,CLOSE_TIMEOUT:hs,EMPTY_BUFFER:ye,GUID:us,kForOnEventAttribute:Me,kListener:ds,kStatusCode:ps,kWebSocket:x,NOOP:Ft}=k(),{EventTarget:{addEventListener:ms,removeEventListener:gs}}=At(),{format:ys,parse:Ss}=Ve(),{toBuffer:Es}=ee(),jt=Symbol("kAborted"),He=[8,13],D=["CONNECTING","OPEN","CLOSING","CLOSED"],xs=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,m=class t extends rs{constructor(e,r,s){super(),this._binaryType=Pt[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=ye,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=t.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,r===void 0?r=[]:Array.isArray(r)||(typeof r=="object"&&r!==null?(s=r,r=[]):r=[r]),Gt(this,e,r,s)):(this._autoPong=s.autoPong,this._closeTimeout=s.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Pt.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(e,r,s){let n=new ls({allowSynchronousEvents:s.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:s.maxPayload,skipUTF8Validation:s.skipUTF8Validation}),i=new cs(e,this._extensions,s.generateMask);this._receiver=n,this._sender=i,this._socket=e,n[x]=this,i[x]=this,e[x]=this,n.on("conclude",vs),n.on("drain",ws),n.on("error",Ts),n.on("message",Cs),n.on("ping",Os),n.on("pong",ks),i.onerror=Ns,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),r.length>0&&e.unshift(r),e.on("close",Mt),e.on("data",Ee),e.on("end",Ht),e.on("error",Yt),this._readyState=t.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[A.extensionName]&&this._extensions[A.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=t.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,r){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){_(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===t.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=t.CLOSING,this._sender.close(e,r,!this._isServer,s=>{s||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),qt(this)}}pause(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,r,s){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(s=e,e=r=void 0):typeof r=="function"&&(s=r,r=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Ye(this,e,s);return}r===void 0&&(r=!this._isServer),this._sender.ping(e||ye,r,s)}pong(e,r,s){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(s=e,e=r=void 0):typeof r=="function"&&(s=r,r=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Ye(this,e,s);return}r===void 0&&(r=!this._isServer),this._sender.pong(e||ye,r,s)}resume(){this.readyState===t.CONNECTING||this.readyState===t.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,r,s){if(this.readyState===t.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"&&(s=r,r={}),typeof e=="number"&&(e=e.toString()),this.readyState!==t.OPEN){Ye(this,e,s);return}let n={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[A.extensionName]||(n.compress=!1),this._sender.send(e||ye,n,s)}terminate(){if(this.readyState!==t.CLOSED){if(this.readyState===t.CONNECTING){_(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=t.CLOSING,this._socket.destroy())}}};Object.defineProperty(m,"CONNECTING",{enumerable:!0,value:D.indexOf("CONNECTING")});Object.defineProperty(m.prototype,"CONNECTING",{enumerable:!0,value:D.indexOf("CONNECTING")});Object.defineProperty(m,"OPEN",{enumerable:!0,value:D.indexOf("OPEN")});Object.defineProperty(m.prototype,"OPEN",{enumerable:!0,value:D.indexOf("OPEN")});Object.defineProperty(m,"CLOSING",{enumerable:!0,value:D.indexOf("CLOSING")});Object.defineProperty(m.prototype,"CLOSING",{enumerable:!0,value:D.indexOf("CLOSING")});Object.defineProperty(m,"CLOSED",{enumerable:!0,value:D.indexOf("CLOSED")});Object.defineProperty(m.prototype,"CLOSED",{enumerable:!0,value:D.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.defineProperty(m.prototype,t,{enumerable:!0})});["open","error","close","message"].forEach(t=>{Object.defineProperty(m.prototype,`on${t}`,{enumerable:!0,get(){for(let e of this.listeners(t))if(e[Me])return e[ds];return null},set(e){for(let r of this.listeners(t))if(r[Me]){this.removeListener(t,r);break}typeof e=="function"&&this.addEventListener(t,e,{[Me]:!0})}})});m.prototype.addEventListener=ms;m.prototype.removeEventListener=gs;zt.exports=m;function Gt(t,e,r,s){let n={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:hs,protocolVersion:He[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...s,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(t._autoPong=n.autoPong,t._closeTimeout=n.closeTimeout,!He.includes(n.protocolVersion))throw new RangeError(`Unsupported protocol version: ${n.protocolVersion} (supported versions: ${He.join(", ")})`);let i;if(e instanceof qe)i=e;else try{i=new qe(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}i.protocol==="http:"?i.protocol="ws:":i.protocol==="https:"&&(i.protocol="wss:"),t._url=i.href;let o=i.protocol==="wss:",a=i.protocol==="ws+unix:",c;if(i.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!i.pathname?c="The URL's pathname is empty":i.hash&&(c="The URL contains a fragment identifier"),c){let u=new SyntaxError(c);if(t._redirects===0)throw u;Se(t,u);return}let l=o?443:80,f=os(16).toString("base64"),h=o?ss.request:ns.request,g=new Set,S;if(n.createConnection=n.createConnection||(o?_s:bs),n.defaultPort=n.defaultPort||l,n.port=i.port||l,n.host=i.hostname.startsWith("[")?i.hostname.slice(1,-1):i.hostname,n.headers={...n.headers,"Sec-WebSocket-Version":n.protocolVersion,"Sec-WebSocket-Key":f,Connection:"Upgrade",Upgrade:"websocket"},n.path=i.pathname+i.search,n.timeout=n.handshakeTimeout,n.perMessageDeflate&&(S=new A(n.perMessageDeflate!==!0?n.perMessageDeflate:{},!1,n.maxPayload),n.headers["Sec-WebSocket-Extensions"]=ys({[A.extensionName]:S.offer()})),r.length){for(let u of r){if(typeof u!="string"||!xs.test(u)||g.has(u))throw new SyntaxError("An invalid or duplicated subprotocol was specified");g.add(u)}n.headers["Sec-WebSocket-Protocol"]=r.join(",")}if(n.origin&&(n.protocolVersion<13?n.headers["Sec-WebSocket-Origin"]=n.origin:n.headers.Origin=n.origin),(i.username||i.password)&&(n.auth=`${i.username}:${i.password}`),a){let u=n.path.split(":");n.socketPath=u[0],n.path=u[1]}let y;if(n.followRedirects){if(t._redirects===0){t._originalIpc=a,t._originalSecure=o,t._originalHostOrSocketPath=a?n.socketPath:i.host;let u=s&&s.headers;if(s={...s,headers:{}},u)for(let[b,V]of Object.entries(u))s.headers[b.toLowerCase()]=V}else if(t.listenerCount("redirect")===0){let u=a?t._originalIpc?n.socketPath===t._originalHostOrSocketPath:!1:t._originalIpc?!1:i.host===t._originalHostOrSocketPath;(!u||t._originalSecure&&!o)&&(delete n.headers.authorization,delete n.headers.cookie,u||delete n.headers.host,n.auth=void 0)}n.auth&&!s.headers.authorization&&(s.headers.authorization="Basic "+Buffer.from(n.auth).toString("base64")),y=t._req=h(n),t._redirects&&t.emit("redirect",t.url,y)}else y=t._req=h(n);n.timeout&&y.on("timeout",()=>{_(t,y,"Opening handshake has timed out")}),y.on("error",u=>{y===null||y[jt]||(y=t._req=null,Se(t,u))}),y.on("response",u=>{let b=u.headers.location,V=u.statusCode;if(b&&n.followRedirects&&V>=300&&V<400){if(++t._redirects>n.maxRedirects){_(t,y,"Maximum redirects exceeded");return}y.abort();let Q;try{Q=new qe(b,e)}catch{let q=new SyntaxError(`Invalid URL: ${b}`);Se(t,q);return}Gt(t,Q,r,s)}else t.emit("unexpected-response",y,u)||_(t,y,`Unexpected server response: ${u.statusCode}`)}),y.on("upgrade",(u,b,V)=>{if(t.emit("upgrade",u),t.readyState!==m.CONNECTING)return;y=t._req=null;let Q=u.headers.upgrade;if(Q===void 0||Q.toLowerCase()!=="websocket"){_(t,b,"Invalid Upgrade header");return}let et=as("sha1").update(f+us).digest("base64");if(u.headers["sec-websocket-accept"]!==et){_(t,b,"Invalid Sec-WebSocket-Accept header");return}let q=u.headers["sec-websocket-protocol"],$;if(q!==void 0?g.size?g.has(q)||($="Server sent an invalid subprotocol"):$="Server sent a subprotocol but none was requested":g.size&&($="Server sent no subprotocol"),$){_(t,b,$);return}q&&(t._protocol=q);let tt=u.headers["sec-websocket-extensions"];if(tt!==void 0){if(!S){_(t,b,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Te;try{Te=Ss(tt)}catch{_(t,b,"Invalid Sec-WebSocket-Extensions header");return}let rt=Object.keys(Te);if(rt.length!==1||rt[0]!==A.extensionName){_(t,b,"Server indicated an extension that was not requested");return}try{S.accept(Te[A.extensionName])}catch{_(t,b,"Invalid Sec-WebSocket-Extensions header");return}t._extensions[A.extensionName]=S}t.setSocket(b,V,{allowSynchronousEvents:n.allowSynchronousEvents,generateMask:n.generateMask,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation})}),n.finishRequest?n.finishRequest(y,t):y.end()}function Se(t,e){t._readyState=m.CLOSING,t._errorEmitted=!0,t.emit("error",e),t.emitClose()}function bs(t){return t.path=t.socketPath,Wt.connect(t)}function _s(t){return t.path=void 0,!t.servername&&t.servername!==""&&(t.servername=Wt.isIP(t.host)?"":t.host),is.connect(t)}function _(t,e,r){t._readyState=m.CLOSING;let s=new Error(r);Error.captureStackTrace(s,_),e.setHeader?(e[jt]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Se,t,s)):(e.destroy(s),e.once("error",t.emit.bind(t,"error")),e.once("close",t.emitClose.bind(t)))}function Ye(t,e,r){if(e){let s=fs(e)?e.size:Es(e).length;t._socket?t._sender._bufferedBytes+=s:t._bufferedAmount+=s}if(r){let s=new Error(`WebSocket is not open: readyState ${t.readyState} (${D[t.readyState]})`);process.nextTick(r,s)}}function vs(t,e){let r=this[x];r._closeFrameReceived=!0,r._closeMessage=e,r._closeCode=t,r._socket[x]!==void 0&&(r._socket.removeListener("data",Ee),process.nextTick(Vt,r._socket),t===1005?r.close():r.close(t,e))}function ws(){let t=this[x];t.isPaused||t._socket.resume()}function Ts(t){let e=this[x];e._socket[x]!==void 0&&(e._socket.removeListener("data",Ee),process.nextTick(Vt,e._socket),e.close(t[ps])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t))}function It(){this[x].emitClose()}function Cs(t,e){this[x].emit("message",t,e)}function Os(t){let e=this[x];e._autoPong&&e.pong(t,!this._isServer,Ft),e.emit("ping",t)}function ks(t){this[x].emit("pong",t)}function Vt(t){t.resume()}function Ns(t){let e=this[x];e.readyState!==m.CLOSED&&(e.readyState===m.OPEN&&(e._readyState=m.CLOSING,qt(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",t)))}function qt(t){t._closeTimer=setTimeout(t._socket.destroy.bind(t._socket),t._closeTimeout)}function Mt(){let t=this[x];if(this.removeListener("close",Mt),this.removeListener("data",Ee),this.removeListener("end",Ht),t._readyState=m.CLOSING,!this._readableState.endEmitted&&!t._closeFrameReceived&&!t._receiver._writableState.errorEmitted&&this._readableState.length!==0){let e=this.read(this._readableState.length);t._receiver.write(e)}t._receiver.end(),this[x]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",It),t._receiver.on("finish",It))}function Ee(t){this[x]._receiver.write(t)||this.pause()}function Ht(){let t=this[x];t._readyState=m.CLOSING,t._receiver.end(),this.end()}function Yt(){let t=this[x];this.removeListener("error",Yt),this.on("error",Ft),t&&(t._readyState=m.CLOSING,this.destroy())}});var Zt=E((jn,Xt)=>{"use strict";var Fn=xe(),{Duplex:Us}=require("stream");function Jt(t){t.emit("close")}function Ds(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Kt(t){this.removeListener("error",Kt),this.destroy(),this.listenerCount("error")===0&&this.emit("error",t)}function Bs(t,e){let r=!0,s=new Us({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return t.on("message",function(i,o){let a=!o&&s._readableState.objectMode?i.toString():i;s.push(a)||t.pause()}),t.once("error",function(i){s.destroyed||(r=!1,s.destroy(i))}),t.once("close",function(){s.destroyed||s.push(null)}),s._destroy=function(n,i){if(t.readyState===t.CLOSED){i(n),process.nextTick(Jt,s);return}let o=!1;t.once("error",function(c){o=!0,i(c)}),t.once("close",function(){o||i(n),process.nextTick(Jt,s)}),r&&t.terminate()},s._final=function(n){if(t.readyState===t.CONNECTING){t.once("open",function(){s._final(n)});return}t._socket!==null&&(t._socket._writableState.finished?(n(),s._readableState.endEmitted&&s.destroy()):(t._socket.once("finish",function(){n()}),t.close()))},s._read=function(){t.isPaused&&t.resume()},s._write=function(n,i,o){if(t.readyState===t.CONNECTING){t.once("open",function(){s._write(n,i,o)});return}t.send(n,o)},s.on("end",Ds),s.on("error",Kt),s}Xt.exports=Bs});var $t=E((Gn,Qt)=>{"use strict";var{tokenChars:Ls}=Y();function As(t){let e=new Set,r=-1,s=-1,n=0;for(n;n<t.length;n++){let o=t.charCodeAt(n);if(s===-1&&Ls[o]===1)r===-1&&(r=n);else if(n!==0&&(o===32||o===9))s===-1&&r!==-1&&(s=n);else if(o===44){if(r===-1)throw new SyntaxError(`Unexpected character at index ${n}`);s===-1&&(s=n);let a=t.slice(r,s);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),r=s=-1}else throw new SyntaxError(`Unexpected character at index ${n}`)}if(r===-1||s!==-1)throw new SyntaxError("Unexpected end of input");let i=t.slice(r,n);if(e.has(i))throw new SyntaxError(`The "${i}" subprotocol is duplicated`);return e.add(i),e}Qt.exports={parse:As}});var or=E((qn,ir)=>{"use strict";var Rs=require("events"),be=require("http"),{Duplex:Vn}=require("stream"),{createHash:Ps}=require("crypto"),er=Ve(),W=re(),Is=$t(),Ws=xe(),{CLOSE_TIMEOUT:Fs,GUID:js,kWebSocket:Gs}=k(),Vs=/^[+/0-9A-Za-z]{22}==$/,tr=0,rr=1,nr=2,ze=class extends Rs{constructor(e,r){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:Fs,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Ws,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(e.port!=null?(this._server=be.createServer((s,n)=>{let i=be.STATUS_CODES[426];n.writeHead(426,{"Content-Length":i.length,"Content-Type":"text/plain"}),n.end(i)}),this._server.listen(e.port,e.host,e.backlog,r)):e.server&&(this._server=e.server),this._server){let s=this.emit.bind(this,"connection");this._removeListeners=qs(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(n,i,o)=>{this.handleUpgrade(n,i,o,s)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=tr}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(this._state===nr){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(oe,this);return}if(e&&this.once("close",e),this._state!==rr)if(this._state=rr,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(oe,this):process.nextTick(oe,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{oe(this)})}}shouldHandle(e){if(this.options.path){let r=e.url.indexOf("?");if((r!==-1?e.url.slice(0,r):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,r,s,n){r.on("error",sr);let i=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){F(this,e,r,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){F(this,e,r,400,"Invalid Upgrade header");return}if(i===void 0||!Vs.test(i)){F(this,e,r,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){F(this,e,r,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){ae(r,400);return}let c=e.headers["sec-websocket-protocol"],l=new Set;if(c!==void 0)try{l=Is.parse(c)}catch{F(this,e,r,400,"Invalid Sec-WebSocket-Protocol header");return}let f=e.headers["sec-websocket-extensions"],h={};if(this.options.perMessageDeflate&&f!==void 0){let g=new W(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let S=er.parse(f);S[W.extensionName]&&(g.accept(S[W.extensionName]),h[W.extensionName]=g)}catch{F(this,e,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let g={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(g,(S,y,u,b)=>{if(!S)return ae(r,y||401,u,b);this.completeUpgrade(h,i,l,e,r,s,n)});return}if(!this.options.verifyClient(g))return ae(r,401)}this.completeUpgrade(h,i,l,e,r,s,n)}completeUpgrade(e,r,s,n,i,o,a){if(!i.readable||!i.writable)return i.destroy();if(i[Gs])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>tr)return ae(i,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Ps("sha1").update(r+js).digest("base64")}`],f=new this.options.WebSocket(null,void 0,this.options);if(s.size){let h=this.options.handleProtocols?this.options.handleProtocols(s,n):s.values().next().value;h&&(l.push(`Sec-WebSocket-Protocol: ${h}`),f._protocol=h)}if(e[W.extensionName]){let h=e[W.extensionName].params,g=er.format({[W.extensionName]:[h]});l.push(`Sec-WebSocket-Extensions: ${g}`),f._extensions=e}this.emit("headers",l,n),i.write(l.concat(`\r
3
- `).join(`\r
4
- `)),i.removeListener("error",sr),f.setSocket(i,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(f),f.on("close",()=>{this.clients.delete(f),this._shouldEmitClose&&!this.clients.size&&process.nextTick(oe,this)})),a(f,n)}};ir.exports=ze;function qs(t,e){for(let r of Object.keys(e))t.on(r,e[r]);return function(){for(let s of Object.keys(e))t.removeListener(s,e[s])}}function oe(t){t._state=nr,t.emit("close")}function sr(){this.destroy()}function ae(t,e,r,s){r=r||be.STATUS_CODES[e],s={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...s},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${e} ${be.STATUS_CODES[e]}\r
5
- `+Object.keys(s).map(n=>`${n}: ${s[n]}`).join(`\r
6
- `)+`\r
7
- \r
8
- `+r)}function F(t,e,r,s,n,i){if(t.listenerCount("wsClientError")){let o=new Error(n);Error.captureStackTrace(o,F),t.emit("wsClientError",o,r,e)}else ae(r,s,n,i)}});var lr=E((Mn,ar)=>{"use strict";var B=xe();B.createWebSocketStream=Zt();B.Server=or();B.Receiver=Ie();B.Sender=je();B.WebSocket=B;B.WebSocketServer=B.Server;ar.exports=B});var hr=E((Hn,fr)=>{var Ms=require("zlib");function cr(t){return Ms.inflateRawSync(Buffer.from(t,"base64")).toString("utf-8")}var Hs=cr("s1HU1VVIKs3MSUktyiwt1k0sLclX0NW1AwA="),Ys=cr("fVPBbtpAEL37K6ZwxSDlWFWVEhQlUVWEQG3UEwz2GK9Y75KdMdS3fkS/sF/S2TUQ2ka92bsz7715b+fDuzyHTWtsScG0nGMrHvL8YzaEu8spPPtQzgMxnw+z7JtvocYDARZFvNA2qem66fN0DkzhQAGORmqt8Jah8qHnM26boSuhQYdb/QGhZm9RiEdQ+GbvHTnR71gTka1RspPScZYNh/Doj5H2C1OW5TBFa/+m7ylLE6gQ2wFyOoFCS3kMM4raWlbVyDWosKINdqxYV9IdNgSGYf1q0jqWPFWAPVogaYNjGMz8WZ8O4JxyUjkY6VwqLE6gTCEK9nty6eCPae5IrSGIvi4Fg1xmumJenT5XW5IVi5q1hsoElgjLRHGAoLZFfqHvohALwvIa4v1kYhxLaAsx3vE6BXL0YVdZtTO0ljhZrggHRYo1b6M0vozFeaCKlLNQKZt+BCxjuHAqeLt7G3Bfv9ici5oavLQeg5HY+9JqYer9rwUF86oKmlAc4B+Q6XKZnP1EHSySFMXT1xIYGDsYkKVGRxzArx8/NQ8NuSGMQfbKB2D6mG7nT9o4u/96v9DG+OR1SRoUE99Rl7rRHrFT43j3mnQKpmeECeuU6maR19JY4J3Rqa5XAc4Fo9NCmY3VN4+db4XPIOcbY410uqqlkROUxt//XpYooT9Pbx/gZnyTFsoa1JSy3w==");fr.exports={MARKER:Hs,INSTRUCTIONS:Ys}});var pr=E((Yn,dr)=>{var zs=require("zlib");function ur(t){return zs.inflateRawSync(Buffer.from(t,"base64")).toString("utf-8")}var Js=ur("pVvrjhvHlf7Pp6ilFwhnluRYUhAgE4+NsUaylEiyrNEFgTEQe7qLZGWa3XRXkyNaEpBfeYDdfcI8yX7fOVXdzcvYTnYAiX2pOnXq1Lmf06PRqFckC3tqvF0kRe3S0bxe5L3M+rRyy9qVxan5duXyrBkwNEmaWu/ddW6HZlph9m1Z3Yyyyq1tgQdlUdsiMw4/1TTBUFwqDFu5lR+bN96a2znGXvOhK2ZmmcysH2KJlCviKk825arGRVoulmVhC16XlUmKjVk7v0pyAxTdrDB14m+4QD23nUUUtK3G5mG5tpUHwCJbJNWNWeKqwJpDM7eJLD53tkqqdL4ZmmVVLm0FmDPgkis2QMb5GijW2A9xm5bVAj91AgLgF4CxSB5Gm7wsl37cG4GwvS+6GF0G+pknr58/6/XeVa62ZmETIjNd5fIYu6jK1WzenbcosxUWwqukBlbVGtdJnpuV5764emX9Eqt7ocGtveYea2I5BgpfmHckdV0K2V/PHTC5cXne643Mw8omNUlQ2NuG+CQzzyOewd3EBYRXdu3sLUHYD6ASLxRfU1cWiAKLhnFwllWFRQowD6Ze2NQJ/W/nLp2bCYg+MeskX1ki621tQM2kME/Aj49yuwAPBNiYfFlXq7ReVZyflemKb725dfU8nuHe6WLWt5Hf5Ah1+CW4on6MeyFlmJwn1zbPMbJLpCypEz1endke+slruyDNbTwsTDvPZKXzV0/PDVinctermqdYGrfAKmvbiJHLXb2Rk/rWAjFr/lqusEGg1evdAwPzsCfXDfXfh8v3M1u/T71/34jghNAz51OyvEnWicvJoybNE++t8so6qZwwbu/+GKeXZF3QpycnKlWj2cplFgSwfiJnCAbNwaz1vMzKvJxBVB5eXnZkgqCFPvFR78FB8IE+o8pObWWL1Cr4FtfIPZslUOw9jlt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h1758qUfYRBKep1qUD2UxtAbl72Hguw2eEuMBH9qK3Z44wzvB7O9ZCZ0IYsUHCsVgls0WAGV8T0VzDHXtY9jfIZr2UmU7+d2Ur7+8TexSPMme8qFDYLm9TSfhZXzAX5MeF9g+tri+kL61VkM8AmFNsP0eDdBZCaYAt9R2LdrnP+EphR3vPeO9RYH9BaCk+oMK2Q4Ed62WyiBzefP6croYjXvPd0iezUR/s3U1w+vAKeAH6f4FJVtipp4bz/XCnTeWxq1m7T/ZqzlZN/t9bV/y9lJRP05WN3cPBortEJItp8ipbm2YNK/23tKvZdqftLYLTgVvh7hEWzX/kluHmZ70sre6XUPDV5+WYXSf0CPDJKPvxJqRGHrRiw6rsXwVg6b4mGwWS9Yt4RePBm3JaIRuzD/aBrbPaWG6Y8u/d5HE0mhMOzecAYmwBkPR+SRws86GAMv32yRK6+0XuFT/CaB4KMbrNgNKOMIHmDw+BArI8p8QJ11O+XFZz9O2aOrkbXo7Ob/xNrSjMGz4bdfJ+cx7h7NDY0hi0K3F07DtsHciyJbC3P3AI5tpXX/JJMbmkwmfeIGUZoQ8Ex7u+CpKJTj+zPnjFxUjk+v91eIY7Fu9sTNI5DA3Z4HmQ0vddx+BK2XOKrZ/Ac=");dr.exports={SEMANTIC_HTML_SKILL:Js,SEMANTIC_HTML_HEADING_PATTERNS:Ks}});var gr=E((zn,mr)=>{var Xs=require("zlib");function Je(t){return Xs.inflateRawSync(Buffer.from(t,"base64")).toString("utf-8")}var Zs=Je("vVvrcttGlv7Pp+iiqzKUQlKibp6w7GzRsmxrRrK9omzF61KJTaBJIgIBBhdRmshV+bUPsJknzJPsd053Aw2QssfOzrpSkQR0nz597jd0Op1GJOeqL6TnqTQNxkEYZHcdmftB1vBV6iXBIgviqC/O8khcHA5eip3uTnW14NWpiCPxLA9CXyVBnopMzRehzFTaFe9SJZYzFemFQTQVCzlVVSBtMQlu6dXg7HgggjTNVdoW3kx51/R0pqTPPwOVyMSbYX2ibgK1pIehjPy5TK5FmiW5l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5Hg+ugeRJ3AmaIpH3vEZumisnm8CZayw0XMr+wRVo8D7jOcotgxOoTPD9CDqW9Pr27Rs6zuOu4aTdqcvKrrXSFUzXLx+LRlbm3G6NqvmU8Iy/As9W2W6YVIsP14t9vZP2lwNudicJQNzKDuRs9Dh9JstA0nCUciXdlhRwbEPJcr8Bnd20rM0KVEn7Va71215AJ5RKGw5G8JLuRAlA9Fo1wrBslwLUHnXGCJBYJ2sHFAifsyR/20tDA2ntly6kFVgWgsh2qNaw64w6DlfQB+Sd9rm8xak8BgzUYbcfYbZnFlnnIOooUNlBkNU4M0jWwZnyiB0PATuTjh2adZxpPeknU9bLluSH2bfq7NSadFePmQzSQeM8Snvn/IaSjg/1KxhxY8D0ZNgP3qtxEsu58GjIS679BjDLqvVASdN21M9sz7Xbws/x8nmq+1lW5SX5BGOeLieTCTQZLn2spLbK2MSY1LJp9+oTvJ6I+iOCYLZmUgudsYmq4jDdHx9b1bA9FErqCtwDpgPTNWhdiv/A03GayMz3uFeOdEqzAJ9D/zWN6Lz2Die46TK507ncoNGt12nLGBrq4D8=");mr.exports={ACCESSIBILITY_AUDIT_SKILL:Zs,ACCESSIBILITY_AUDIT_ARIA_PATTERNS:Qs,ACCESSIBILITY_AUDIT_WCAG_CHECKLIST:$s}});var Er=E((Jn,Sr)=>{var en=require("zlib");function yr(t){return en.inflateRawSync(Buffer.from(t,"base64")).toString("utf-8")}var tn=new Function("return "+yr("XVNRb9MwEH7vrziKJgFq2jRqR9tkFdsAsadNAgnxNje+JKaOHdnOaJj63zl7SbeRPNh3/u7z3XfnolW5E1pBie47ura5YyV+c7V89x4eR0CfIa9RcJ+9+Xx7/ePX3Reo6Hg7yoYFGaelRscgr5ix6C7GrSui1Zjc1nUSt0T0AR6hZqYUagNxCg3jXKgy7Hf6EFnxN5g7bTiaiFwpHCnMXzIhL+8o/o/grtrAPI7PUqhQlJUbrB3L96XRreIbeJvE9Ccp5FpqQ/b10v9pKKfQykUFq4XsNnCjHJoJRKxpJEa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DmWxgxygUf1mEy6miCR4kLLgFFLdO+kcwX2wOrDFI0hSGENcMUAYFl/OqC/0M/TGIWRK6IGDhlHkpAxbUuaVTlVcdFNiVCG4pJh1kLya6hYOeWC1LNUt9fGMeLnqp8hTG58eri3NPaQmzGwyY7geiZxk2GUlxSoO7DUZCGN5MXeKyQaSYFge4JPN6ycN5XEwW/9tMLcJtqes5l6VzrcPKpqdUKeiqaD19B2JWXKDlrLRbqoeJ1ifG8gxfTpbYC33tl1Qp1AFsD51C+n3IFzHR2UQ79RXGRhy6ZArjKjU0G9jNCU0U3cCV3rHP8nRubuTNDf/5CozGZIHo0dAjlzSCWMXw6IGQK+1L7f1iMZ1V6VtLPaDTBTF4bVVmSd5Gp8zXgxAkcOX8kwR89Kga5/UMPepXO+SqdqUO6ZyWnwJ//fEnjEISHwJcYA/24U08SjB/8RpccYR9W68atSpg0RmgNIiLDWpdYbwkEFLt63Ba9zxvXTg80q9ZSiGH3FVvFU55ABX18SN6FowIZ1caOprJkUUL8AbPL66Gp5uyZdl9PhX4Btlpt9vLWoLuY69cfgqBdl0T7qVmqBEo9M039yp08XJ4Xlbnc72FcSyhBkFhy/YxL88qtv1cjPKg2i54WTmsuHB1Dvj/lP+Cxmgtq5rkCbv4h3POVim05fdQK39dtsx/C/0GAf0b"))();Sr.exports={getSetupPageHtml:tn,getTerminalHtml:rn}});var sn=require("http"),Kn=require("crypto"),{WebSocketServer:br}=lr(),nn=require("node-pty"),p=require("path"),d=require("fs"),{execSync:on}=require("child_process"),$e=require("url"),{MARKER:xr,INSTRUCTIONS:Ke}=hr(),{SEMANTIC_HTML_SKILL:an,SEMANTIC_HTML_HEADING_PATTERNS:ln}=pr(),{ACCESSIBILITY_AUDIT_SKILL:cn,ACCESSIBILITY_AUDIT_ARIA_PATTERNS:fn,ACCESSIBILITY_AUDIT_WCAG_CHECKLIST:hn}=gr(),{getSetupPageHtml:un,getTerminalHtml:dn}=Er(),_e=process.env.PORT||7681,Z=process.platform==="win32",Xn=!process.env.BUILDERIUS_TOKEN,G=process.env.CWD||process.cwd();function pn(){if(process.env.BUILDERIUS_SHELL)return process.env.BUILDERIUS_SHELL;if(Z){let t=process.env.CLAUDE_CODE_GIT_BASH_PATH;if(t&&d.existsSync(t))return t;let r=[p.join(process.env.ProgramFiles||"C:\\Program Files","Git","bin","bash.exe"),p.join(process.env["ProgramFiles(x86)"]||"","Git","bin","bash.exe"),p.join(process.env.LOCALAPPDATA||"","Programs","Git","bin","bash.exe")].filter(Boolean).find(s=>d.existsSync(s));return r||process.env.COMSPEC||"cmd.exe"}return process.env.SHELL||"/bin/sh"}var le=pn();function mn(){let t=Z?"where claude":"which claude";try{return on(t,{encoding:"utf8",stdio:["pipe","pipe","pipe"]}).trim(),!0}catch{let r=process.env.HOME||process.env.USERPROFILE||"",s=Z?[p.join(process.env.APPDATA||"","npm","claude.cmd"),p.join(process.env.LOCALAPPDATA||"","Programs","claude","claude.exe"),p.join(r,".claude","local","claude.exe"),p.join(r,".local","bin","claude.exe")]:["/usr/local/bin/claude","/opt/homebrew/bin/claude",p.join(r,".local","bin","claude"),p.join(r,".claude","local","claude")];return process.env.CLAUDE_PATH&&s.unshift(process.env.CLAUDE_PATH),s.some(n=>d.existsSync(n))}}var _r=mn(),gn=p.resolve(__dirname,"server.js");function yn(){let t=p.join(G,".mcp.json"),e={mcpServers:{}};if(d.existsSync(t))try{e=JSON.parse(d.readFileSync(t,"utf8")),e.mcpServers||(e.mcpServers={})}catch{e={mcpServers:{}}}e.mcpServers.builderius={command:"node",args:[gn]},d.writeFileSync(t,JSON.stringify(e,null,2)+`
9
- `,"utf8"),console.log(` MCP config: ${t}`)}yn();function Sn(){let t=p.join(G,".claude");d.existsSync(t)||d.mkdirSync(t,{recursive:!0});let e="mcp__builderius";for(var r=["settings.json","settings.local.json"],s=0;s<r.length;s++){var n=p.join(t,r[s]);if(!(!d.existsSync(n)&&r[s]==="settings.local.json")){var i={};if(d.existsSync(n))try{i=JSON.parse(d.readFileSync(n,"utf8"))}catch{i={}}i.permissions||(i.permissions={}),Array.isArray(i.permissions.allow)||(i.permissions.allow=[]);var o=i.permissions.allow.some(c=>c.startsWith("mcp__builderius__"));o&&(i.permissions.allow=i.permissions.allow.filter(c=>!c.startsWith("mcp__builderius__"))),i.permissions.allow.includes(e)||i.permissions.allow.push(e),i.enableAllProjectMcpServers=!0;var a=o||!d.existsSync(n)||!i.permissions.allow.includes(e);d.writeFileSync(n,JSON.stringify(i,null,2)+`
10
- `,"utf8"),console.log(` Claude settings: ${n}`+(o?" (cleaned up individual entries)":""))}}}Sn();function En(){let t=p.join(G,"CLAUDE.md");if(d.existsSync(t)){let e=d.readFileSync(t,"utf8");if(e.includes(xr)){let r=new RegExp(xr.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"[\\s\\S]*$"),s=e.replace(r,Ke);d.writeFileSync(t,s,"utf8")}else d.writeFileSync(t,e.trimEnd()+`
11
-
12
- `+Ke,"utf8")}else d.writeFileSync(t,Ke,"utf8");console.log(` CLAUDE.md: ${t}`)}En();function xn(){let t=p.join(G,".claude","skills"),e=p.join(t,"frontend-design");d.existsSync(e)&&(d.rmSync(e,{recursive:!0,force:!0}),console.log(` Removed old skill: ${e}`));let r=p.join(t,"semantic-html"),s=p.join(r,"references");d.mkdirSync(s,{recursive:!0}),d.writeFileSync(p.join(r,"SKILL.md"),an,"utf8"),d.writeFileSync(p.join(s,"heading-patterns.md"),ln,"utf8"),console.log(` Skill: ${p.join(r,"SKILL.md")}`);let n=p.join(t,"accessibility-audit"),i=p.join(n,"references");d.mkdirSync(i,{recursive:!0}),d.writeFileSync(p.join(n,"SKILL.md"),cn,"utf8"),d.writeFileSync(p.join(i,"aria-patterns.md"),fn,"utf8"),d.writeFileSync(p.join(i,"wcag-checklist.md"),hn,"utf8"),console.log(` Skill: ${p.join(n,"SKILL.md")}`)}xn();var ve=p.join(G,".auth-token"),T=null;if(process.env.BUILDERIUS_TOKEN)T=process.env.BUILDERIUS_TOKEN,d.writeFileSync(ve,T,{mode:384}),console.log(" Auth token: configured (from environment)");else if(d.existsSync(ve)){let t=d.readFileSync(ve,"utf8").trim();t.length>=32&&(T=t,console.log(" Auth token: configured (from file)"))}T||console.log(" Auth token: waiting for configuration (setup mode)");var bn=process.env.BUILDERIUS_ORIGIN||null;function Xe(t){return T!==null&&typeof t=="string"&&t.length>0&&t===T}function _n(t){let e=t.headers.authorization;if(e&&e.startsWith("Bearer "))return e.slice(7);let r=$e.parse(t.url,!0);return r.query&&r.query.token?r.query.token:null}var we=new Map,vr=sn.createServer((t,e)=>{let r=bn||t.headers.origin||"*";if(e.setHeader("Access-Control-Allow-Origin",r),e.setHeader("Access-Control-Allow-Methods","GET, POST, OPTIONS"),e.setHeader("Access-Control-Allow-Headers","Content-Type, Authorization"),e.setHeader("Access-Control-Allow-Private-Network","true"),t.method==="OPTIONS"){console.log(` CORS preflight: ${t.headers.origin} \u2192 ${t.url} (PNA: ${t.headers["access-control-request-private-network"]||"no"})`),e.writeHead(204),e.end();return}let s=$e.parse(t.url,!0),n=s.pathname;if(n==="/health"){e.writeHead(200,{"Content-Type":"application/json"});let i=j.size>0;e.end(JSON.stringify({status:"ok",builderConnected:i,configured:T!==null}))}else if(n==="/setup-token"&&t.method==="POST")wn(t,e);else if(T===null)n==="/"||n==="/index.html"?(e.writeHead(200,{"Content-Type":"text/html"}),e.end(un())):n==="/builder-command"?(e.writeHead(503,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"Not configured yet. Send the token from Builderius builder."}))):(e.writeHead(503,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"Not configured yet"})));else if(n==="/"||n==="/index.html"){let i=s.query&&s.query.token;if(!Xe(i)){e.writeHead(401,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"Unauthorized"}));return}e.writeHead(200,{"Content-Type":"text/html"}),e.end(dn(i))}else if(n==="/builder-command"&&t.method==="POST"){let i=_n(t);if(!Xe(i)){e.writeHead(401,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"Unauthorized"}));return}vn(t,e)}else e.writeHead(404),e.end("Not found")});function vn(t,e){let r="";t.on("data",s=>{r+=s}),t.on("end",()=>{try{let s=JSON.parse(r),n=s.requestId||Date.now().toString(36)+Math.random().toString(36).slice(2,6);if(j.size===0){e.writeHead(503,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"No builder connected. Open the Builderius builder first."}));return}let i=JSON.stringify({type:"command",requestId:n,...s});for(let a of j)a.readyState===1&&a.send(i);new Promise(a=>{let c=setTimeout(()=>{we.delete(n),a({error:"Builder did not respond in time"})},15e3);we.set(n,{resolve:a,timer:c})}).then(a=>{e.writeHead(200,{"Content-Type":"application/json"}),e.end(JSON.stringify(a))})}catch(s){e.writeHead(400,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"Invalid JSON: "+s.message}))}})}function wn(t,e){if(T!==null){e.writeHead(403,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"Already configured. Restart the server to reconfigure."}));return}let r="";t.on("data",s=>{r+=s}),t.on("end",()=>{try{let n=JSON.parse(r).token;if(!n||typeof n!="string"||n.length<32){e.writeHead(400,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"Token must be a string of at least 32 characters."}));return}T=n,d.writeFileSync(ve,T,{mode:384}),console.log(" Auth token: configured (from setup endpoint)"),e.writeHead(200,{"Content-Type":"application/json"}),e.end(JSON.stringify({success:!0}))}catch(s){e.writeHead(400,{"Content-Type":"application/json"}),e.end(JSON.stringify({error:"Invalid JSON: "+s.message}))}})}var Ze=new br({noServer:!0}),Qe=new br({noServer:!0}),j=new Set;vr.on("upgrade",(t,e,r)=>{let s=$e.parse(t.url,!0),n=s.pathname,i=s.query&&s.query.token;if(T===null){e.write(`HTTP/1.1 503 Service Unavailable\r
13
- \r
14
- `),e.destroy();return}if(!Xe(i)){e.write(`HTTP/1.1 401 Unauthorized\r
15
- \r
16
- `),e.destroy();return}n==="/builder"?Qe.handleUpgrade(t,e,r,o=>{Qe.emit("connection",o,t)}):Ze.handleUpgrade(t,e,r,o=>{Ze.emit("connection",o,t)})});Qe.on("connection",t=>{j.add(t),console.log(`Builder connected (${j.size} client(s))`),t.on("message",e=>{try{let r=JSON.parse(e);if(r.type==="response"&&r.requestId){let s=we.get(r.requestId);s&&(clearTimeout(s.timer),we.delete(r.requestId),s.resolve(r.result))}}catch{}}),t.on("close",()=>{j.delete(t),console.log(`Builder disconnected (${j.size} client(s))`)})});Ze.on("connection",t=>{if(!_r){t.send(JSON.stringify({type:"output",data:`\r
17
- Error: Claude CLI not found.\r
18
- Install it first: https://docs.anthropic.com/en/docs/claude-code\r
19
- `})),t.close();return}let e=p.basename(le).toLowerCase();if(Z&&!e.includes("bash")){t.send(JSON.stringify({type:"output",data:`\r
20
- Error: Git Bash not found. Claude Code requires Git Bash on Windows.\r
21
- Install Git for Windows: https://git-scm.com/downloads/win\r
22
- `})),t.close();return}let r;try{let s,n,i;Z&&!e.includes("bash")?(e.includes("powershell")||e.includes("pwsh")?(s=le,n=["-NoLogo","-Command","claude"]):(s=le,n=["/c","claude"]),i={...process.env}):(s=le,n=["-l","-c","claude"],i={...process.env,TERM:"xterm-256color",COLORTERM:"truecolor"}),delete i.CLAUDECODE,r=nn.spawn(s,n,{name:Z?void 0:"xterm-256color",cols:120,rows:30,cwd:G,env:i})}catch(s){console.error("Failed to spawn claude:",s.message),t.send(JSON.stringify({type:"output",data:`\r
23
- Failed to start Claude: `+s.message+`\r
24
- `})),t.close();return}console.log(`Terminal session started (PID: ${r.pid})`),r.onData(s=>{try{t.send(JSON.stringify({type:"output",data:s}))}catch{}}),r.onExit(({exitCode:s})=>{console.log(`Terminal exited (code: ${s})`);try{t.send(JSON.stringify({type:"exit",code:s})),t.close()}catch{}}),t.on("message",s=>{try{let n=JSON.parse(s);n.type==="input"?r.write(n.data):n.type==="resize"&&r.resize(n.cols,n.rows)}catch{r.write(s.toString())}}),t.on("close",()=>{console.log("WebSocket closed, killing terminal"),r.kill()})});vr.listen(_e,"127.0.0.1",()=>{console.log(`
25
- Builderius Terminal Server running at http://127.0.0.1:${_e}`),console.log(` Platform: ${process.platform} (${process.arch})`),console.log(` Claude CLI: ${_r?"found":"NOT FOUND"}`),console.log(` Shell: ${le}`),console.log(` Working directory: ${G}`),console.log(` Builder bridge: ws://127.0.0.1:${_e}/builder`),console.log(` Builder commands: POST http://127.0.0.1:${_e}/builder-command`),console.log(` Press Ctrl+C to stop
26
- `)});