@fugood/bricks-cli 2.25.7 → 2.25.9

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 CHANGED
@@ -354,6 +354,16 @@ Notes:
354
354
  it in the buttress `state.json`, so that server's local functions can use `context.bank`
355
355
  (`--revoke` removes it; re-running rotates the key).
356
356
 
357
+ ### Buttress binding and device authentication
358
+
359
+ `bricks buttress bind` pairs the server with the current workspace **and automatically
360
+ provisions a workspace-scoped DevTools token** in its permission-restricted `state.json`.
361
+ After restarting Buttress, agents with `local_devices = true` use it for matching-workspace
362
+ devices without passing credentials through model arguments. Normal bind/status output
363
+ hides the token; `--print` emits the complete secret state for remote provisioning.
364
+ Rebind and restart to renew an expired token (default lifetime: 30 days). Rebinding does
365
+ not revoke older tokens. Automatic device authentication assumes a trusted LAN.
366
+
357
367
  ### Interactive Mode
358
368
 
359
369
  ```bash
package/lib/1178.js CHANGED
@@ -1 +1 @@
1
- export const __rspack_esm_id=1178;export const __rspack_esm_ids=[1178];export const __webpack_modules__={28193(e,o,r){r.a(e,async function(e,t){try{r.r(o),r.d(o,{createCdpClient:()=>u});var n,s=r(99436),a=r(84361),c=e([a]);a=(c.then?(await c)():c)[0];var i=15e3,l=({address:e,port:o,method:r,phase:t="request",closeCode:n,closeReason:s,local:a=!1})=>{var c=s?Buffer.isBuffer(s)?s.toString("utf8"):String(s):"",i="connect"===t?"before the CDP session opened":r?`while waiting for ${r}`:"during the CDP session",l=`${e}:${o}`,d=[];null!=n&&d.push(`code ${n}`),c&&d.push(`reason: ${c}`);var u=[a?`CDP client closed the connection to ${l} ${i}.`:`CDP connection to ${l} closed ${i}.`,d.length>0?`WebSocket close ${d.join(", ")}.`:null,a?null:"The DevTools server currently accepts one CDP client at a time. Another DevTools window or CLI command may have replaced this session. Retry the command, close the other inspector, or avoid running DevTools commands in parallel."].filter(Boolean).join("\n"),f=Error(u);return f.code="CDP_CONNECTION_CLOSED",f.method=r,f.phase=t,f.closeCode=n,f.closeReason=c,f},d=(n=s(function*(e,o,r){var t,n=r?"string"==typeof r?{passcode:r}:r:{},s=n.passcode,a=n.accessToken;if(a)return`ws://${e}:${o}/ws?access_token=${encodeURIComponent(a)}`;if(!s)try{var c=new AbortController;t=setTimeout(()=>c.abort(),3e3);var i=yield fetch(`http://${e}:${o}/json/list`,{signal:c.signal});if(i.ok){var l=yield i.json(),d=l?.[0]?.webSocketDebuggerUrl;if(d){var u=d.match(/\/ws(?:\/.*)?$/);if(u)return`ws://${e}:${o}${u[0]}`}}}catch{}finally{void 0!==t&&clearTimeout(t)}return s?`ws://${e}:${o}/ws/${encodeURIComponent(s)}`:`ws://${e}:${o}/ws`}),function(e,o,r){return n.apply(this,arguments)}),u=(e,o,r)=>{var t,n,c=0,u=new Map,f=new Map,h=null,m=e=>{for(var o of u.values()){var r=o.reject,t=o.timer,n=o.method;clearTimeout(t),r(e(n))}u.clear()};return{connect:(t=s(function*(){var t=yield d(e,o,r);return new Promise((r,s)=>{n=new a.WebSocket(t);var c=!1;n.once("open",()=>{c=!0,h=null,r()}),n.once("error",r=>{c||s(Error(r.message||`Cannot connect to ${e}:${o}`))}),n.on("message",e=>{try{var o=JSON.parse(e.toString());if(null!=o.id&&u.has(o.id)){var r=u.get(o.id),t=r.resolve,n=r.reject,s=r.timer;clearTimeout(s),u.delete(o.id),o.error?n(Error(o.error.message)):t(o.result);return}if(o.method){var a=f.get(o.method);if(a)for(var c of a)c(o.params)}}catch{}}),n.on("close",(r,t)=>{h={closeCode:r,closeReason:t},c||s(l({address:e,port:o,phase:"connect",closeCode:r,closeReason:t})),m(n=>l({address:e,port:o,method:n,closeCode:r,closeReason:t}))})})}),function(){return t.apply(this,arguments)}),send:(r,t={},s=i)=>new Promise((a,i)=>{if(!n||n.readyState!==n.OPEN)return h?void i(l({address:e,port:o,method:r,closeCode:h.closeCode,closeReason:h.closeReason})):void i(Error(`Not connected to CDP at ${e}:${o} while sending ${r}`));var d=++c,f=setTimeout(()=>{u.delete(d),i(Error(`Timeout: ${r}`))},s);u.set(d,{resolve:a,reject:i,timer:f,method:r}),n.send(JSON.stringify({id:d,method:r,params:t}))}),on:(e,o)=>{f.has(e)||f.set(e,[]),f.get(e).push(o)},off:(e,o)=>{var r=f.get(e);if(r){var t=r.indexOf(o);t>=0&&r.splice(t,1)}},close:()=>{m(r=>l({address:e,port:o,method:r,local:!0})),n&&(n.terminate(),n=null)}}};t()}catch(e){t(e)}})}};
1
+ export const __rspack_esm_id=1178;export const __rspack_esm_ids=[1178];export const __webpack_modules__={28193(e,o,r){r.a(e,async function(e,t){try{r.r(o),r.d(o,{createCdpClient:()=>u});var n,s=r(99436),a=r(84361),c=e([a]);a=(c.then?(await c)():c)[0];var i=15e3,l=({address:e,port:o,method:r,phase:t="request",closeCode:n,closeReason:s,local:a=!1})=>{var c=s?Buffer.isBuffer(s)?s.toString("utf8"):String(s):"",i="connect"===t?"before the CDP session opened":r?`while waiting for ${r}`:"during the CDP session",l=`${e}:${o}`,d=[];null!=n&&d.push(`code ${n}`),c&&d.push(`reason: ${c}`);var u=[a?`CDP client closed the connection to ${l} ${i}.`:`CDP connection to ${l} closed ${i}.`,d.length>0?`WebSocket close ${d.join(", ")}.`:null,a?null:"The DevTools server currently accepts one CDP client at a time. Another DevTools window or CLI command may have replaced this session. Retry the command, close the other inspector, or avoid running DevTools commands in parallel."].filter(Boolean).join("\n"),h=Error(u);return h.code="CDP_CONNECTION_CLOSED",h.method=r,h.phase=t,h.closeCode=n,h.closeReason=c,h},d=(n=s(function*(e,o,r){var t,n=r?"string"==typeof r?{passcode:r}:r:{},s=n.passcode,a=n.accessToken;if(a)return`ws://${e}:${o}/ws?access_token=${encodeURIComponent(a)}`;if(!s)try{var c=new AbortController;t=setTimeout(()=>c.abort(),3e3);var i=yield fetch(`http://${e}:${o}/json/list`,{signal:c.signal});if(i.ok){var l=yield i.json(),d=l?.[0]?.webSocketDebuggerUrl;if(d){var u=d.match(/\/ws(?:\/.*)?$/);if(u)return`ws://${e}:${o}${u[0]}`}}}catch{}finally{void 0!==t&&clearTimeout(t)}return s?`ws://${e}:${o}/ws/${encodeURIComponent(s)}`:`ws://${e}:${o}/ws`}),function(e,o,r){return n.apply(this,arguments)}),u=(e,o,r)=>{var t,n,c=0,u=new Map,h=new Map,f=null,m=0,p=e=>{for(var o of u.values()){var r=o.reject,t=o.timer,n=o.method;clearTimeout(t),r(e(n))}u.clear()};return{connect:(t=s(function*(){var t=++m,s=yield d(e,o,r);if(t!==m)throw l({address:e,port:o,phase:"connect",local:!0});return new Promise((r,t)=>{n=new a.WebSocket(s,{handshakeTimeout:i});var c=!1;n.once("open",()=>{c=!0,f=null,r()}),n.once("error",r=>{c||t(Error(r.message||`Cannot connect to ${e}:${o}`))}),n.on("message",e=>{try{var o=JSON.parse(e.toString());if(null!=o.id&&u.has(o.id)){var r=u.get(o.id),t=r.resolve,n=r.reject,s=r.timer;clearTimeout(s),u.delete(o.id),o.error?n(Error(o.error.message)):t(o.result);return}if(o.method){var a=h.get(o.method);if(a)for(var c of a)c(o.params)}}catch{}}),n.on("close",(r,n)=>{f={closeCode:r,closeReason:n},c||t(l({address:e,port:o,phase:"connect",closeCode:r,closeReason:n})),p(t=>l({address:e,port:o,method:t,closeCode:r,closeReason:n}))})})}),function(){return t.apply(this,arguments)}),send:(r,t={},s=i)=>new Promise((a,i)=>{if(!n||n.readyState!==n.OPEN)return f?void i(l({address:e,port:o,method:r,closeCode:f.closeCode,closeReason:f.closeReason})):void i(Error(`Not connected to CDP at ${e}:${o} while sending ${r}`));var d=++c,h=setTimeout(()=>{u.delete(d),i(Error(`Timeout: ${r}`))},s);u.set(d,{resolve:a,reject:i,timer:h,method:r}),n.send(JSON.stringify({id:d,method:r,params:t}))}),on:(e,o)=>{h.has(e)||h.set(e,[]),h.get(e).push(o)},off:(e,o)=>{var r=h.get(e);if(r){var t=r.indexOf(o);t>=0&&r.splice(t,1)}},close:()=>{m++,p(r=>l({address:e,port:o,method:r,local:!0})),n&&(n.terminate(),n=null)}}};t()}catch(e){t(e)}})}};