@fugood/bricks-cli 2.26.0 → 2.26.1-beta.1
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/README.md +7 -4
- package/lib/1010.js +1 -1
- package/lib/1708.js +2 -2
- package/lib/1809.js +1 -1
- package/lib/2486.js +1 -1
- package/lib/2517.js +1 -1
- package/lib/6818.js +1 -1
- package/lib/7294.js +2 -2
- package/lib/8687.js +7 -7
- package/lib/907.js +8 -0
- package/lib/9439.js +1 -1
- package/lib/index.js +23 -23
- package/lib/lib.js +11 -3
- package/package.json +5 -5
package/lib/1809.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const __rspack_esm_id=1809;export const __rspack_esm_ids=[1809];export const __webpack_modules__={35912(e,r,s){s.r(r),s.d(r,{PASSCODE_PERMISSIONS:()=>
|
|
1
|
+
export const __rspack_esm_id=1809;export const __rspack_esm_ids=[1809];export const __webpack_modules__={35912(e,r,s){s.r(r),s.d(r,{MAX_NEW_PASSCODE_CHARS:()=>i.fe,MIN_NEW_PASSCODE_CHARS:()=>i.J8,MIN_NEW_PASSCODE_DISTINCT_CHARS:()=>i.QW,PASSCODE_PERMISSIONS:()=>d,PASSCODE_RULE_SUMMARY:()=>i.rG,WEAK_PASSCODE_ERROR:()=>i.xz,buildNewPasscode:()=>S,formatImageVersions:()=>L,mediaApiUrl:()=>c,parseDuration:()=>_,parseFileTypes:()=>m,parsePasscodePermissions:()=>u,presentBox:()=>A,presentPasscode:()=>h,runConfirmed:()=>w,scrubSecret:()=>E,validateNewPasscode:()=>i.V3});var t,o=s(99436),n=s(67996),a=s(58021),i=s(45213),l=["code"],d=["ALL","READ_ONLY","POST_ONLY","DELETE"],p={s:1,m:60,h:3600,d:86400,w:604800},c=(e,r=process.env)=>{var s;if(r.BRICKS_MEDIA_API_URL)return r.BRICKS_MEDIA_API_URL.replace(/\/$/,"");try{s=new URL(e)}catch{return null}return"localhost"===s.hostname||"127.0.0.1"===s.hostname?"http://localhost:3002":/^display(-[a-z0-9]+)?\.bricks\.tools$/.test(s.hostname)?`${s.protocol}//${s.hostname.replace(/^display/,"media")}`:null},m=e=>e?e.split(",").map(e=>e.trim().toUpperCase()).filter(Boolean):void 0,_=e=>{var r=String(e).trim().match(/^(\d+)\s*([smhdw]?)$/i),s=r?Number(r[1])*p[(r[2]||"s").toLowerCase()]:0;if(!s||s>31536e7)throw Error(`Invalid duration "${e}". Use seconds or a number with s, m, h, d or w.`);return s},u=e=>{if(!e)return["ALL"];var r=[...new Set(e.split(",").map(e=>e.trim().toUpperCase().replace(/-/g,"_")).filter(Boolean))],s=r.filter(e=>!d.includes(e));if(s.length>0)throw Error(`Unknown passcode permission: ${s.join(", ")}. Use ${d.join(", ")}.`);if(r.includes("ALL")&&r.length>1)throw Error("Passcode permission ALL cannot be combined with other permissions");return r.length>0?r:["ALL"]},S=({name:e,code:r,expiresIn:s,permissions:t})=>{var o=(e||"Passcode").trim();if([...o].length<2)throw Error("Passcode name must be at least 2 characters");return(0,i.V3)(r),{name:o,code:r,enableExpired:null!=s,expireSeconds:null!=s?_(s):3600,permissions:u(t)}},h=(e,{showCodes:r=!1,now:s=Date.now()}={})=>{let t;var o=e.code,a={...n(e,l),expired:!!(e.enableExpired&&e.expiredAt&&(t=e.expiredAt,Date.parse(/(?:z|[+-]\d\d:?\d\d)$/i.test(t)?t:`${t}Z`)<s))};return e.enableExpired||(a.expiredAt=null),r&&null!=o&&(a.code=o),a},A=(e,r)=>e&&{...e,...e.passcodes&&{passcodes:e.passcodes.map(e=>h(e,r))}},E=(e,r)=>r?String(e).split(r).join("***"):String(e),w=(t=o(function*({message:e,yes:r,json:s,action:t,confirm:o=a.n}){return(yield o({message:e,autoYes:r,json:s}))?{cancelled:!1,result:yield t()}:{cancelled:!0}}),function(e){return t.apply(this,arguments)}),L=e=>(e.meta?.imageVersions||[]).map(e=>`${e.width}x${e.height} ${e.strategy||""}`.trim()).join(", ")}};
|
package/lib/2486.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const __rspack_esm_id=2486;export const __rspack_esm_ids=[2486];export const __webpack_modules__={421(e,r,a){a.r(r),a.d(r,{buildDoctorReport:()=>h,renderDoctorReport:()=>v});var i,o,t=a(99436),s=a(85382),n=a(31802),c=a(8479),l=a(7586),p=a(47988),u=(i=t(function*(){try{return yield Promise.all([a.e(1826),a.e(3781),a.e(7281),a.e(1010),a.e(9439)]).then(a.bind(a,70114)),{available:!0}}catch(e){return{available:!1,error:e.message}}}),function(){return i.apply(this,arguments)}),k=(e,r,a)=>({severity:e,code:r,message:a}),h=(o=t(function*({version:e="2.26.
|
|
1
|
+
export const __rspack_esm_id=2486;export const __rspack_esm_ids=[2486];export const __webpack_modules__={421(e,r,a){a.r(r),a.d(r,{buildDoctorReport:()=>h,renderDoctorReport:()=>v});var i,o,t=a(99436),s=a(85382),n=a(31802),c=a(8479),l=a(7586),p=a(47988),u=(i=t(function*(){try{return yield Promise.all([a.e(1826),a.e(3781),a.e(7281),a.e(1010),a.e(9439)]).then(a.bind(a,70114)),{available:!0}}catch(e){return{available:!1,error:e.message}}}),function(){return i.apply(this,arguments)}),k=(e,r,a)=>({severity:e,code:r,message:a}),h=(o=t(function*({version:e="2.26.1-beta.1",mcpCheck:r=u}={}){var a=(0,p.getCurrentProfile)(),i=(0,p.getCurrentProfileSource)(),o=(0,n.getConnectionContext)(a),t=o.tokenInfo,h=o.auth,d=o.baseUrl,v=o.activityLogBaseUrl,m=[],w={ok:!1,timestamp:new Date().toISOString(),cli:{name:"bricks",version:e},profile:{name:a,source:i},config:{path:p.CONFIG_PATH,baseUrl:d,activityLogBaseUrl:v},auth:{available:!!h,source:h?"config":"missing",kind:h?.kind||null,workspaceId:t?.workspaceId||null,workspaceName:t?.workspaceName||null,createdAt:t?.createdAt||null,tokenPreview:h?.kind==="token"?(0,l.$l)(h.token):null},connectivity:{workspace:{ok:!1,skipped:!h,error:null}},capabilities:{zeroArgMode:(0,c.isInteractiveTerminal)()?"interactive":"help",mcp:{available:!1,error:null}},issues:m};if(h)try{var b=yield(0,s.createClient)(d,h).workspace();w.connectivity.workspace={ok:!0,skipped:!1,error:null,id:b?._id||t.workspaceId||null,name:b?.name||t.workspaceName||null},w.auth.workspaceId=b?._id||w.auth.workspaceId,w.auth.workspaceName=b?.name||w.auth.workspaceName}catch(e){w.connectivity.workspace={ok:!1,skipped:!1,error:e.message},m.push(k("error","workspace_unreachable",`Workspace query failed for ${d}: ${e.message}`))}else m.push(k("warning","auth_missing","No usable credential for the current profile."));var f=yield r();return w.capabilities.mcp={available:f.available,error:f.error||null},f.available||m.push(k("warning","mcp_unavailable",`MCP stdio server is unavailable: ${f.error||"Unknown error"}`)),w.ok=0===m.length,w}),function(){return o.apply(this,arguments)}),d=(e,r,a)=>`${e.padEnd(14)} ${r}${a?` ${a}`:""}`,v=e=>{var r=[];if(r.push("BRICKS CLI Doctor"),r.push("─".repeat(60)),r.push(d("CLI","OK",`bricks v${e.cli.version}`)),r.push(d("Profile","OK",`${e.profile.name} (${e.profile.source})`)),r.push(d("BRICKS API","OK",e.config.baseUrl)),r.push(d("Activity Log","OK",e.config.activityLogBaseUrl)),e.auth.available){var a=e.auth.workspaceName||e.auth.workspaceId||"Unknown workspace",i=[e.auth.source,e.auth.kind,e.auth.tokenPreview].filter(Boolean).join(", ");r.push(d("Auth","OK",i?`${a} (${i})`:a))}else r.push(d("Auth","WARN","No usable credential for the current profile"));if(e.connectivity.workspace.skipped)r.push(d("Workspace","WARN","Skipped because no credential is available"));else if(e.connectivity.workspace.ok){var o=e.connectivity.workspace.name||e.connectivity.workspace.id||"Unknown workspace";r.push(d("Workspace","OK",o))}else r.push(d("Workspace","FAIL",e.connectivity.workspace.error));return e.capabilities.mcp.available?r.push(d("MCP","OK","STDIO server import is available")):r.push(d("MCP","WARN",e.capabilities.mcp.error)),r.push(d("Zero-arg mode",((e,r=!1)=>e?"OK":r?"WARN":"FAIL")("interactive"===e.capabilities.zeroArgMode,"help"===e.capabilities.zeroArgMode),"interactive"===e.capabilities.zeroArgMode?"Starts Ink interactive mode on TTY":"Shows help outside TTY contexts")),e.issues.length>0&&(r.push("─".repeat(60)),r.push("Issues"),e.issues.forEach(e=>{r.push(`- [${e.severity}] ${e.message}`)})),r.join("\n")}}};
|