busybits 2.3.0 → 2.4.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/.claude-plugin/marketplace.json +1 -1
- package/CHANGELOG.md +12 -0
- package/README.md +6 -0
- package/dist/build.json +2 -2
- package/dist/cli/busybits.js +33 -6
- package/dist/client/bundle/{app-DatmLMV4.js → app-B_jk_lPZ.js} +4 -4
- package/dist/client/bundle/{city-Obp81Tgi.js → city-DKO2ZZPJ.js} +1 -1
- package/dist/client/bundle/{daystats-Da82sNh9.js → daystats-CqDMjh5a.js} +1 -1
- package/dist/client/bundle/{dom-DPKsIT1T.js → dom-BnYE5zIh.js} +1 -1
- package/dist/client/bundle/{en-D6p_-oC0.js → en-BD-d_FWo.js} +1 -1
- package/dist/client/bundle/{es-aBALBWWq.js → es-ZgMlZ_LY.js} +1 -1
- package/dist/client/bundle/{format-DS9qjIGc.js → format-CnTSBxgP.js} +1 -1
- package/dist/client/bundle/{fr-BE8l2fLL.js → fr-DOSCFvER.js} +1 -1
- package/dist/client/bundle/{main-Bv-qstsh.js → main-7JfOGPBD.js} +2 -2
- package/dist/client/bundle/{ptypane-C7Nw8-Dx.js → ptypane-DBg26wgg.js} +1 -1
- package/dist/client/bundle/{room-name-Bf-U1Fyo.js → room-name-Cb8-ffEK.js} +1 -1
- package/dist/client/bundle/{simulator-B4Usk2yH.js → simulator-DeHOlOye.js} +1 -1
- package/dist/client/bundle/{world-model-CkevAUmh.js → world-model-C3GVcyT7.js} +1 -1
- package/dist/client/bundle/{world-stream-CuZouXr_.js → world-stream-DZkepWt9.js} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/server/index.js +234 -23
- package/mod/habblaud/.claude-plugin/plugin.json +1 -1
- package/mod/habblaud-mensagens/.claude-plugin/plugin.json +1 -1
- package/mod/habblaud-permissoes/.claude-plugin/plugin.json +1 -1
- package/mod/habblaud-pi/package.json +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,l as t}from"./simulator-B4Usk2yH.js";import{J as n,Q as r,Qt as i,Wt as a,at as o,bt as s,ct as c,dt as l,et as u,ft as d,gt as f,it as p,kt as m,mt as h,nt as g,ot as _,st as v,xt as ee}from"./world-model-CkevAUmh.js";import{f as y}from"./app-DatmLMV4.js";function b(t,n,r,i,o,s,c){return{id:t,kind:i,...c?{parentId:c}:{},provider:o,status:s,look:r,name:n,parts:a(e(t),void 0,r)}}function x(e=`live`){let t=e===`live`,n=[{id:`f_0a1b2c3d4e`,label:`ipe`,agents:[b(`a_1f2e3d4c`,`Marina`,`f`,`main`,`claude`,`working`),b(`a_2a3b4c5d`,`Rafael`,`m`,`sub`,`claude`,`working`,`a_1f2e3d4c`)]},{id:`f_1b2c3d4e5f`,label:`jade`,agents:[b(`a_3c4d5e6f`,`Beatriz`,`f`,`main`,`codex`,`waiting`),b(`a_4d5e6f70`,`Thiago`,`m`,`sub`,`codex`,`shell`)]},{id:`f_2c3d4e5f60`,label:`aurora`,agents:[b(`a_5e6f7081`,`Larissa`,`f`,`main`,`claude`,`idle`),b(`a_6f708192`,`Gustavo`,`m`,`main`,`codex`,`idle`)]}].map(e=>t?e:{...e,agents:[]});return{building:{id:`o_7a8b9c0d1e2f`,lot:{district:`centro`,x:3,y:5},owner:{id:`o_7a8b9c0d1e2f`,name:`Helena`,country:`BR`},state:e===`away`?`away`:`online`,theme:`none`,floors:n.length,...t?{agents:{total:6,working:3,waiting:1,idle:2}}:{},...e===`discreet`?{discreet:!0}:{},rev:12,likes:3,sinceMonth:`2026-10`},floors:n,visitors:1}}var S=200,te=s.cmdsPerBatch-1,C=2,w=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function T(e,t){let r=n([...e,...t]),i=r.filter(e=>e.t!==`move`),a=new Set(i.slice(Math.max(0,i.length-te)));return r.filter(e=>e.t===`move`||a.has(e))}var E=class{set=new Set;add(e){return this.set.add(e),()=>void this.set.delete(e)}emit(e){for(let t of[...this.set])try{t(e)}catch(e){console.error(`[world-stream]`,e)}}clear(){this.set.clear()}},D=class{listeners=new E;open;fetchImpl;setT;clearT;now;base;es=null;stream=null;queue=[];flushTimer=null;retryTimer=null;inflight=!1;lastPostAt=-1/0;holdUntil=0;attempts=0;closed=!1;status=`connecting`;constructor(e={}){this.open=e.eventSource??(e=>new EventSource(e)),this.fetchImpl=e.fetch??((e,t)=>fetch(e,t)),this.setT=e.setTimeout??((e,t)=>setTimeout(e,t)),this.clearT=e.clearTimeout??(e=>clearTimeout(e)),this.now=e.now??Date.now,this.base=e.base??`/api/world`,this.connect()}on(e){return this.listeners.add(e)}send(e){!this.closed&&e.length&&(this.queue=T(this.queue,e),this.schedule())}close(){this.closed||(this.closed=!0,this.es?.close(),this.es=null,this.flushTimer&&this.clearT(this.flushTimer),this.retryTimer&&this.clearT(this.retryTimer),this.flushTimer=this.retryTimer=null,this.queue=[],this.setStatus(`closed`),this.listeners.clear())}setStatus(e){this.status!==e&&(this.status=e,this.listeners.emit({type:`status`,status:e}))}connect(){if(this.closed)return;this.stream=null;let e;try{e=this.open(`${this.base}/stream`)}catch{return this.retry()}this.es=e;let t=()=>this.es===e&&!this.closed;e.addEventListener(`world.snapshot`,e=>{if(!t())return;let n=O(e);w(n)&&typeof n.stream==`string`&&Array.isArray(n.chunks)&&Array.isArray(n.players)&&(this.stream=n.stream,this.attempts=0,this.setStatus(`open`),this.listeners.emit({type:`snapshot`,snapshot:n}),this.schedule())}),e.addEventListener(`world`,e=>{if(!t())return;let n=O(e);w(n)&&ee.includes(n.t)&&this.listeners.emit({type:`message`,msg:n})}),e.addEventListener(`error`,()=>{t()&&(this.stream=null,e.readyState===C?(e.close(),this.es=null,this.retry()):this.setStatus(`connecting`))})}retry(){if(this.closed||this.retryTimer)return;this.setStatus(`retrying`);let e=i(this.attempts++);this.retryTimer=this.setT(()=>{this.retryTimer=null,this.setStatus(`connecting`),this.connect()},e)}schedule(){if(this.closed||this.flushTimer||this.inflight||!this.queue.length||!this.stream)return;let e=Math.max(0,this.lastPostAt+200-this.now(),this.holdUntil-this.now());this.flushTimer=this.setT(()=>{this.flushTimer=null,this.flush()},e)}async flush(){let e=this.stream;if(this.closed||!e||!this.queue.length)return;let t=this.queue;this.queue=[],this.inflight=!0,this.lastPostAt=this.now();let n=0,r=`offline`,i=1;try{let a=await this.fetchImpl(`${this.base}/cmd`,{method:`POST`,credentials:`same-origin`,cache:`no-store`,headers:{"Content-Type":`application/json`},body:JSON.stringify({stream:e,cmds:t})});if(n=a.status,!a.ok){let e=await a.json().catch(()=>null);typeof e?.error?.code==`string`&&(r=e.error.code),typeof e?.error?.retryAfter==`number`&&(i=e.error.retryAfter)}}catch{n=0}this.inflight=!1,!this.closed&&(n===429&&r===`rate_limited`?(this.queue=T(t,this.queue),this.holdUntil=this.now()+i*1e3):(n<200||n>=300)&&this.listeners.emit({type:`error`,code:r}),this.schedule())}};function O(e){try{return JSON.parse(String(e.data))}catch{return}}var k=`centro`,A=6e4,ne=3,j=[{},{Beatriz:`waiting`,Larissa:`idle`,Thiago:`shell`},{Beatriz:`working`,Larissa:`idle`,Thiago:`shell`},{Beatriz:`working`,Larissa:`working`,Thiago:`working`}],M={id:`p_voce`,name:`Pixel Dev`,look:`f`,parts:{skin:`#d69f78`,hair:`#2b2530`,hairStyle:`bob`,eyes:`#2f5f9e`,top:`#4a86d8`,topAccent:`#f4f4f0`,topStyle:`hoodie`,bottom:`#2c2c35`,bottomStyle:`pants`,shoes:`#ececec`,accessory:`glasses`,accessoryColor:`#2b2b33`,facialHair:`none`},traits:[`cafeina`,`games`],intro:`night_owl`,country:`BR`,buildingId:`p_voce`},N=3,P=`HB-4F2K`,re=`23456789ABCDEFGHJKMNPQRSTVWXYZ`;function F(e){let t=(Math.imul(e+7,2654435761)>>>0)%30**4,n=``;for(let e=0;e<4;e++)n=re[t%30]+n,t=Math.floor(t/30);let r=`HB-${n}`;return r===`HB-4F2K`?`HB-7777`:r}function I(e){let t=e.trim().toUpperCase().replace(/[\s_]+/g,``),n=t.startsWith(`HB-`)?t.slice(3):t.startsWith(`HB`)&&t.length===6?t.slice(2):t;return/^[2-9A-HJKMNP-TV-Z]{4}$/.test(n)?`HB-${n}`:null}var L={hello:`nice_to_meet`,wave:`hello`,nice_building:`thanks`,congrats:`thanks`,clap:`thanks`,good_luck:`thanks`,coffee:`coffee`,bye:`bye`,thanks:`clap`,nice_to_meet:`wave`},R=[[`Ana Pixel`,`BR`],[`Bruno Byte`,`PT`],[`Camille Code`,`FR`],[`Diego Deploy`,`MX`],[`Emma Stack`,`US`],[`Felipe Fork`,`AR`],[`Gabi Git`,`BR`],[`Hiro Hash`,`JP`],[`Inês Infra`,`ES`],[`Jonas Json`,`DE`],[`Kai Kernel`,`CA`],[`Lia Lambda`,`IT`],[`Marco Merge`,`CL`],[`Nina Node`,`CO`],[`Oscar Ops`,`GB`],[`Priya Patch`,`IN`],[`Quim Query`,void 0],[`Rosa Regex`,`BR`],[`Sami Shell`,`KR`],[`Téo Test`,`PT`]],z=[2,6,13,4,9,3,16,5,0,11,4,7,2,20,8,3,12,1,6,10],B=[`none`,`halloween`,`none`,`christmas`,`none`,`halloween`],V=[[`games`,`piadas`],[`leitura`,`calma`],[`competicao`,`esporte`,`cafeina`],[`series`,`fofoca`],[`esporte`,`cafeina`],[`timidez`,`leitura`]],H=[`coffee`,`tabs`,`pixel_art`,`cats`,`ship_fast`,`music`],U=[{name:`Luna Loop`,look:`f`,block:{x:1,y:0},cw:!0,speed:3,phase:12,owns:1},{name:`Max Merge`,look:`m`,block:{x:1,y:0},cw:!1,speed:3.2,phase:70},{name:`Zoe Zip`,look:`f`,block:{x:0,y:0},cw:!0,speed:2.9,phase:40,owns:7},{name:`Rafa Runtime`,look:`m`,block:{x:1,y:1},cw:!1,speed:3.1,phase:110},{name:`Yuki Yarn`,look:`f`,block:{x:0,y:1},cw:!0,speed:5.6,phase:25,owns:13}],W={name:`Ravi Repo`,look:`m`},G=[`BR`,`US`,`FR`,`ES`,`JP`,`IN`];function K(e){let t=_(e),n=t.x-1,i=t.y-1,a=t.x+r.w+1,o=t.y+r.h+1;return{x0:n,y0:i,x1:a,y1:o,length:2*(a-n+(o-i))}}function q(e,t,n){let r=K(e),i=r.x1-r.x0,a=r.y1-r.y0,o=((n?t:-t)%r.length+r.length)%r.length,s=e=>Math.round(e*100)/100,c=(e,t,r,i)=>({x:s(e),y:s(t),dir:n?r:i,moving:!0});return o<i?c(r.x0+o,r.y0,`e`,`w`):(o-=i,o<a?c(r.x1,r.y0+o,`s`,`n`):(o-=a,o<i?c(r.x1-o,r.y1,`w`,`e`):(o-=i,c(r.x0,r.y1-o,`n`,`s`))))}function J(){let e=_(g);return{x:e.x+u.x+u.w/2+5,y:e.y+u.y+u.h+2+.85}}function Y(){return d(Z(4)[N]).front}var ie=(e,t)=>v(k,c(p(e,t)));function X(e){let t=new Date(e),n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),r=n-(new Date(n).getUTCDay()+6)%7*864e5;return{id:`${new Date(r).toISOString().slice(0,10)}:agent_hours_10k`,label:`agent_hours_10k`,target:1e4,progress:8e3,until:r+6048e5}}function Z(e){let t=[];for(let n of h()){if(t.length>=e)break;t.push(n)}return t}function Q(e=20){let n=t(12680215),r=Math.max(1,Math.min(2e3,Math.floor(e))),i=new Map;return U.forEach((e,t)=>e.owns!==void 0&&i.set(e.owns,t)),Z(r).map((e,t)=>{let a=t===N,[o,s]=R[t%R.length],c=i.get(t),l=a?4:z[t%z.length],u=Math.max(1,Math.round(l*(1+n()*1.5))),d=Math.round(u*n()),f=Math.min(u-d,n()<.4?1+Math.floor(n()*2):0),p=!a&&(t%7==5||t%11==9),m=!a&&t%9==7,h=a?M.id:c===void 0?`b_${t.toString(36).padStart(3,`0`)}`:`p_${c+1}`,g=a?{id:h,name:M.name,country:M.country}:c===void 0?{id:h,name:r>R.length?`${o} ${Math.floor(t/R.length)+1}`:o,...s?{country:s}:{}}:{id:h,name:U[c].name,country:G[c]},_={id:h,lot:{district:k,x:e.x,y:e.y},owner:g,state:p?`away`:`online`,theme:a?`halloween`:B[t%B.length],floors:l,rev:1,likes:Math.floor(n()*240),sinceMonth:`2026-${String(8+t%3).padStart(2,`0`)}`};return m||(_.agents={total:u,working:d,waiting:f,idle:u-d-f}),t%4!=1&&(_.tokens={day:t%5,week:Math.min(5,t%5+1)}),t%8==6&&(_.closed=!0),_.code=a?P:F(t),(t%3==1||t===4)&&(_.knocks=!0),t===10&&(_.unverified=!0),_})}var $=class{listeners=new E;now;start;buildings;revs=new Map;walkers;me;viewing=!0;closed=!1;ticks=0;lastMoveAt;afkSent=!1;timer=null;pending=[];inside=null;later=[];social=t(5292449);memory;summarySeen=!1;hidden=new Set;stamped=new Set;greetedMe=new Map;goal;constructor(e={}){this.now=e.now??Date.now,this.start=this.now(),this.lastMoveAt=this.start,this.buildings=Q(e.buildings??20);for(let e of this.buildings)this.revs.set(this.chunkOfBuilding(e),1);let n=this.buildings.find(e=>e.id===M.id),r=n?d(n.lot).front:f();this.memory=e.memory;let i=e.memory?.pos;this.me=i?{x:i.x,y:i.y,dir:i.dir,moving:!1}:{x:r.x,y:r.y,dir:`s`,moving:!1},this.goal=X(this.start);let o=t(40474),s=(e,t,n,r)=>{let i=U[e]?.owns,s=`p_${e+1}`;return{id:s,name:t,...e===3?{}:{country:G[e]},look:n,parts:a(1e3+e*97,void 0,n),traits:[...V[e%V.length]],intro:H[e%H.length],...i!==void 0&&i<this.buildings.length?{buildingId:s}:{},likesReceived:Math.floor(o()*60),pos:r,where:`street`}};this.walkers=U.map((e,t)=>s(t,e.name,e.look,q(e.block,e.phase,e.cw)));let c=J();this.walkers.push(s(U.length,W.name,W.look,{x:c.x,y:c.y,dir:`s`,moving:!1})),e.autoplay!==!1&&(this.timer=setInterval(()=>this.tick(),200))}on(e){let t=this.listeners.add(e);return Promise.resolve().then(()=>{this.closed||(e({type:`status`,status:`open`}),e({type:`snapshot`,snapshot:this.snapshot()}))}),t}snapshot(){let e=new Map;for(let t of this.buildings){let n=this.chunkOfBuilding(t);e.has(n)||e.set(n,[]),e.get(n).push(t)}return structuredClone({stream:`fake`,connected:!0,viewing:this.viewing,district:k,me:M,pos:this.me,afk:this.afkSent,chunks:this.viewing?[...e.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({chunk:e,rev:this.revs.get(e)??1,buildings:t})):[],players:this.viewing&&!this.inside?this.walkers.filter(e=>!this.hidden.has(e.id)):[],minimap:this.viewing?this.minimap():null,...this.inside?{inside:{id:this.inside.id,rev:this.inside.rev,detail:this.inside.detail}}:{},...this.viewing?{city:this.cityStatus()}:{},likesToday:3,...this.summarySeen?{}:{summary:structuredClone(y)}})}cityStatus(){return{lit:this.buildings.filter(e=>e.state===`online`).length,goal:{...this.goal},tokensBand:4}}celebrate(){if(this.closed)return;let e=this.goal;this.emit({t:`city.fireworks`,goalId:e.id});let t=e.label===`agent_hours_10k`?`agent_hours_50k`:`agent_hours_100k`,n=t===`agent_hours_50k`?5e4:1e5;this.goal={id:e.id.replace(e.label,t),label:t,target:n,progress:Math.max(e.target,e.progress),until:e.until},this.emit({t:`city`,...this.cityStatus()})}send(e){if(!this.closed)for(let t of n(e))this.command(t)}close(){this.closed||(this.remember(),this.closed=!0,this.timer&&clearInterval(this.timer),this.timer=null,this.listeners.emit({type:`status`,status:`closed`}),this.listeners.clear())}remember(){this.memory&&(this.memory.pos={x:this.me.x,y:this.me.y,dir:this.me.dir,moving:!1})}tick(){if(this.closed)return;this.ticks++;let e=this.pending;this.pending=[];for(let t of e)this.emit(t);if(!this.viewing)return;if(this.inside){this.ticks%15==0&&this.patchInside();return}let t=this.now(),n=this.later.filter(e=>e.at<=t);if(n.length){this.later=this.later.filter(e=>e.at>t);for(let e of n)this.emit(e.msg)}let r=(t-this.start)/1e3,i=new Map;U.forEach((e,t)=>{let n=this.walkers[t];if(n.pos=q(e.block,e.phase+e.speed*r,e.cw),this.hidden.has(n.id))return;let a=ie(n.pos.x,n.pos.y);i.has(a)||i.set(a,[]),i.get(a).push({id:n.id,pos:{...n.pos}})});for(let[e,t]of i)this.emit({t:`players`,chunk:e,players:t});this.ticks%15==0&&this.changeBuilding(this.ticks/15),this.ticks%300==0&&this.emit({t:`minimap`,blocks:this.minimap()}),this.ticks%300==0&&(this.goal={...this.goal,progress:Math.min(this.goal.target-1,this.goal.progress+7)},this.emit({t:`city`,...this.cityStatus()})),this.ticks%25==0&&this.botsGreet(t),!this.afkSent&&t-this.lastMoveAt>=A&&(this.afkSent=!0,this.emit({t:`afk`}))}botsGreet(e){let t=this.walkers.filter(e=>!this.hidden.has(e.id));if(t.length>=2){let n=t[Math.floor(this.social()*t.length)],r=t.filter(e=>e!==n).sort((e,t)=>Math.hypot(e.pos.x-n.pos.x,e.pos.y-n.pos.y)-Math.hypot(t.pos.x-n.pos.x,t.pos.y-n.pos.y))[0],i=m[Math.floor(this.social()*m.length)];this.emit({t:`greeting`,from:n.id,to:r.id,greetingId:i,until:e+5e3}),this.later.push({at:e+1600,msg:{t:`greeting`,from:r.id,to:n.id,greetingId:L[i],until:e+6600}})}for(let n of t){if(Math.hypot(n.pos.x-this.me.x,n.pos.y-this.me.y)>7||e-(this.greetedMe.get(n.id)??-1/0)<3e4||this.social()<.5)continue;this.greetedMe.set(n.id,e);let t=this.social()<.5?`hello`:`wave`;this.emit({t:`greeting`,from:n.id,to:M.id,greetingId:t,until:e+5e3});break}}changeBuilding(e){let t=this.buildings[e*7%this.buildings.length];if(!t.agents||t.state!==`online`)return;let n=e%4==0&&t.agents.working>0?0:(t.agents.working+1)%(t.agents.total+1),r=Math.min(t.agents.total-n,e%2);t.agents={total:t.agents.total,working:n,waiting:r,idle:t.agents.total-n-r},e%3==0&&t.likes++,t.rev++;let i=this.chunkOfBuilding(t),a=(this.revs.get(i)??1)+1;this.revs.set(i,a),this.emit({t:`area.patch`,chunk:i,rev:a,changes:[{id:t.id,agents:{...t.agents},likes:t.likes,rev:t.rev}]})}command(e){switch(e.t){case`move`:{let t=Math.hypot(e.x-this.me.x,e.y-this.me.y)>6;if(!l(e.x,e.y,()=>!0)||t){this.pending.push({t:`pos`,x:this.me.x,y:this.me.y});return}let n=e.x!==this.me.x||e.y!==this.me.y||e.dir!==this.me.dir||e.moving!==this.me.moving;this.me={x:e.x,y:e.y,dir:e.dir,moving:e.moving},n&&(this.lastMoveAt=this.now(),this.afkSent=!1);return}case`profile`:{let t=this.walkers.find(t=>t.id===e.playerId);this.pending.push(t?{t:`profile`,player:structuredClone(t)}:{t:`notice`,level:`info`,text:`not_found`});return}case`like`:case`unlike`:{let t=this.near(e.buildingId,4);if(typeof t==`string`)return void this.pending.push({t:`notice`,level:`warn`,text:t});let n=e.t===`like`;!!t.likedByMe!==n&&(t.likes+=n?1:-1),t.likedByMe=n,this.pending.push({t:`like.update`,buildingId:t.id,likes:t.likes,likedByMe:n}),this.inside?.id===t.id&&Object.assign(this.inside.detail.building,{likes:t.likes,likedByMe:n});return}case`greet`:{if(!this.walkers.find(t=>t.id===e.playerId&&!this.hidden.has(t.id)))return void this.pending.push({t:`notice`,level:`info`,text:`not_found`});let t=this.now();this.pending.push({t:`greeting`,from:M.id,to:e.playerId,greetingId:e.greetingId,until:t+5e3}),this.later.push({at:t+1200,msg:{t:`greeting`,from:e.playerId,to:M.id,greetingId:L[e.greetingId]??`wave`,until:t+6200}});return}case`stamp`:{let t=this.near(e.buildingId,2);if(typeof t==`string`)return void this.pending.push({t:`notice`,level:`warn`,text:t});if(this.stamped.has(t.id))return void this.pending.push({t:`notice`,level:`info`,text:`already_done`});this.stamped.add(t.id),this.pending.push({t:`notice`,level:`info`,text:`stamped`});return}case`knock`:{let t=this.near(e.buildingId,2);typeof t==`string`&&this.pending.push({t:`notice`,level:`warn`,text:t});return}case`teleport`:{let t=e.code===void 0?null:I(e.code),n;if(e.code!==void 0)n=t?this.buildings.find(e=>e.code===t&&!this.hidden.has(e.id)):void 0;else{let e=this.buildings.filter(e=>e.state===`online`&&e.id!==M.id&&!this.hidden.has(e.id));n=e[Math.floor(this.social()*e.length)]}if(!n)return void this.pending.push({t:`notice`,level:`info`,text:`not_found`});let r=d(n.lot);this.me={x:r.front.x,y:r.front.y,dir:r.side,moving:!1},this.lastMoveAt=this.now(),this.afkSent=!1,this.pending.push({t:`pos`,x:r.front.x,y:r.front.y});for(let e of this.snapshot().chunks)this.pending.push({t:`area`,chunk:e.chunk,rev:e.rev,buildings:e.buildings});return}case`block`:{let t=this.walkers.find(t=>t.id===e.playerId);if(!t)return void this.pending.push({t:`notice`,level:`info`,text:`not_found`});this.hidden.add(t.id),this.pending.push({t:`player.leave`,id:t.id},{t:`notice`,level:`info`,text:`blocked_ok`});return}case`unblock`:{let t=this.walkers.find(t=>t.id===e.playerId);if(!t||!this.hidden.delete(t.id))return;this.pending.push({t:`player.join`,player:structuredClone(t)});return}case`resync`:for(let t of this.snapshot().chunks)(e.chunk===void 0||t.chunk===e.chunk)&&this.pending.push({t:`area`,chunk:t.chunk,rev:t.rev,buildings:t.buildings});return;case`view`:this.viewing=!0,Promise.resolve().then(()=>!this.closed&&this.listeners.emit({type:`snapshot`,snapshot:this.snapshot()}));return;case`view.off`:this.remember(),this.viewing=!1,this.inside=null;return;case`enter`:this.enter(e.buildingId);return;case`leave`:{let e=this.inside?this.buildings.find(e=>e.id===this.inside.id):void 0;if(this.inside=null,e){let t=d(e.lot);this.me={x:t.front.x,y:t.front.y,dir:t.side===`s`?`s`:`n`,moving:!1}}this.lastMoveAt=this.now(),this.pending.push({t:`pos`,x:this.me.x,y:this.me.y});for(let e of this.snapshot().chunks)this.pending.push({t:`area`,chunk:e.chunk,rev:e.rev,buildings:e.buildings});return}default:e.t===`report`&&this.pending.push({t:`notice`,level:`info`,text:`reported`}),e.t===`summary.seen`&&(this.summarySeen=!0);return}}enter(e){let t=this.buildings.find(t=>t.id===e);if(!t){this.pending.push({t:`notice`,level:`info`,text:`not_found`});return}let n=t.id===M.id,r=d(t.lot).front;if(!n&&Math.hypot(this.me.x-r.x,this.me.y-r.y)>ne){this.pending.push({t:`notice`,level:`info`,text:`too_far`});return}if(!n&&t.closed){this.pending.push({t:`notice`,level:`info`,text:`closed`});return}let i=t.state===`away`?`away`:t.agents?`live`:`discreet`,a=x(i),{agents:o,...s}=t;a.building={...s,...a.building.agents?{agents:a.building.agents}:{},floors:a.floors.length,...i===`discreet`?{discreet:!0}:{}},a.visitors=n?0:2,this.inside={id:t.id,rev:1,detail:a,patches:0},this.pending.push({t:`building`,rev:1,detail:structuredClone(a)})}patchInside(){let e=this.inside;if(!e)return;if(e.patches++,e.patches%4==0){e.detail.visitors=e.detail.visitors>=3?2:e.detail.visitors+1,e.rev++,this.emit({t:`building.patch`,rev:e.rev,visitors:e.detail.visitors});return}if(e.detail.building.state!==`online`||e.detail.building.discreet)return;let t=j[e.patches%j.length];for(let n of e.detail.floors)for(let e of n.agents)t[e.name]&&(e.status=t[e.name]);e.rev++,this.emit({t:`building.patch`,rev:e.rev,floors:structuredClone(e.detail.floors)})}near(e,t){if(e===M.id)return`invalid`;let n=this.buildings.find(t=>t.id===e);if(!n)return`not_found`;if(this.inside?.id===e)return n;let r=d(n.lot).front;return Math.hypot(r.x-this.me.x,r.y-this.me.y)<=t+1e-9?n:`too_far`}emit(e){this.listeners.emit({type:`message`,msg:structuredClone(e)})}chunkOfBuilding(e){return v(k,c(o(e.lot)))}minimap(){let e=new Map;for(let t of this.buildings){let n=o(t.lot),r=`${n.x},${n.y}`;e.has(r)||e.set(r,{x:n.x,y:n.y,lit:0}),t.state===`online`&&e.get(r).lit++}return[...e.values()].sort((e,t)=>e.y-t.y||e.x-t.x)}};function ae(e){return e.mock?new $(e):new D(e)}export{S as CMD_BATCH_MS,M as FAKE_ME,P as FAKE_MY_CODE,$ as FakeWorldStream,D as HttpWorldStream,ae as createWorldStream,T as enqueueCommands,J as fakeBenchSeat,F as fakeBuildingCode,Q as fakeCityBuildings,X as fakeGoal,Y as fakeMyDoor,q as loopPosition};
|
|
1
|
+
import{c as e,l as t}from"./simulator-DeHOlOye.js";import{J as n,Q as r,Qt as i,Wt as a,at as o,bt as s,ct as c,dt as l,et as u,ft as d,gt as f,it as p,kt as m,mt as h,nt as g,ot as _,st as v,xt as ee}from"./world-model-C3GVcyT7.js";import{f as y}from"./app-B_jk_lPZ.js";function b(t,n,r,i,o,s,c){return{id:t,kind:i,...c?{parentId:c}:{},provider:o,status:s,look:r,name:n,parts:a(e(t),void 0,r)}}function x(e=`live`){let t=e===`live`,n=[{id:`f_0a1b2c3d4e`,label:`ipe`,agents:[b(`a_1f2e3d4c`,`Marina`,`f`,`main`,`claude`,`working`),b(`a_2a3b4c5d`,`Rafael`,`m`,`sub`,`claude`,`working`,`a_1f2e3d4c`)]},{id:`f_1b2c3d4e5f`,label:`jade`,agents:[b(`a_3c4d5e6f`,`Beatriz`,`f`,`main`,`codex`,`waiting`),b(`a_4d5e6f70`,`Thiago`,`m`,`sub`,`codex`,`shell`)]},{id:`f_2c3d4e5f60`,label:`aurora`,agents:[b(`a_5e6f7081`,`Larissa`,`f`,`main`,`claude`,`idle`),b(`a_6f708192`,`Gustavo`,`m`,`main`,`codex`,`idle`)]}].map(e=>t?e:{...e,agents:[]});return{building:{id:`o_7a8b9c0d1e2f`,lot:{district:`centro`,x:3,y:5},owner:{id:`o_7a8b9c0d1e2f`,name:`Helena`,country:`BR`},state:e===`away`?`away`:`online`,theme:`none`,floors:n.length,...t?{agents:{total:6,working:3,waiting:1,idle:2}}:{},...e===`discreet`?{discreet:!0}:{},rev:12,likes:3,sinceMonth:`2026-10`},floors:n,visitors:1}}var S=200,te=s.cmdsPerBatch-1,C=2,w=e=>!!e&&typeof e==`object`&&!Array.isArray(e);function T(e,t){let r=n([...e,...t]),i=r.filter(e=>e.t!==`move`),a=new Set(i.slice(Math.max(0,i.length-te)));return r.filter(e=>e.t===`move`||a.has(e))}var E=class{set=new Set;add(e){return this.set.add(e),()=>void this.set.delete(e)}emit(e){for(let t of[...this.set])try{t(e)}catch(e){console.error(`[world-stream]`,e)}}clear(){this.set.clear()}},D=class{listeners=new E;open;fetchImpl;setT;clearT;now;base;es=null;stream=null;queue=[];flushTimer=null;retryTimer=null;inflight=!1;lastPostAt=-1/0;holdUntil=0;attempts=0;closed=!1;status=`connecting`;constructor(e={}){this.open=e.eventSource??(e=>new EventSource(e)),this.fetchImpl=e.fetch??((e,t)=>fetch(e,t)),this.setT=e.setTimeout??((e,t)=>setTimeout(e,t)),this.clearT=e.clearTimeout??(e=>clearTimeout(e)),this.now=e.now??Date.now,this.base=e.base??`/api/world`,this.connect()}on(e){return this.listeners.add(e)}send(e){!this.closed&&e.length&&(this.queue=T(this.queue,e),this.schedule())}close(){this.closed||(this.closed=!0,this.es?.close(),this.es=null,this.flushTimer&&this.clearT(this.flushTimer),this.retryTimer&&this.clearT(this.retryTimer),this.flushTimer=this.retryTimer=null,this.queue=[],this.setStatus(`closed`),this.listeners.clear())}setStatus(e){this.status!==e&&(this.status=e,this.listeners.emit({type:`status`,status:e}))}connect(){if(this.closed)return;this.stream=null;let e;try{e=this.open(`${this.base}/stream`)}catch{return this.retry()}this.es=e;let t=()=>this.es===e&&!this.closed;e.addEventListener(`world.snapshot`,e=>{if(!t())return;let n=O(e);w(n)&&typeof n.stream==`string`&&Array.isArray(n.chunks)&&Array.isArray(n.players)&&(this.stream=n.stream,this.attempts=0,this.setStatus(`open`),this.listeners.emit({type:`snapshot`,snapshot:n}),this.schedule())}),e.addEventListener(`world`,e=>{if(!t())return;let n=O(e);w(n)&&ee.includes(n.t)&&this.listeners.emit({type:`message`,msg:n})}),e.addEventListener(`error`,()=>{t()&&(this.stream=null,e.readyState===C?(e.close(),this.es=null,this.retry()):this.setStatus(`connecting`))})}retry(){if(this.closed||this.retryTimer)return;this.setStatus(`retrying`);let e=i(this.attempts++);this.retryTimer=this.setT(()=>{this.retryTimer=null,this.setStatus(`connecting`),this.connect()},e)}schedule(){if(this.closed||this.flushTimer||this.inflight||!this.queue.length||!this.stream)return;let e=Math.max(0,this.lastPostAt+200-this.now(),this.holdUntil-this.now());this.flushTimer=this.setT(()=>{this.flushTimer=null,this.flush()},e)}async flush(){let e=this.stream;if(this.closed||!e||!this.queue.length)return;let t=this.queue;this.queue=[],this.inflight=!0,this.lastPostAt=this.now();let n=0,r=`offline`,i=1;try{let a=await this.fetchImpl(`${this.base}/cmd`,{method:`POST`,credentials:`same-origin`,cache:`no-store`,headers:{"Content-Type":`application/json`},body:JSON.stringify({stream:e,cmds:t})});if(n=a.status,!a.ok){let e=await a.json().catch(()=>null);typeof e?.error?.code==`string`&&(r=e.error.code),typeof e?.error?.retryAfter==`number`&&(i=e.error.retryAfter)}}catch{n=0}this.inflight=!1,!this.closed&&(n===429&&r===`rate_limited`?(this.queue=T(t,this.queue),this.holdUntil=this.now()+i*1e3):(n<200||n>=300)&&this.listeners.emit({type:`error`,code:r}),this.schedule())}};function O(e){try{return JSON.parse(String(e.data))}catch{return}}var k=`centro`,A=6e4,ne=3,j=[{},{Beatriz:`waiting`,Larissa:`idle`,Thiago:`shell`},{Beatriz:`working`,Larissa:`idle`,Thiago:`shell`},{Beatriz:`working`,Larissa:`working`,Thiago:`working`}],M={id:`p_voce`,name:`Pixel Dev`,look:`f`,parts:{skin:`#d69f78`,hair:`#2b2530`,hairStyle:`bob`,eyes:`#2f5f9e`,top:`#4a86d8`,topAccent:`#f4f4f0`,topStyle:`hoodie`,bottom:`#2c2c35`,bottomStyle:`pants`,shoes:`#ececec`,accessory:`glasses`,accessoryColor:`#2b2b33`,facialHair:`none`},traits:[`cafeina`,`games`],intro:`night_owl`,country:`BR`,buildingId:`p_voce`},N=3,P=`HB-4F2K`,re=`23456789ABCDEFGHJKMNPQRSTVWXYZ`;function F(e){let t=(Math.imul(e+7,2654435761)>>>0)%30**4,n=``;for(let e=0;e<4;e++)n=re[t%30]+n,t=Math.floor(t/30);let r=`HB-${n}`;return r===`HB-4F2K`?`HB-7777`:r}function I(e){let t=e.trim().toUpperCase().replace(/[\s_]+/g,``),n=t.startsWith(`HB-`)?t.slice(3):t.startsWith(`HB`)&&t.length===6?t.slice(2):t;return/^[2-9A-HJKMNP-TV-Z]{4}$/.test(n)?`HB-${n}`:null}var L={hello:`nice_to_meet`,wave:`hello`,nice_building:`thanks`,congrats:`thanks`,clap:`thanks`,good_luck:`thanks`,coffee:`coffee`,bye:`bye`,thanks:`clap`,nice_to_meet:`wave`},R=[[`Ana Pixel`,`BR`],[`Bruno Byte`,`PT`],[`Camille Code`,`FR`],[`Diego Deploy`,`MX`],[`Emma Stack`,`US`],[`Felipe Fork`,`AR`],[`Gabi Git`,`BR`],[`Hiro Hash`,`JP`],[`Inês Infra`,`ES`],[`Jonas Json`,`DE`],[`Kai Kernel`,`CA`],[`Lia Lambda`,`IT`],[`Marco Merge`,`CL`],[`Nina Node`,`CO`],[`Oscar Ops`,`GB`],[`Priya Patch`,`IN`],[`Quim Query`,void 0],[`Rosa Regex`,`BR`],[`Sami Shell`,`KR`],[`Téo Test`,`PT`]],z=[2,6,13,4,9,3,16,5,0,11,4,7,2,20,8,3,12,1,6,10],B=[`none`,`halloween`,`none`,`christmas`,`none`,`halloween`],V=[[`games`,`piadas`],[`leitura`,`calma`],[`competicao`,`esporte`,`cafeina`],[`series`,`fofoca`],[`esporte`,`cafeina`],[`timidez`,`leitura`]],H=[`coffee`,`tabs`,`pixel_art`,`cats`,`ship_fast`,`music`],U=[{name:`Luna Loop`,look:`f`,block:{x:1,y:0},cw:!0,speed:3,phase:12,owns:1},{name:`Max Merge`,look:`m`,block:{x:1,y:0},cw:!1,speed:3.2,phase:70},{name:`Zoe Zip`,look:`f`,block:{x:0,y:0},cw:!0,speed:2.9,phase:40,owns:7},{name:`Rafa Runtime`,look:`m`,block:{x:1,y:1},cw:!1,speed:3.1,phase:110},{name:`Yuki Yarn`,look:`f`,block:{x:0,y:1},cw:!0,speed:5.6,phase:25,owns:13}],W={name:`Ravi Repo`,look:`m`},G=[`BR`,`US`,`FR`,`ES`,`JP`,`IN`];function K(e){let t=_(e),n=t.x-1,i=t.y-1,a=t.x+r.w+1,o=t.y+r.h+1;return{x0:n,y0:i,x1:a,y1:o,length:2*(a-n+(o-i))}}function q(e,t,n){let r=K(e),i=r.x1-r.x0,a=r.y1-r.y0,o=((n?t:-t)%r.length+r.length)%r.length,s=e=>Math.round(e*100)/100,c=(e,t,r,i)=>({x:s(e),y:s(t),dir:n?r:i,moving:!0});return o<i?c(r.x0+o,r.y0,`e`,`w`):(o-=i,o<a?c(r.x1,r.y0+o,`s`,`n`):(o-=a,o<i?c(r.x1-o,r.y1,`w`,`e`):(o-=i,c(r.x0,r.y1-o,`n`,`s`))))}function J(){let e=_(g);return{x:e.x+u.x+u.w/2+5,y:e.y+u.y+u.h+2+.85}}function Y(){return d(Z(4)[N]).front}var ie=(e,t)=>v(k,c(p(e,t)));function X(e){let t=new Date(e),n=Date.UTC(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()),r=n-(new Date(n).getUTCDay()+6)%7*864e5;return{id:`${new Date(r).toISOString().slice(0,10)}:agent_hours_10k`,label:`agent_hours_10k`,target:1e4,progress:8e3,until:r+6048e5}}function Z(e){let t=[];for(let n of h()){if(t.length>=e)break;t.push(n)}return t}function Q(e=20){let n=t(12680215),r=Math.max(1,Math.min(2e3,Math.floor(e))),i=new Map;return U.forEach((e,t)=>e.owns!==void 0&&i.set(e.owns,t)),Z(r).map((e,t)=>{let a=t===N,[o,s]=R[t%R.length],c=i.get(t),l=a?4:z[t%z.length],u=Math.max(1,Math.round(l*(1+n()*1.5))),d=Math.round(u*n()),f=Math.min(u-d,n()<.4?1+Math.floor(n()*2):0),p=!a&&(t%7==5||t%11==9),m=!a&&t%9==7,h=a?M.id:c===void 0?`b_${t.toString(36).padStart(3,`0`)}`:`p_${c+1}`,g=a?{id:h,name:M.name,country:M.country}:c===void 0?{id:h,name:r>R.length?`${o} ${Math.floor(t/R.length)+1}`:o,...s?{country:s}:{}}:{id:h,name:U[c].name,country:G[c]},_={id:h,lot:{district:k,x:e.x,y:e.y},owner:g,state:p?`away`:`online`,theme:a?`halloween`:B[t%B.length],floors:l,rev:1,likes:Math.floor(n()*240),sinceMonth:`2026-${String(8+t%3).padStart(2,`0`)}`};return m||(_.agents={total:u,working:d,waiting:f,idle:u-d-f}),t%4!=1&&(_.tokens={day:t%5,week:Math.min(5,t%5+1)}),t%8==6&&(_.closed=!0),_.code=a?P:F(t),(t%3==1||t===4)&&(_.knocks=!0),t===10&&(_.unverified=!0),_})}var $=class{listeners=new E;now;start;buildings;revs=new Map;walkers;me;viewing=!0;closed=!1;ticks=0;lastMoveAt;afkSent=!1;timer=null;pending=[];inside=null;later=[];social=t(5292449);memory;summarySeen=!1;hidden=new Set;stamped=new Set;greetedMe=new Map;goal;constructor(e={}){this.now=e.now??Date.now,this.start=this.now(),this.lastMoveAt=this.start,this.buildings=Q(e.buildings??20);for(let e of this.buildings)this.revs.set(this.chunkOfBuilding(e),1);let n=this.buildings.find(e=>e.id===M.id),r=n?d(n.lot).front:f();this.memory=e.memory;let i=e.memory?.pos;this.me=i?{x:i.x,y:i.y,dir:i.dir,moving:!1}:{x:r.x,y:r.y,dir:`s`,moving:!1},this.goal=X(this.start);let o=t(40474),s=(e,t,n,r)=>{let i=U[e]?.owns,s=`p_${e+1}`;return{id:s,name:t,...e===3?{}:{country:G[e]},look:n,parts:a(1e3+e*97,void 0,n),traits:[...V[e%V.length]],intro:H[e%H.length],...i!==void 0&&i<this.buildings.length?{buildingId:s}:{},likesReceived:Math.floor(o()*60),pos:r,where:`street`}};this.walkers=U.map((e,t)=>s(t,e.name,e.look,q(e.block,e.phase,e.cw)));let c=J();this.walkers.push(s(U.length,W.name,W.look,{x:c.x,y:c.y,dir:`s`,moving:!1})),e.autoplay!==!1&&(this.timer=setInterval(()=>this.tick(),200))}on(e){let t=this.listeners.add(e);return Promise.resolve().then(()=>{this.closed||(e({type:`status`,status:`open`}),e({type:`snapshot`,snapshot:this.snapshot()}))}),t}snapshot(){let e=new Map;for(let t of this.buildings){let n=this.chunkOfBuilding(t);e.has(n)||e.set(n,[]),e.get(n).push(t)}return structuredClone({stream:`fake`,connected:!0,viewing:this.viewing,district:k,me:M,pos:this.me,afk:this.afkSent,chunks:this.viewing?[...e.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({chunk:e,rev:this.revs.get(e)??1,buildings:t})):[],players:this.viewing&&!this.inside?this.walkers.filter(e=>!this.hidden.has(e.id)):[],minimap:this.viewing?this.minimap():null,...this.inside?{inside:{id:this.inside.id,rev:this.inside.rev,detail:this.inside.detail}}:{},...this.viewing?{city:this.cityStatus()}:{},likesToday:3,...this.summarySeen?{}:{summary:structuredClone(y)}})}cityStatus(){return{lit:this.buildings.filter(e=>e.state===`online`).length,goal:{...this.goal},tokensBand:4}}celebrate(){if(this.closed)return;let e=this.goal;this.emit({t:`city.fireworks`,goalId:e.id});let t=e.label===`agent_hours_10k`?`agent_hours_50k`:`agent_hours_100k`,n=t===`agent_hours_50k`?5e4:1e5;this.goal={id:e.id.replace(e.label,t),label:t,target:n,progress:Math.max(e.target,e.progress),until:e.until},this.emit({t:`city`,...this.cityStatus()})}send(e){if(!this.closed)for(let t of n(e))this.command(t)}close(){this.closed||(this.remember(),this.closed=!0,this.timer&&clearInterval(this.timer),this.timer=null,this.listeners.emit({type:`status`,status:`closed`}),this.listeners.clear())}remember(){this.memory&&(this.memory.pos={x:this.me.x,y:this.me.y,dir:this.me.dir,moving:!1})}tick(){if(this.closed)return;this.ticks++;let e=this.pending;this.pending=[];for(let t of e)this.emit(t);if(!this.viewing)return;if(this.inside){this.ticks%15==0&&this.patchInside();return}let t=this.now(),n=this.later.filter(e=>e.at<=t);if(n.length){this.later=this.later.filter(e=>e.at>t);for(let e of n)this.emit(e.msg)}let r=(t-this.start)/1e3,i=new Map;U.forEach((e,t)=>{let n=this.walkers[t];if(n.pos=q(e.block,e.phase+e.speed*r,e.cw),this.hidden.has(n.id))return;let a=ie(n.pos.x,n.pos.y);i.has(a)||i.set(a,[]),i.get(a).push({id:n.id,pos:{...n.pos}})});for(let[e,t]of i)this.emit({t:`players`,chunk:e,players:t});this.ticks%15==0&&this.changeBuilding(this.ticks/15),this.ticks%300==0&&this.emit({t:`minimap`,blocks:this.minimap()}),this.ticks%300==0&&(this.goal={...this.goal,progress:Math.min(this.goal.target-1,this.goal.progress+7)},this.emit({t:`city`,...this.cityStatus()})),this.ticks%25==0&&this.botsGreet(t),!this.afkSent&&t-this.lastMoveAt>=A&&(this.afkSent=!0,this.emit({t:`afk`}))}botsGreet(e){let t=this.walkers.filter(e=>!this.hidden.has(e.id));if(t.length>=2){let n=t[Math.floor(this.social()*t.length)],r=t.filter(e=>e!==n).sort((e,t)=>Math.hypot(e.pos.x-n.pos.x,e.pos.y-n.pos.y)-Math.hypot(t.pos.x-n.pos.x,t.pos.y-n.pos.y))[0],i=m[Math.floor(this.social()*m.length)];this.emit({t:`greeting`,from:n.id,to:r.id,greetingId:i,until:e+5e3}),this.later.push({at:e+1600,msg:{t:`greeting`,from:r.id,to:n.id,greetingId:L[i],until:e+6600}})}for(let n of t){if(Math.hypot(n.pos.x-this.me.x,n.pos.y-this.me.y)>7||e-(this.greetedMe.get(n.id)??-1/0)<3e4||this.social()<.5)continue;this.greetedMe.set(n.id,e);let t=this.social()<.5?`hello`:`wave`;this.emit({t:`greeting`,from:n.id,to:M.id,greetingId:t,until:e+5e3});break}}changeBuilding(e){let t=this.buildings[e*7%this.buildings.length];if(!t.agents||t.state!==`online`)return;let n=e%4==0&&t.agents.working>0?0:(t.agents.working+1)%(t.agents.total+1),r=Math.min(t.agents.total-n,e%2);t.agents={total:t.agents.total,working:n,waiting:r,idle:t.agents.total-n-r},e%3==0&&t.likes++,t.rev++;let i=this.chunkOfBuilding(t),a=(this.revs.get(i)??1)+1;this.revs.set(i,a),this.emit({t:`area.patch`,chunk:i,rev:a,changes:[{id:t.id,agents:{...t.agents},likes:t.likes,rev:t.rev}]})}command(e){switch(e.t){case`move`:{let t=Math.hypot(e.x-this.me.x,e.y-this.me.y)>6;if(!l(e.x,e.y,()=>!0)||t){this.pending.push({t:`pos`,x:this.me.x,y:this.me.y});return}let n=e.x!==this.me.x||e.y!==this.me.y||e.dir!==this.me.dir||e.moving!==this.me.moving;this.me={x:e.x,y:e.y,dir:e.dir,moving:e.moving},n&&(this.lastMoveAt=this.now(),this.afkSent=!1);return}case`profile`:{let t=this.walkers.find(t=>t.id===e.playerId);this.pending.push(t?{t:`profile`,player:structuredClone(t)}:{t:`notice`,level:`info`,text:`not_found`});return}case`like`:case`unlike`:{let t=this.near(e.buildingId,4);if(typeof t==`string`)return void this.pending.push({t:`notice`,level:`warn`,text:t});let n=e.t===`like`;!!t.likedByMe!==n&&(t.likes+=n?1:-1),t.likedByMe=n,this.pending.push({t:`like.update`,buildingId:t.id,likes:t.likes,likedByMe:n}),this.inside?.id===t.id&&Object.assign(this.inside.detail.building,{likes:t.likes,likedByMe:n});return}case`greet`:{if(!this.walkers.find(t=>t.id===e.playerId&&!this.hidden.has(t.id)))return void this.pending.push({t:`notice`,level:`info`,text:`not_found`});let t=this.now();this.pending.push({t:`greeting`,from:M.id,to:e.playerId,greetingId:e.greetingId,until:t+5e3}),this.later.push({at:t+1200,msg:{t:`greeting`,from:e.playerId,to:M.id,greetingId:L[e.greetingId]??`wave`,until:t+6200}});return}case`stamp`:{let t=this.near(e.buildingId,2);if(typeof t==`string`)return void this.pending.push({t:`notice`,level:`warn`,text:t});if(this.stamped.has(t.id))return void this.pending.push({t:`notice`,level:`info`,text:`already_done`});this.stamped.add(t.id),this.pending.push({t:`notice`,level:`info`,text:`stamped`});return}case`knock`:{let t=this.near(e.buildingId,2);typeof t==`string`&&this.pending.push({t:`notice`,level:`warn`,text:t});return}case`teleport`:{let t=e.code===void 0?null:I(e.code),n;if(e.code!==void 0)n=t?this.buildings.find(e=>e.code===t&&!this.hidden.has(e.id)):void 0;else{let e=this.buildings.filter(e=>e.state===`online`&&e.id!==M.id&&!this.hidden.has(e.id));n=e[Math.floor(this.social()*e.length)]}if(!n)return void this.pending.push({t:`notice`,level:`info`,text:`not_found`});let r=d(n.lot);this.me={x:r.front.x,y:r.front.y,dir:r.side,moving:!1},this.lastMoveAt=this.now(),this.afkSent=!1,this.pending.push({t:`pos`,x:r.front.x,y:r.front.y});for(let e of this.snapshot().chunks)this.pending.push({t:`area`,chunk:e.chunk,rev:e.rev,buildings:e.buildings});return}case`block`:{let t=this.walkers.find(t=>t.id===e.playerId);if(!t)return void this.pending.push({t:`notice`,level:`info`,text:`not_found`});this.hidden.add(t.id),this.pending.push({t:`player.leave`,id:t.id},{t:`notice`,level:`info`,text:`blocked_ok`});return}case`unblock`:{let t=this.walkers.find(t=>t.id===e.playerId);if(!t||!this.hidden.delete(t.id))return;this.pending.push({t:`player.join`,player:structuredClone(t)});return}case`resync`:for(let t of this.snapshot().chunks)(e.chunk===void 0||t.chunk===e.chunk)&&this.pending.push({t:`area`,chunk:t.chunk,rev:t.rev,buildings:t.buildings});return;case`view`:this.viewing=!0,Promise.resolve().then(()=>!this.closed&&this.listeners.emit({type:`snapshot`,snapshot:this.snapshot()}));return;case`view.off`:this.remember(),this.viewing=!1,this.inside=null;return;case`enter`:this.enter(e.buildingId);return;case`leave`:{let e=this.inside?this.buildings.find(e=>e.id===this.inside.id):void 0;if(this.inside=null,e){let t=d(e.lot);this.me={x:t.front.x,y:t.front.y,dir:t.side===`s`?`s`:`n`,moving:!1}}this.lastMoveAt=this.now(),this.pending.push({t:`pos`,x:this.me.x,y:this.me.y});for(let e of this.snapshot().chunks)this.pending.push({t:`area`,chunk:e.chunk,rev:e.rev,buildings:e.buildings});return}default:e.t===`report`&&this.pending.push({t:`notice`,level:`info`,text:`reported`}),e.t===`summary.seen`&&(this.summarySeen=!0);return}}enter(e){let t=this.buildings.find(t=>t.id===e);if(!t){this.pending.push({t:`notice`,level:`info`,text:`not_found`});return}let n=t.id===M.id,r=d(t.lot).front;if(!n&&Math.hypot(this.me.x-r.x,this.me.y-r.y)>ne){this.pending.push({t:`notice`,level:`info`,text:`too_far`});return}if(!n&&t.closed){this.pending.push({t:`notice`,level:`info`,text:`closed`});return}let i=t.state===`away`?`away`:t.agents?`live`:`discreet`,a=x(i),{agents:o,...s}=t;a.building={...s,...a.building.agents?{agents:a.building.agents}:{},floors:a.floors.length,...i===`discreet`?{discreet:!0}:{}},a.visitors=n?0:2,this.inside={id:t.id,rev:1,detail:a,patches:0},this.pending.push({t:`building`,rev:1,detail:structuredClone(a)})}patchInside(){let e=this.inside;if(!e)return;if(e.patches++,e.patches%4==0){e.detail.visitors=e.detail.visitors>=3?2:e.detail.visitors+1,e.rev++,this.emit({t:`building.patch`,rev:e.rev,visitors:e.detail.visitors});return}if(e.detail.building.state!==`online`||e.detail.building.discreet)return;let t=j[e.patches%j.length];for(let n of e.detail.floors)for(let e of n.agents)t[e.name]&&(e.status=t[e.name]);e.rev++,this.emit({t:`building.patch`,rev:e.rev,floors:structuredClone(e.detail.floors)})}near(e,t){if(e===M.id)return`invalid`;let n=this.buildings.find(t=>t.id===e);if(!n)return`not_found`;if(this.inside?.id===e)return n;let r=d(n.lot).front;return Math.hypot(r.x-this.me.x,r.y-this.me.y)<=t+1e-9?n:`too_far`}emit(e){this.listeners.emit({type:`message`,msg:structuredClone(e)})}chunkOfBuilding(e){return v(k,c(o(e.lot)))}minimap(){let e=new Map;for(let t of this.buildings){let n=o(t.lot),r=`${n.x},${n.y}`;e.has(r)||e.set(r,{x:n.x,y:n.y,lit:0}),t.state===`online`&&e.get(r).lit++}return[...e.values()].sort((e,t)=>e.y-t.y||e.x-t.x)}};function ae(e){return e.mock?new $(e):new D(e)}export{S as CMD_BATCH_MS,M as FAKE_ME,P as FAKE_MY_CODE,$ as FakeWorldStream,D as HttpWorldStream,ae as createWorldStream,T as enqueueCommands,J as fakeBenchSeat,F as fakeBuildingCode,Q as fakeCityBuildings,X as fakeGoal,Y as fakeMyDoor,q as loopPosition};
|
package/dist/client/index.html
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<meta name="apple-mobile-web-app-title" content="Busybits" />
|
|
33
33
|
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
|
34
34
|
<style>html,body{background:#12151d;height:100%;margin:0;overflow:hidden}#world,#city,#visit{width:100vw;height:100vh;image-rendering:pixelated;display:block;position:fixed;inset:0}#world[hidden],#city[hidden],#visit[hidden]{display:none}#ui{pointer-events:none;position:fixed;inset:0}#ui>*{pointer-events:auto}</style>
|
|
35
|
-
<script type="module" crossorigin src="/bundle/main-
|
|
35
|
+
<script type="module" crossorigin src="/bundle/main-7JfOGPBD.js"></script>
|
|
36
36
|
</head>
|
|
37
37
|
<body>
|
|
38
38
|
<canvas id="world"></canvas>
|
package/dist/server/index.js
CHANGED
|
@@ -17,7 +17,7 @@ function applyBusybitsAliases(env) {
|
|
|
17
17
|
applyBusybitsAliases(process.env);
|
|
18
18
|
|
|
19
19
|
// server/index.ts
|
|
20
|
-
import { existsSync as existsSync13, readFileSync as
|
|
20
|
+
import { existsSync as existsSync13, readFileSync as readFileSync31 } from "node:fs";
|
|
21
21
|
import http4 from "node:http";
|
|
22
22
|
import { join as join33 } from "node:path";
|
|
23
23
|
|
|
@@ -3483,12 +3483,21 @@ var EN = {
|
|
|
3483
3483
|
"Dire\xE7\xE3o": "Direction",
|
|
3484
3484
|
"\xE0 direita": "right",
|
|
3485
3485
|
"para baixo": "down",
|
|
3486
|
-
"
|
|
3486
|
+
"Para abrir em abas e pain\xE9is, abra o herdr": "To open in herdr tabs and panes, open herdr",
|
|
3487
3487
|
"O chat do Gentle Shell n\xE3o volta quando o herdr reinicia (veja herdr integration install pi)": "The Gentle Shell chat doesn't come back when herdr restarts (see herdr integration install pi)",
|
|
3488
3488
|
"Nova aba em": "New tab in",
|
|
3489
|
+
"Em uma nova janela de terminal": "In a new terminal window",
|
|
3490
|
+
"Aberto em uma nova janela de terminal.": "Opened in a new terminal window.",
|
|
3491
|
+
"Agente novo aberto numa janela de terminal.": "New agent opened in a terminal window.",
|
|
3492
|
+
"n\xE3o h\xE1 terminal dispon\xEDvel para abrir uma janela": "no terminal is available to open a window",
|
|
3493
|
+
"n\xE3o achei o osascript para abrir o Terminal": "osascript not found to open Terminal",
|
|
3494
|
+
"sem ambiente gr\xE1fico (DISPLAY ou WAYLAND_DISPLAY) para abrir um terminal": "no graphical session (DISPLAY or WAYLAND_DISPLAY) to open a terminal",
|
|
3495
|
+
"n\xE3o achei um terminal (defina $TERMINAL ou instale gnome-terminal, konsole, kitty, alacritty, wezterm, xfce4-terminal ou xterm)": "no terminal found (set $TERMINAL or install gnome-terminal, konsole, kitty, alacritty, wezterm, xfce4-terminal or xterm)",
|
|
3496
|
+
"o pedido ou a pasta tem caracteres (aspas, % ou quebra de linha) que o cmd.exe n\xE3o aceita com seguran\xE7a": "the request or folder has characters (quotes, % or line breaks) that cmd.exe cannot take safely",
|
|
3497
|
+
"o pedido ou a pasta tem caracteres de controle que o Terminal n\xE3o aceita com seguran\xE7a": "the request or folder has control characters that Terminal cannot take safely",
|
|
3489
3498
|
"Dividir painel": "Split pane",
|
|
3490
3499
|
"Onde abrir": "Where to open",
|
|
3491
|
-
|
|
3500
|
+
'Come\xE7a na hora uma sess\xE3o nova no computador, na pasta, com a ferramenta e no lugar escolhidos; as permiss\xF5es chegam aqui. Em segundo plano, pasta que o Claude Code ainda n\xE3o conhece abre no app do Claude e espera o Enter l\xE1. Sem herdr, "Em uma nova janela de terminal" abre o terminal do computador j\xE1 com a ferramenta rodando. Anexos v\xE3o para ~/.habblaud/attachments e o pedido leva os caminhos.': `Instantly starts a new session on the computer, in the chosen folder, tool and place; permissions come here. In the background, a folder Claude Code doesn't know yet opens in the Claude app and waits for Enter there. Without herdr, "In a new terminal window" opens the computer's terminal with the tool already running. Attachments go to ~/.habblaud/attachments and the request includes their paths.`,
|
|
3492
3501
|
"Escolha onde abrir.": "Choose where to open.",
|
|
3493
3502
|
"Aberto no herdr (painel {0}).": "Opened in herdr (pane {0}).",
|
|
3494
3503
|
"Agente novo aberto no herdr.": "New agent opened in herdr.",
|
|
@@ -7198,12 +7207,21 @@ var ES = {
|
|
|
7198
7207
|
"Dire\xE7\xE3o": "Direcci\xF3n",
|
|
7199
7208
|
"\xE0 direita": "a la derecha",
|
|
7200
7209
|
"para baixo": "hacia abajo",
|
|
7201
|
-
"
|
|
7210
|
+
"Para abrir em abas e pain\xE9is, abra o herdr": "Para abrir en pesta\xF1as y paneles, abre herdr",
|
|
7202
7211
|
"O chat do Gentle Shell n\xE3o volta quando o herdr reinicia (veja herdr integration install pi)": "El chat de Gentle Shell no vuelve cuando herdr se reinicia (ver herdr integration install pi)",
|
|
7203
7212
|
"Nova aba em": "Pesta\xF1a nueva en",
|
|
7213
|
+
"Em uma nova janela de terminal": "En una ventana de terminal nueva",
|
|
7214
|
+
"Aberto em uma nova janela de terminal.": "Abierto en una ventana de terminal nueva.",
|
|
7215
|
+
"Agente novo aberto numa janela de terminal.": "Agente nuevo abierto en una ventana de terminal.",
|
|
7216
|
+
"n\xE3o h\xE1 terminal dispon\xEDvel para abrir uma janela": "no hay un terminal disponible para abrir una ventana",
|
|
7217
|
+
"n\xE3o achei o osascript para abrir o Terminal": "no se encontr\xF3 osascript para abrir Terminal",
|
|
7218
|
+
"sem ambiente gr\xE1fico (DISPLAY ou WAYLAND_DISPLAY) para abrir um terminal": "no hay entorno gr\xE1fico (DISPLAY o WAYLAND_DISPLAY) para abrir un terminal",
|
|
7219
|
+
"n\xE3o achei um terminal (defina $TERMINAL ou instale gnome-terminal, konsole, kitty, alacritty, wezterm, xfce4-terminal ou xterm)": "no se encontr\xF3 un terminal (define $TERMINAL o instala gnome-terminal, konsole, kitty, alacritty, wezterm, xfce4-terminal o xterm)",
|
|
7220
|
+
"o pedido ou a pasta tem caracteres (aspas, % ou quebra de linha) que o cmd.exe n\xE3o aceita com seguran\xE7a": "la solicitud o la carpeta tiene caracteres (comillas, % o saltos de l\xEDnea) que cmd.exe no acepta con seguridad",
|
|
7221
|
+
"o pedido ou a pasta tem caracteres de controle que o Terminal n\xE3o aceita com seguran\xE7a": "la solicitud o la carpeta tiene caracteres de control que Terminal no acepta con seguridad",
|
|
7204
7222
|
"Dividir painel": "Dividir panel",
|
|
7205
7223
|
"Onde abrir": "D\xF3nde abrir",
|
|
7206
|
-
|
|
7224
|
+
'Come\xE7a na hora uma sess\xE3o nova no computador, na pasta, com a ferramenta e no lugar escolhidos; as permiss\xF5es chegam aqui. Em segundo plano, pasta que o Claude Code ainda n\xE3o conhece abre no app do Claude e espera o Enter l\xE1. Sem herdr, "Em uma nova janela de terminal" abre o terminal do computador j\xE1 com a ferramenta rodando. Anexos v\xE3o para ~/.habblaud/attachments e o pedido leva os caminhos.': 'Inicia al instante una sesi\xF3n nueva en el equipo, en la carpeta, con la herramienta y en el lugar elegidos; los permisos llegan aqu\xED. En segundo plano, una carpeta que Claude Code a\xFAn no conoce se abre en la app de Claude y espera el Enter all\xED. Sin herdr, "En una ventana de terminal nueva" abre el terminal del equipo con la herramienta ya en marcha. Los adjuntos van a ~/.habblaud/attachments y la solicitud lleva sus rutas.',
|
|
7207
7225
|
"Escolha onde abrir.": "Elige d\xF3nde abrir.",
|
|
7208
7226
|
"Aberto no herdr (painel {0}).": "Abierto en herdr (panel {0}).",
|
|
7209
7227
|
"Agente novo aberto no herdr.": "Agente nuevo abierto en herdr.",
|
|
@@ -10921,12 +10939,21 @@ var FR = {
|
|
|
10921
10939
|
"Dire\xE7\xE3o": "Direction",
|
|
10922
10940
|
"\xE0 direita": "\xE0 droite",
|
|
10923
10941
|
"para baixo": "vers le bas",
|
|
10924
|
-
"
|
|
10942
|
+
"Para abrir em abas e pain\xE9is, abra o herdr": "Pour ouvrir dans des onglets et panneaux, ouvrez herdr",
|
|
10925
10943
|
"O chat do Gentle Shell n\xE3o volta quando o herdr reinicia (veja herdr integration install pi)": "Le chat de Gentle Shell ne revient pas quand herdr red\xE9marre (voir herdr integration install pi)",
|
|
10926
10944
|
"Nova aba em": "Nouvel onglet dans",
|
|
10945
|
+
"Em uma nova janela de terminal": "Dans une nouvelle fen\xEAtre de terminal",
|
|
10946
|
+
"Aberto em uma nova janela de terminal.": "Ouvert dans une nouvelle fen\xEAtre de terminal.",
|
|
10947
|
+
"Agente novo aberto numa janela de terminal.": "Nouvel agent ouvert dans une fen\xEAtre de terminal.",
|
|
10948
|
+
"n\xE3o h\xE1 terminal dispon\xEDvel para abrir uma janela": "aucun terminal disponible pour ouvrir une fen\xEAtre",
|
|
10949
|
+
"n\xE3o achei o osascript para abrir o Terminal": "osascript introuvable pour ouvrir Terminal",
|
|
10950
|
+
"sem ambiente gr\xE1fico (DISPLAY ou WAYLAND_DISPLAY) para abrir um terminal": "pas d'environnement graphique (DISPLAY ou WAYLAND_DISPLAY) pour ouvrir un terminal",
|
|
10951
|
+
"n\xE3o achei um terminal (defina $TERMINAL ou instale gnome-terminal, konsole, kitty, alacritty, wezterm, xfce4-terminal ou xterm)": "aucun terminal trouv\xE9 (d\xE9finissez $TERMINAL ou installez gnome-terminal, konsole, kitty, alacritty, wezterm, xfce4-terminal ou xterm)",
|
|
10952
|
+
"o pedido ou a pasta tem caracteres (aspas, % ou quebra de linha) que o cmd.exe n\xE3o aceita com seguran\xE7a": "la demande ou le dossier contient des caract\xE8res (guillemets, % ou sauts de ligne) que cmd.exe ne g\xE8re pas en s\xE9curit\xE9",
|
|
10953
|
+
"o pedido ou a pasta tem caracteres de controle que o Terminal n\xE3o aceita com seguran\xE7a": "la demande ou le dossier contient des caract\xE8res de contr\xF4le que Terminal ne g\xE8re pas en s\xE9curit\xE9",
|
|
10927
10954
|
"Dividir painel": "Diviser le panneau",
|
|
10928
10955
|
"Onde abrir": "O\xF9 ouvrir",
|
|
10929
|
-
|
|
10956
|
+
'Come\xE7a na hora uma sess\xE3o nova no computador, na pasta, com a ferramenta e no lugar escolhidos; as permiss\xF5es chegam aqui. Em segundo plano, pasta que o Claude Code ainda n\xE3o conhece abre no app do Claude e espera o Enter l\xE1. Sem herdr, "Em uma nova janela de terminal" abre o terminal do computador j\xE1 com a ferramenta rodando. Anexos v\xE3o para ~/.habblaud/attachments e o pedido leva os caminhos.': "Lance tout de suite une nouvelle session sur l'ordinateur, dans le dossier, avec l'outil et \xE0 l'endroit choisis ; les permissions arrivent ici. En arri\xE8re-plan, un dossier que Claude Code ne conna\xEEt pas encore s'ouvre dans l'app Claude et y attend Entr\xE9e. Sans herdr, \xAB Dans une nouvelle fen\xEAtre de terminal \xBB ouvre le terminal de l'ordinateur avec l'outil d\xE9j\xE0 lanc\xE9. Les pi\xE8ces jointes vont dans ~/.habblaud/attachments et la demande indique leurs chemins.",
|
|
10930
10957
|
"Escolha onde abrir.": "Choisissez o\xF9 ouvrir.",
|
|
10931
10958
|
"Aberto no herdr (painel {0}).": "Ouvert dans herdr (panneau {0}).",
|
|
10932
10959
|
"Agente novo aberto no herdr.": "Nouvel agent ouvert dans herdr.",
|
|
@@ -20187,7 +20214,10 @@ function createApiHandler(deps) {
|
|
|
20187
20214
|
const herdr2 = deps.herdr;
|
|
20188
20215
|
const off = { available: false, reason: deps.inDocker ? tr("indispon\xEDvel no Docker") : tr("o herdr n\xE3o est\xE1 dispon\xEDvel") };
|
|
20189
20216
|
(herdr2 ? herdr2.status().catch(() => off) : Promise.resolve(off)).then(
|
|
20190
|
-
(h) =>
|
|
20217
|
+
(h) => {
|
|
20218
|
+
const terminal = deps.spawnWindow?.() ?? { available: false, reason: deps.inDocker ? tr("indispon\xEDvel no Docker") : tr("n\xE3o h\xE1 terminal dispon\xEDvel para abrir uma janela") };
|
|
20219
|
+
sendJson2(res, 200, { available: spawn2.available(), mode: spawn2.mode(), providers: providers2, herdr: h, terminal });
|
|
20220
|
+
},
|
|
20191
20221
|
(err) => fail3(res, err)
|
|
20192
20222
|
);
|
|
20193
20223
|
} else if (path === "/api/spawn/herdr") {
|
|
@@ -35445,6 +35475,7 @@ function parseDestination(raw) {
|
|
|
35445
35475
|
if (raw === void 0) return { kind: "background" };
|
|
35446
35476
|
const d = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : void 0;
|
|
35447
35477
|
if (d?.kind === "background") return { kind: "background" };
|
|
35478
|
+
if (d?.kind === "window") return { kind: "window" };
|
|
35448
35479
|
if (d?.kind === "tab" && typeof d.workspaceId === "string" && isHerdrWorkspaceId(d.workspaceId)) return { kind: "tab", workspaceId: d.workspaceId };
|
|
35449
35480
|
if (d?.kind === "split" && typeof d.paneId === "string" && isHerdrPaneId(d.paneId) && (d.direction === "right" || d.direction === "down")) {
|
|
35450
35481
|
return { kind: "split", paneId: d.paneId, direction: d.direction };
|
|
@@ -35533,7 +35564,10 @@ var SpawnService = class {
|
|
|
35533
35564
|
return { error: "invalid", reason: tr("no Docker o agente novo s\xF3 abre em segundo plano, com o Claude Code") };
|
|
35534
35565
|
}
|
|
35535
35566
|
if (!this.opts.opener && req.model) return { error: "invalid", reason: tr("no Docker o agente novo n\xE3o aceita escolher o modelo") };
|
|
35536
|
-
if (req.destination.kind
|
|
35567
|
+
if (req.destination.kind === "window") {
|
|
35568
|
+
const w = this.opts.window?.status();
|
|
35569
|
+
if (!w?.available) return { error: "unavailable", reason: w?.reason ?? tr("n\xE3o h\xE1 terminal dispon\xEDvel para abrir uma janela") };
|
|
35570
|
+
} else if (req.destination.kind !== "background" && !this.opts.herdr) return { error: "unavailable", reason: tr("o herdr n\xE3o est\xE1 dispon\xEDvel") };
|
|
35537
35571
|
if (!this.available()) {
|
|
35538
35572
|
return { error: "unavailable", reason: tr("o auxiliar do computador n\xE3o est\xE1 rodando: deixe npm run codex:bridge no ar (o Habblaud est\xE1 no Docker)") };
|
|
35539
35573
|
}
|
|
@@ -35604,8 +35638,17 @@ var SpawnService = class {
|
|
|
35604
35638
|
const prompt = promptWithAttachments(e.req.prompt, paths);
|
|
35605
35639
|
const dest = e.req.destination;
|
|
35606
35640
|
if (dest.kind === "background") return this.resolve(e, await launch({ folder: e.req.folder, prompt, ...e.req.model ? { model: e.req.model } : {} }, opener, this.opts.cli));
|
|
35641
|
+
if (dest.kind === "window") return this.resolveWindow(e, prompt);
|
|
35607
35642
|
return this.resolveHerdr(e, dest, prompt);
|
|
35608
35643
|
}
|
|
35644
|
+
/** Janela nova do terminal do sistema: o pedido (com os caminhos dos anexos) vai como argumento do agente. */
|
|
35645
|
+
async resolveWindow(e, prompt) {
|
|
35646
|
+
const w = this.opts.window;
|
|
35647
|
+
if (!w) return this.resolve(e, { ok: false, error: tr("n\xE3o h\xE1 terminal dispon\xEDvel para abrir uma janela") });
|
|
35648
|
+
const { provider, folder, model } = e.req;
|
|
35649
|
+
const r = await w.open({ provider, folder, prompt, ...model ? { model } : {} }).catch((err) => ({ ok: false, error: String(err?.message ?? err) }));
|
|
35650
|
+
this.resolve(e, r.ok ? { ok: true, how: "window" } : { ok: false, error: r.error.slice(0, ERROR_MAX4) });
|
|
35651
|
+
}
|
|
35609
35652
|
async resolveHerdr(e, destination, prompt) {
|
|
35610
35653
|
const herdr2 = this.opts.herdr;
|
|
35611
35654
|
if (!herdr2) return this.resolve(e, { ok: false, error: tr("o herdr n\xE3o est\xE1 dispon\xEDvel") });
|
|
@@ -35882,6 +35925,11 @@ var HerdrClient = class {
|
|
|
35882
35925
|
}
|
|
35883
35926
|
};
|
|
35884
35927
|
|
|
35928
|
+
// server/spawn/terminal.ts
|
|
35929
|
+
import { spawn as nodeSpawn } from "node:child_process";
|
|
35930
|
+
import { readFileSync as readFileSync25 } from "node:fs";
|
|
35931
|
+
import { basename as basename11 } from "node:path";
|
|
35932
|
+
|
|
35885
35933
|
// server/herdr/links.ts
|
|
35886
35934
|
import { resolve as resolvePath } from "node:path";
|
|
35887
35935
|
var LINK_WINDOW_MS = 12e4;
|
|
@@ -35946,9 +35994,12 @@ function providerArgs(provider, name, model) {
|
|
|
35946
35994
|
if (provider === "claude") return model ? ["-n", name, "--model", model] : ["-n", name];
|
|
35947
35995
|
return model ? ["-m", model] : [];
|
|
35948
35996
|
}
|
|
35949
|
-
function
|
|
35997
|
+
function gentleShellArgv(model, piArgs = []) {
|
|
35950
35998
|
const args = [...piArgs, ...model ? ["--model", model] : []];
|
|
35951
|
-
return args.length ?
|
|
35999
|
+
return args.length ? [GENTLE_SHELL_COMMAND, "--", ...args] : [GENTLE_SHELL_COMMAND];
|
|
36000
|
+
}
|
|
36001
|
+
function gentleShellCommand(model, piArgs = []) {
|
|
36002
|
+
return gentleShellArgv(model, piArgs).join(" ");
|
|
35952
36003
|
}
|
|
35953
36004
|
function agentName(provider, taken, tag) {
|
|
35954
36005
|
const prefix = provider === "gentle-shell" ? "gentle" : provider;
|
|
@@ -36126,6 +36177,163 @@ async function launchInHerdr(client, req, opts = {}) {
|
|
|
36126
36177
|
}
|
|
36127
36178
|
}
|
|
36128
36179
|
|
|
36180
|
+
// server/spawn/terminal.ts
|
|
36181
|
+
var LINUX_TERMINALS = ["x-terminal-emulator", "gnome-terminal", "konsole", "kitty", "alacritty", "wezterm", "xfce4-terminal", "xterm"];
|
|
36182
|
+
function detectWsl(env, platform = process.platform, readProc = () => readFileSync25("/proc/version", "utf8")) {
|
|
36183
|
+
if (platform !== "linux") return false;
|
|
36184
|
+
if (env.WSL_DISTRO_NAME || env.WSL_INTEROP) return true;
|
|
36185
|
+
try {
|
|
36186
|
+
return /microsoft/i.test(readProc());
|
|
36187
|
+
} catch {
|
|
36188
|
+
return false;
|
|
36189
|
+
}
|
|
36190
|
+
}
|
|
36191
|
+
function detectTerminal(e) {
|
|
36192
|
+
if (e.inDocker) return { available: false, reason: tr("indispon\xEDvel no Docker") };
|
|
36193
|
+
if (e.platform === "darwin") {
|
|
36194
|
+
const bin = e.which("osascript");
|
|
36195
|
+
return bin ? { available: true, kind: "terminal-app", bin } : { available: false, reason: tr("n\xE3o achei o osascript para abrir o Terminal") };
|
|
36196
|
+
}
|
|
36197
|
+
if (e.platform === "win32") {
|
|
36198
|
+
const wt = e.which("wt.exe");
|
|
36199
|
+
return wt ? { available: true, kind: "wt", bin: wt } : { available: true, kind: "cmd-start", bin: e.which("cmd.exe") ?? "cmd.exe" };
|
|
36200
|
+
}
|
|
36201
|
+
if (e.wsl) {
|
|
36202
|
+
const wt = e.which("wt.exe");
|
|
36203
|
+
if (wt) return { available: true, kind: "wt-wsl", bin: wt };
|
|
36204
|
+
}
|
|
36205
|
+
if (!e.env.DISPLAY && !e.env.WAYLAND_DISPLAY) return { available: false, reason: tr("sem ambiente gr\xE1fico (DISPLAY ou WAYLAND_DISPLAY) para abrir um terminal") };
|
|
36206
|
+
const custom = e.env.TERMINAL?.trim();
|
|
36207
|
+
if (custom) {
|
|
36208
|
+
const bin = e.which(custom);
|
|
36209
|
+
if (bin) {
|
|
36210
|
+
const name = basename11(custom);
|
|
36211
|
+
return { available: true, kind: LINUX_TERMINALS.includes(name) ? name : "x-terminal-emulator", bin };
|
|
36212
|
+
}
|
|
36213
|
+
}
|
|
36214
|
+
for (const kind of LINUX_TERMINALS) {
|
|
36215
|
+
const bin = e.which(kind);
|
|
36216
|
+
if (bin) return { available: true, kind, bin };
|
|
36217
|
+
}
|
|
36218
|
+
return { available: false, reason: tr("n\xE3o achei um terminal (defina $TERMINAL ou instale gnome-terminal, konsole, kitty, alacritty, wezterm, xfce4-terminal ou xterm)") };
|
|
36219
|
+
}
|
|
36220
|
+
var CONTROL4 = /[\x00-\x1f\x7f]/;
|
|
36221
|
+
function appleScriptString(text3) {
|
|
36222
|
+
if (CONTROL4.test(text3)) return void 0;
|
|
36223
|
+
return `"${text3.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
36224
|
+
}
|
|
36225
|
+
function shellQuote(text3, eol) {
|
|
36226
|
+
if (/^[A-Za-z0-9_@%+=:,./-]+$/.test(text3)) return text3;
|
|
36227
|
+
if (!CONTROL4.test(text3)) return `'${text3.replace(/'/g, "'\\''")}'`;
|
|
36228
|
+
if (!eol || /[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/.test(text3)) return void 0;
|
|
36229
|
+
const esc2 = text3.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t");
|
|
36230
|
+
return `$'${esc2}'`;
|
|
36231
|
+
}
|
|
36232
|
+
function quoteWindowsArg(arg) {
|
|
36233
|
+
if (arg !== "" && !/[\s"]/.test(arg)) return arg;
|
|
36234
|
+
let out = '"';
|
|
36235
|
+
let slashes = 0;
|
|
36236
|
+
for (const ch of arg) {
|
|
36237
|
+
if (ch === "\\") slashes++;
|
|
36238
|
+
else {
|
|
36239
|
+
out += ch === '"' ? "\\".repeat(slashes * 2 + 1) + '"' : "\\".repeat(slashes) + ch;
|
|
36240
|
+
slashes = 0;
|
|
36241
|
+
}
|
|
36242
|
+
}
|
|
36243
|
+
return `${out}${"\\".repeat(slashes * 2)}"`;
|
|
36244
|
+
}
|
|
36245
|
+
function cmdArg(arg) {
|
|
36246
|
+
if (/["%\r\n\0]/.test(arg)) return void 0;
|
|
36247
|
+
return arg === "" || /[\s&|<>^()]/.test(arg) ? quoteWindowsArg(arg) : arg;
|
|
36248
|
+
}
|
|
36249
|
+
var wtArg = (arg) => arg.replace(/;/g, "\\;");
|
|
36250
|
+
function terminalCommand(pick2, folder, argv, _platform = process.platform) {
|
|
36251
|
+
const { kind, bin } = pick2;
|
|
36252
|
+
switch (kind) {
|
|
36253
|
+
case "gnome-terminal":
|
|
36254
|
+
return { bin, args: [`--working-directory=${folder}`, "--", ...argv], cwd: folder };
|
|
36255
|
+
case "xfce4-terminal":
|
|
36256
|
+
return { bin, args: [`--working-directory=${folder}`, "-x", ...argv], cwd: folder };
|
|
36257
|
+
case "konsole":
|
|
36258
|
+
return { bin, args: ["--workdir", folder, "-e", ...argv], cwd: folder };
|
|
36259
|
+
case "kitty":
|
|
36260
|
+
return { bin, args: ["--directory", folder, ...argv], cwd: folder };
|
|
36261
|
+
case "alacritty":
|
|
36262
|
+
return { bin, args: ["--working-directory", folder, "-e", ...argv], cwd: folder };
|
|
36263
|
+
case "wezterm":
|
|
36264
|
+
return { bin, args: ["start", "--cwd", folder, "--", ...argv], cwd: folder };
|
|
36265
|
+
case "xterm":
|
|
36266
|
+
case "x-terminal-emulator":
|
|
36267
|
+
return { bin, args: ["-e", ...argv], cwd: folder };
|
|
36268
|
+
case "wt-wsl":
|
|
36269
|
+
return { bin, args: ["wsl.exe", "--cd", folder, "--exec", "bash", "-lc", 'exec "$@"', "bash", ...argv].map(wtArg) };
|
|
36270
|
+
case "wt":
|
|
36271
|
+
return { bin, args: ["-d", folder, ...argv].map(wtArg) };
|
|
36272
|
+
case "cmd-start": {
|
|
36273
|
+
const parts = [folder, ...argv].map(cmdArg);
|
|
36274
|
+
if (parts.some((p) => p === void 0)) return { error: tr("o pedido ou a pasta tem caracteres (aspas, % ou quebra de linha) que o cmd.exe n\xE3o aceita com seguran\xE7a") };
|
|
36275
|
+
const [dir, ...rest] = parts;
|
|
36276
|
+
return { bin, args: ["/d", "/c", `start "" /D ${dir} ${rest.join(" ")}`], verbatim: true };
|
|
36277
|
+
}
|
|
36278
|
+
case "terminal-app": {
|
|
36279
|
+
const dir = shellQuote(folder, false);
|
|
36280
|
+
const words2 = argv.map((a) => shellQuote(a, true));
|
|
36281
|
+
if (dir === void 0 || words2.some((w) => w === void 0)) return { error: tr("o pedido ou a pasta tem caracteres de controle que o Terminal n\xE3o aceita com seguran\xE7a") };
|
|
36282
|
+
const script2 = appleScriptString(`cd ${dir} && ${words2.join(" ")}`);
|
|
36283
|
+
if (script2 === void 0) return { error: tr("o pedido ou a pasta tem caracteres de controle que o Terminal n\xE3o aceita com seguran\xE7a") };
|
|
36284
|
+
return { bin, args: ["-e", 'tell application "Terminal"', "-e", "activate", "-e", `do script ${script2}`, "-e", "end tell"] };
|
|
36285
|
+
}
|
|
36286
|
+
}
|
|
36287
|
+
}
|
|
36288
|
+
function windowArgv(req, bins = {}) {
|
|
36289
|
+
const hasPrompt = req.prompt.trim() !== "";
|
|
36290
|
+
if (req.provider === "gentle-shell") {
|
|
36291
|
+
const text3 = /^[-@]/.test(req.prompt) ? ` ${req.prompt}` : req.prompt;
|
|
36292
|
+
return gentleShellArgv(req.model, hasPrompt ? [text3] : []);
|
|
36293
|
+
}
|
|
36294
|
+
const tail = hasPrompt ? ["--", req.prompt] : [];
|
|
36295
|
+
if (req.provider === "claude") return [bins.claude ?? "claude", ...providerArgs("claude", sessionName(req.prompt), req.model), ...tail];
|
|
36296
|
+
return ["codex", ...providerArgs("codex", "codex", req.model), ...tail];
|
|
36297
|
+
}
|
|
36298
|
+
function createTerminalLauncher(o) {
|
|
36299
|
+
const spawn2 = o.spawn ?? nodeSpawn;
|
|
36300
|
+
return {
|
|
36301
|
+
status() {
|
|
36302
|
+
const p = detectTerminal(o);
|
|
36303
|
+
return p.available ? { available: true } : { available: false, reason: p.reason };
|
|
36304
|
+
},
|
|
36305
|
+
open(req) {
|
|
36306
|
+
const pick2 = detectTerminal(o);
|
|
36307
|
+
if (!pick2.available) return Promise.resolve({ ok: false, error: pick2.reason });
|
|
36308
|
+
const cmd = terminalCommand(pick2, req.folder, windowArgv(req, o.bins), o.platform);
|
|
36309
|
+
if ("error" in cmd) return Promise.resolve({ ok: false, error: cmd.error });
|
|
36310
|
+
return new Promise((ok) => {
|
|
36311
|
+
try {
|
|
36312
|
+
const child = spawn2(cmd.bin, cmd.args, {
|
|
36313
|
+
...cmd.cwd ? { cwd: cmd.cwd } : {},
|
|
36314
|
+
detached: true,
|
|
36315
|
+
stdio: "ignore",
|
|
36316
|
+
windowsHide: true,
|
|
36317
|
+
...cmd.verbatim ? { windowsVerbatimArguments: true } : {}
|
|
36318
|
+
});
|
|
36319
|
+
child.once("error", (err) => ok({ ok: false, error: `${basename11(cmd.bin)}: ${err.message}`.slice(0, 300) }));
|
|
36320
|
+
child.once("spawn", () => {
|
|
36321
|
+
child.unref();
|
|
36322
|
+
ok({ ok: true });
|
|
36323
|
+
});
|
|
36324
|
+
} catch (err) {
|
|
36325
|
+
ok({ ok: false, error: `${basename11(cmd.bin)}: ${err.message}`.slice(0, 300) });
|
|
36326
|
+
}
|
|
36327
|
+
});
|
|
36328
|
+
}
|
|
36329
|
+
};
|
|
36330
|
+
}
|
|
36331
|
+
function systemTerminalLauncher(inDocker, bins) {
|
|
36332
|
+
const env = process.env;
|
|
36333
|
+
const platform = process.platform;
|
|
36334
|
+
return createTerminalLauncher({ platform, env, which: (name) => findExecutable(name, env, platform), wsl: detectWsl(env, platform), inDocker, bins });
|
|
36335
|
+
}
|
|
36336
|
+
|
|
36129
36337
|
// server/spawn/providers.ts
|
|
36130
36338
|
function detectProviders(env, find = {}) {
|
|
36131
36339
|
const claude2 = find.claude ?? (() => runnableClaudeBin(env));
|
|
@@ -36187,7 +36395,7 @@ function startAttachmentsPruner(opts) {
|
|
|
36187
36395
|
}
|
|
36188
36396
|
|
|
36189
36397
|
// server/settings/attachments.ts
|
|
36190
|
-
import { mkdirSync as mkdirSync17, readFileSync as
|
|
36398
|
+
import { mkdirSync as mkdirSync17, readFileSync as readFileSync26, renameSync as renameSync15, writeFileSync as writeFileSync15 } from "node:fs";
|
|
36191
36399
|
import { dirname as dirname16 } from "node:path";
|
|
36192
36400
|
var RETENTION_CHOICES = [1, 3, 7, 30];
|
|
36193
36401
|
var DEFAULT_RETENTION_DAYS = 7;
|
|
@@ -36216,7 +36424,7 @@ var AttachmentSettingsStore = class {
|
|
|
36216
36424
|
load() {
|
|
36217
36425
|
if (!this.file) return null;
|
|
36218
36426
|
try {
|
|
36219
|
-
return parseRetention(JSON.parse(
|
|
36427
|
+
return parseRetention(JSON.parse(readFileSync26(this.file, "utf8")));
|
|
36220
36428
|
} catch (err) {
|
|
36221
36429
|
if (err.code !== "ENOENT") log.warn(tr("attachments.json ileg\xEDvel ({0}); usando o padr\xE3o de {1} dias.", [errMsg(err), DEFAULT_RETENTION_DAYS]));
|
|
36222
36430
|
return null;
|
|
@@ -36288,7 +36496,7 @@ function recentFolders(sessions, rooms, limit = FOLDERS_LIMIT) {
|
|
|
36288
36496
|
|
|
36289
36497
|
// server/dictation/whisper.ts
|
|
36290
36498
|
import { execFile as execFile7 } from "node:child_process";
|
|
36291
|
-
import { existsSync as existsSync12, mkdtempSync as mkdtempSync2, readFileSync as
|
|
36499
|
+
import { existsSync as existsSync12, mkdtempSync as mkdtempSync2, readFileSync as readFileSync27, rmSync as rmSync8, writeFileSync as writeFileSync16 } from "node:fs";
|
|
36292
36500
|
import { homedir as homedir7, tmpdir } from "node:os";
|
|
36293
36501
|
import { delimiter as delimiter2, join as join32 } from "node:path";
|
|
36294
36502
|
var TRANSCRIBE_TIMEOUT_MS = 12e4;
|
|
@@ -36341,7 +36549,7 @@ function createWhisperTranscriber(setup, timeoutMs = TRANSCRIBE_TIMEOUT_MS) {
|
|
|
36341
36549
|
const out = join32(dir, `out-${lang}`);
|
|
36342
36550
|
const r = await run2(setup.bin, ["-m", setup.model, "-l", lang, "-f", wav, "-nt", "-np", "-oj", "-of", out], timeoutMs);
|
|
36343
36551
|
if (!r.ok) throw new Error(tr("o Whisper falhou ({0})", [r.error]));
|
|
36344
|
-
return parseWhisperJson(
|
|
36552
|
+
return parseWhisperJson(readFileSync27(`${out}.json`, "utf8"));
|
|
36345
36553
|
};
|
|
36346
36554
|
const first = await pass("auto");
|
|
36347
36555
|
if (!first.lang || setup.langs.includes(first.lang) || !first.text) return first;
|
|
@@ -36355,7 +36563,7 @@ function createWhisperTranscriber(setup, timeoutMs = TRANSCRIBE_TIMEOUT_MS) {
|
|
|
36355
36563
|
|
|
36356
36564
|
// server/deliveries/fetcher.ts
|
|
36357
36565
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
36358
|
-
import { readFileSync as
|
|
36566
|
+
import { readFileSync as readFileSync28 } from "node:fs";
|
|
36359
36567
|
var HOST_PRESENCE_MS3 = 1e4;
|
|
36360
36568
|
var WAIT_MS = 2e4;
|
|
36361
36569
|
var CACHE_MAX_BYTES = 80 * 1024 * 1024;
|
|
@@ -36438,7 +36646,7 @@ var FileFetcher = class {
|
|
|
36438
36646
|
const c = (this.opts.check ?? checkFile)(path);
|
|
36439
36647
|
if ("error" in c) return { error: c.error, status: c.error === tr("arquivo n\xE3o encontrado") ? 404 : 403 };
|
|
36440
36648
|
try {
|
|
36441
|
-
const data = (this.opts.read ??
|
|
36649
|
+
const data = (this.opts.read ?? readFileSync28)(c.path);
|
|
36442
36650
|
this.remember(path, data);
|
|
36443
36651
|
return { data };
|
|
36444
36652
|
} catch {
|
|
@@ -37460,7 +37668,7 @@ function socialRoutes(social) {
|
|
|
37460
37668
|
}
|
|
37461
37669
|
|
|
37462
37670
|
// server/world/settings.ts
|
|
37463
|
-
import { chmodSync as chmodSync7, mkdirSync as mkdirSync18, readFileSync as
|
|
37671
|
+
import { chmodSync as chmodSync7, mkdirSync as mkdirSync18, readFileSync as readFileSync29, renameSync as renameSync16, rmSync as rmSync9, statSync as statSync24, writeFileSync as writeFileSync17 } from "node:fs";
|
|
37464
37672
|
import { dirname as dirname17 } from "node:path";
|
|
37465
37673
|
var DEVICE_ID_RE = /^[A-Za-z0-9_-]{1,64}$/;
|
|
37466
37674
|
var TOKEN_RE = /^[A-Za-z0-9_-]{16,256}$/;
|
|
@@ -37507,7 +37715,7 @@ var WorldSettingsStore = class {
|
|
|
37507
37715
|
const st = statSync24(this.file);
|
|
37508
37716
|
if (st.size > MAX_FILE) throw new Error("too large");
|
|
37509
37717
|
if ((st.mode & 63) !== 0) chmodSync7(this.file, 384);
|
|
37510
|
-
const raw = JSON.parse(
|
|
37718
|
+
const raw = JSON.parse(readFileSync29(this.file, "utf8"));
|
|
37511
37719
|
const obj4 = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
|
|
37512
37720
|
if (isWorldThemeChoice(obj4.theme)) this.theme = obj4.theme;
|
|
37513
37721
|
this.session = parseWorldSession(raw);
|
|
@@ -38236,7 +38444,7 @@ function createWorldRoutes(service, viewer, social) {
|
|
|
38236
38444
|
}
|
|
38237
38445
|
|
|
38238
38446
|
// server/world/uplink.ts
|
|
38239
|
-
import { chmodSync as chmodSync8, mkdirSync as mkdirSync19, readFileSync as
|
|
38447
|
+
import { chmodSync as chmodSync8, mkdirSync as mkdirSync19, readFileSync as readFileSync30, renameSync as renameSync17, rmSync as rmSync10, writeFileSync as writeFileSync18 } from "node:fs";
|
|
38240
38448
|
import { dirname as dirname18 } from "node:path";
|
|
38241
38449
|
|
|
38242
38450
|
// shared/world/appearance-flat.ts
|
|
@@ -39298,7 +39506,7 @@ var BuildingUplink = class {
|
|
|
39298
39506
|
this.deviceId = s2?.deviceId;
|
|
39299
39507
|
if (!file) return;
|
|
39300
39508
|
try {
|
|
39301
|
-
const raw = JSON.parse(
|
|
39509
|
+
const raw = JSON.parse(readFileSync30(file, "utf8"));
|
|
39302
39510
|
const ok = raw && typeof raw === "object" && typeof raw.deviceId === "string" && typeof raw.at === "number" && typeof raw.bytes === "number" && raw.uplink && typeof raw.uplink === "object" && Array.isArray(raw.uplink.floors);
|
|
39303
39511
|
if (!ok || raw.deviceId !== s2?.deviceId) return this.removeLast();
|
|
39304
39512
|
this.last = raw;
|
|
@@ -40733,6 +40941,7 @@ var gentleInbox = () => messages && {
|
|
|
40733
40941
|
}
|
|
40734
40942
|
};
|
|
40735
40943
|
var gentleModels = createGentleModelLister({ run: createListModelsRunner(() => config.inDocker ? void 0 : findExecutable("gentle-shell", process.env)) });
|
|
40944
|
+
var windowLauncher = spawnOn && !config.inDocker ? systemTerminalLauncher(false, { claude: spawnBin }) : void 0;
|
|
40736
40945
|
var spawn = spawnOn ? new SpawnService(
|
|
40737
40946
|
config.inDocker ? { attachments } : {
|
|
40738
40947
|
opener: createOpener(),
|
|
@@ -40740,7 +40949,8 @@ var spawn = spawnOn ? new SpawnService(
|
|
|
40740
40949
|
attachments,
|
|
40741
40950
|
gentleModels: () => gentleModels.peek(),
|
|
40742
40951
|
herdr: herdrClient ? (r, onPane) => launchInHerdr(herdrClient, r, { onPane, inbox: gentleInbox() }) : void 0,
|
|
40743
|
-
onHerdrLaunch: herdrLinks ? (r) => herdrLinks.record(r) : void 0
|
|
40952
|
+
onHerdrLaunch: herdrLinks ? (r) => herdrLinks.record(r) : void 0,
|
|
40953
|
+
window: windowLauncher
|
|
40744
40954
|
}
|
|
40745
40955
|
) : void 0;
|
|
40746
40956
|
var whisper = config.messages && !config.inDocker ? findWhisper() : void 0;
|
|
@@ -40876,6 +41086,7 @@ var api = createApiHandler({
|
|
|
40876
41086
|
pty: config.central ? createPtyRoutes(ptys, () => config.messages ? late.remotePtys : void 0) : ptys ? createPtyRoutes(ptys) : void 0,
|
|
40877
41087
|
spawn,
|
|
40878
41088
|
herdr,
|
|
41089
|
+
spawnWindow: windowLauncher ? () => windowLauncher.status() : void 0,
|
|
40879
41090
|
providers,
|
|
40880
41091
|
attachments,
|
|
40881
41092
|
dictation,
|
|
@@ -41075,7 +41286,7 @@ if (config.central) {
|
|
|
41075
41286
|
listener = startCentralListener({
|
|
41076
41287
|
host: bind.host,
|
|
41077
41288
|
port: central.port,
|
|
41078
|
-
tls: { key:
|
|
41289
|
+
tls: { key: readFileSync31(paths.serverKey), cert: readFileSync31(paths.serverCert), ca: readFileSync31(paths.caCert) },
|
|
41079
41290
|
machines,
|
|
41080
41291
|
routes: centralHub
|
|
41081
41292
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "busybits",
|
|
3
3
|
"displayName": "Busybits",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.4.1",
|
|
5
5
|
"description": "Connects the session to Busybits: records plan usage (5h and weekly) for the office, shows a line under the prompt when another session needs you, and adds the /busybits command.",
|
|
6
6
|
"author": { "name": "Márcio Junior", "url": "https://github.com/marmottajr" },
|
|
7
7
|
"homepage": "https://github.com/marmottajr/habblaud#readme",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "busybits-messages",
|
|
3
3
|
"displayName": "Busybits: messages from the office",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.4.1",
|
|
5
5
|
"description": "Delivers to the Claude Code session the messages you type in Busybits (agent panel or terminal), as if you had typed them in the terminal.",
|
|
6
6
|
"author": { "name": "Márcio Junior", "url": "https://github.com/marmottajr" },
|
|
7
7
|
"homepage": "https://github.com/marmottajr/habblaud#readme",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "busybits-permissions",
|
|
3
3
|
"displayName": "Busybits: permissions from the office",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.4.1",
|
|
5
5
|
"description": "PermissionRequest hook that lets you approve or deny Claude Code permission requests and answer AskUserQuestion prompts from Busybits; the dialog stays in the terminal and whichever answer comes first wins.",
|
|
6
6
|
"author": { "name": "Márcio Junior", "url": "https://github.com/marmottajr" },
|
|
7
7
|
"homepage": "https://github.com/marmottajr/habblaud#readme",
|