agent-device
Version:
Open source device layer for AI coding agents: a CLI, MCP server, and typed Node.js API to control mobile, web, TV, and desktop apps on devices and simulators, locally or in the cloud.
1 lines • 2.16 kB
JavaScript
import"./sdk-batch.js";function e(e){return!!(e&&e.width>0&&e.height>0)}function t(e,t,n){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):t}function n(e){return e.width*e.height}const r=[255,59,48,255],i=[255,214,10,255],a=[0,0,0,255],o={e:[`01110`,`10000`,`11110`,`10000`,`10000`,`10001`,`01110`],0:[`01110`,`10001`,`10011`,`10101`,`11001`,`10001`,`01110`],1:[`00100`,`01100`,`00100`,`00100`,`00100`,`00100`,`01110`],2:[`01110`,`10001`,`00001`,`00010`,`00100`,`01000`,`11111`],3:[`11110`,`00001`,`00001`,`01110`,`00001`,`00001`,`11110`],4:[`00010`,`00110`,`01010`,`10010`,`11111`,`00010`,`00010`],5:[`11111`,`10000`,`10000`,`11110`,`00001`,`00001`,`11110`],6:[`01110`,`10000`,`10000`,`11110`,`10001`,`10001`,`01110`],7:[`11111`,`00001`,`00010`,`00100`,`01000`,`01000`,`01000`],8:[`01110`,`10001`,`10001`,`01110`,`10001`,`10001`,`01110`],9:[`01110`,`10001`,`10001`,`01111`,`00001`,`00001`,`01110`],":":[`00000`,`00100`,`00100`,`00000`,`00100`,`00100`,`00000`],".":[`00000`,`00000`,`00000`,`00000`,`00000`,`00110`,`00110`]};function s(e,t){p(e,t.overlayRect,r,2),m(e,t.overlayRect,t.ref)}function c(e){return e===``?0:e.length*6-1}function l(e=1){return 7*e}function u(e,t){let n=t.scale??1,r=t.x;for(let i of t.text.toLowerCase()){let a=o[i];a&&d(e,a,r,t.y,n,t.color),r+=6*n}}function d(e,t,n,r,i,a){for(let o=0;o<t.length;o+=1)for(let s=0;s<t[o].length;s+=1)t[o][s]===`1`&&h(e,n+s*i,r+o*i,i,i,a)}function f(e,t,n,r){if(t<0||n<0||t>=e.width||n>=e.height)return;let i=(e.width*n+t)*4;e.data[i]=r[0],e.data[i+1]=r[1],e.data[i+2]=r[2],e.data[i+3]=r[3]}function p(e,t,n,r){for(let i=0;i<r;i+=1)g(e,t.x,t.x+t.width-1,t.y+i,n),g(e,t.x,t.x+t.width-1,t.y+t.height-1-i,n),_(e,t.x+i,t.y,t.y+t.height-1,n),_(e,t.x+t.width-1-i,t.y,t.y+t.height-1,n)}function m(e,n,r){let o=6+c(r),s=t(n.x,0,Math.max(0,e.width-o)),l=n.y-11-2,d=l>=0?l:t(n.y+2,0,Math.max(0,e.height-11));h(e,s,d,o,11,i),u(e,{x:s+3,y:d+2,text:r,color:a})}function h(e,t,n,r,i,a){for(let o=0;o<i;o+=1)for(let i=0;i<r;i+=1)f(e,t+i,n+o,a)}function g(e,t,n,r,i){for(let a=t;a<=n;a+=1)f(e,a,r,i)}function _(e,t,n,r,i){for(let a=n;a<=r;a+=1)f(e,t,a,i)}export{t as a,f as i,u as n,e as o,l as r,n as s,s as t};