typebulb 0.55.0 → 0.55.2
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/SKILL.md +2 -2
- package/dist/agents/claude/client.js +168 -167
- package/dist/agents/claude/styles.css +79 -0
- package/dist/agents/codex/client.js +168 -167
- package/dist/agents/codex/styles.css +79 -0
- package/dist/agents/pi/client.js +223 -222
- package/dist/agents/pi/styles.css +79 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -337,6 +337,81 @@ html:not([data-theme="dark"]) .turn-view > .shimmer-text {
|
|
|
337
337
|
rides a whole buffering window). */
|
|
338
338
|
.pill-busy { border-color: var(--accent); --shimmer-base: var(--panel); --shimmer-mix: 25%; }
|
|
339
339
|
|
|
340
|
+
/* ── Tooltip — the styled stand-in for native `title`, and only on FIXED EXPLANATORY copy: text
|
|
341
|
+
that teaches what a control does. Dynamic identifiers (a path, a model id, an mcp tool's full
|
|
342
|
+
name) keep the native attribute, which is better at them: they run long, they want to wrap, and
|
|
343
|
+
`title` is the reliable "show me the whole string" affordance a bounded box is worse at. One
|
|
344
|
+
attribute opts a control in, no wrapper component and no JS, and it shows on :focus-visible,
|
|
345
|
+
which native `title` never does for a keyboard user. `data-tip` is not an accessible name, so a
|
|
346
|
+
glyph-only control still needs its own ariaLabel.
|
|
347
|
+
Three non-obvious bits. :where() zeroes the position rule's specificity, so a control that is
|
|
348
|
+
ALREADY positioned (the filter's inset × and 🔬) keeps its own and is its own containing block
|
|
349
|
+
anyway. display:none at rest rather than opacity:0, because an absolutely positioned box still
|
|
350
|
+
counts toward a scroll container's scrollable overflow and .messages' stuck-to-bottom test is
|
|
351
|
+
measured in pixels. The open delay therefore rides an animation (fill-mode both holds the
|
|
352
|
+
from-state through the delay), since a display switch cannot transition. ── */
|
|
353
|
+
:where([data-tip]) { position: relative; }
|
|
354
|
+
[data-tip]::after {
|
|
355
|
+
content: attr(data-tip);
|
|
356
|
+
display: none;
|
|
357
|
+
position: absolute;
|
|
358
|
+
z-index: 40;
|
|
359
|
+
top: calc(100% + 7px);
|
|
360
|
+
left: 50%;
|
|
361
|
+
transform: translateX(-50%);
|
|
362
|
+
width: max-content;
|
|
363
|
+
max-width: min(22rem, 60vw);
|
|
364
|
+
padding: .3rem .55rem;
|
|
365
|
+
background: var(--panel);
|
|
366
|
+
color: var(--fg);
|
|
367
|
+
border: 1px solid var(--border);
|
|
368
|
+
border-radius: 8px;
|
|
369
|
+
box-shadow: 0 8px 30px rgba(0, 0, 0, .45);
|
|
370
|
+
/* Its own typography, never the host's (a stub label is italic, a pill is not) — but the same
|
|
371
|
+
SIZE as the chrome it explains, .8rem, which is both the statusbar's and the tab row's. A tip
|
|
372
|
+
set larger than the control it belongs to reads as shouting. Full --fg carries it instead. */
|
|
373
|
+
font-size: .8rem;
|
|
374
|
+
font-style: normal;
|
|
375
|
+
font-weight: 400;
|
|
376
|
+
line-height: 1.4;
|
|
377
|
+
/* Centred and balanced, because the box CANNOT hug wrapped text: `width: max-content` capped by
|
|
378
|
+
max-width means any tip too long for one line sits at exactly max-width, whatever it wraps to.
|
|
379
|
+
Left-aligned, the leftover on the last line then reads as dead space (the model pill's tip, the
|
|
380
|
+
only one long enough to wrap). Balancing evens the lines and centring splits what's left to both
|
|
381
|
+
sides, so a two-line tip reads as a block instead of a full line plus a stub. */
|
|
382
|
+
text-align: center;
|
|
383
|
+
text-wrap: balance;
|
|
384
|
+
/* pre-line, not normal: a tip built from two lines (the session pill's cwd over its id) keeps the
|
|
385
|
+
break native `title` gave it, and everything else still wraps at the max-width. */
|
|
386
|
+
white-space: pre-line;
|
|
387
|
+
pointer-events: none;
|
|
388
|
+
}
|
|
389
|
+
[data-tip]:hover::after,
|
|
390
|
+
[data-tip]:focus-visible::after { display: block; animation: tip-in .12s ease .4s both; }
|
|
391
|
+
@keyframes tip-in { from { opacity: 0; } to { opacity: 1; } }
|
|
392
|
+
/* One tip nested in another (the diff pill's × sits inside the pill body): hovering the inner one
|
|
393
|
+
hovers the outer too, so both boxes would open. Only the innermost shows, which is how native
|
|
394
|
+
`title` resolves it. */
|
|
395
|
+
[data-tip]:has([data-tip]:hover)::after { display: none; }
|
|
396
|
+
/* Pressed: tooltips are dismissed until the pointer reaches a different one (ui.ts
|
|
397
|
+
armTooltipDismiss). Out-specifies the :hover rule on its own, no !important needed. */
|
|
398
|
+
body.tips-off [data-tip]::after { display: none; }
|
|
399
|
+
/* Bottom-anchored surfaces open upward, like their own menus: under the statusbar and under the
|
|
400
|
+
composer's action row there is no room to drop into. */
|
|
401
|
+
:is(.statusbar, .composer) [data-tip]::after { top: auto; bottom: calc(100% + 7px); }
|
|
402
|
+
/* ...and grow LEFT from the control's right edge, which is the "end" alignment the statusbar menus
|
|
403
|
+
already take by default (.pop-center / .pop-start above are their opt-outs). Every one of these
|
|
404
|
+
clusters is right-aligned, so a centred box runs past the viewport — the bulbs pill's tip was
|
|
405
|
+
clipped — and inside a menu it is also the direction that stays within its overflow:hidden for a
|
|
406
|
+
control inset at the right edge. The transcript's own tips stay centred: they sit mid-column. */
|
|
407
|
+
:is(.statusbar, .composer, .picker, .servers-pop) [data-tip]::after { left: auto; right: 0; transform: none; }
|
|
408
|
+
/* ...except where the pill's WRAP already names an alignment for its menu. A tip and the menu it
|
|
409
|
+
belongs to must open the same way, so both read off the same tag (.pop-center / .pop-start above)
|
|
410
|
+
and neither can be set on its own. Direct child, like the menu rules: a control nested inside a
|
|
411
|
+
pill (the diff pill's ×) keeps the cluster's end alignment, which is right at a pill's far edge. */
|
|
412
|
+
.pop-center > [data-tip]::after { right: auto; left: 50%; transform: translateX(-50%); }
|
|
413
|
+
.pop-start > [data-tip]::after { right: auto; left: 0; transform: none; }
|
|
414
|
+
|
|
340
415
|
/* ── The composer (TB-Agent-Composer.md): the prompt panel under the transcript. In flow (not
|
|
341
416
|
overlaid like the statusbar) — it owns real height and must never cover content. ── */
|
|
342
417
|
.composer { position: relative; flex: none; background: var(--bg); padding-inline: 1.75rem; }
|
|
@@ -1439,6 +1514,10 @@ html[data-theme="dark"] .masthead-logo.dark { display: block; }
|
|
|
1439
1514
|
width: var(--lane-w);
|
|
1440
1515
|
margin-left: var(--lane-ml);
|
|
1441
1516
|
margin-right: auto;
|
|
1517
|
+
/* Zero the `.embed` inset: spread makes the border box the lane, so a 1rem left padding would
|
|
1518
|
+
leave the scroller 1rem narrower than the table's own lane cap — a capped table then overflows
|
|
1519
|
+
by exactly that inset at every window width, which is the permanent 16px-of-travel scrollbar. */
|
|
1520
|
+
padding-left: 0;
|
|
1442
1521
|
}
|
|
1443
1522
|
|
|
1444
1523
|
/* ````bulb```` inline bulbs: a sandboxed nested app. createBulbFrame owns the iframe (auto-height,
|
package/dist/index.js
CHANGED
|
@@ -180,7 +180,7 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
|
|
|
180
180
|
`),c=i.filter(u=>u.type==="tool_use").map(u=>({id:u.id??"",name:u.name??"",input:u.input??{}}));if(o||a||c.length){let u=Date.parse(e.timestamp??""),d=!isNaN(u)&&u>=t;r.push({type:"assistant",text:o,thinking:a,tools:c,live:d})}let l=e.message?.usage??e.usage,f=l&&{in:l.input_tokens??0,out:l.output_tokens??0,cached:l.cache_read_input_tokens??0,cacheCreate:l.cache_creation_input_tokens??0};return{events:r,usage:f,model:e.message?.model}}return{events:r}}chainWorking(e){let t;for(let o of e)(o.type==="user"||o.type==="assistant")&&(t=o);if(!t)return!1;if(t.type==="user"){try{let o=t.message?.content,a=typeof o=="string"?o:Array.isArray(o)?o.filter(l=>l&&l.type==="text").map(l=>l.text??"").join(""):"";if(!(Array.isArray(o)&&o.some(l=>l&&l.type==="tool_result"))&&a.trim()&&xt(a)==="")return!1}catch{}return!0}let s=(Array.isArray(t.message?.content)?t.message.content:[]).filter(o=>o.type==="tool_use").map(o=>o.id);if(s.length===0)return!1;let i=new Set;for(let o of e){let a=o.message?.content;if(Array.isArray(a))for(let c of a)c.type==="tool_result"&&c.tool_use_id&&i.add(c.tool_use_id)}return s.some(o=>o&&!i.has(o))}sessionAlive(e){return HE(e)}readPreview(e){return WE(e)}searchText(e){if(!e||Hr(e)||e.type!=="user"&&e.type!=="assistant")return"";let t=e.message?.content,r="";if(typeof t=="string")r=xt(t);else if(Array.isArray(t)){let s=t;r=e.type==="user"?s.map(Ll).filter(Boolean).join(" "):s.filter(i=>i.type==="text"&&typeof i.text=="string").map(i=>i.text).join(" ")}return r.replace(/\s+/g," ").trim()}}});import{statSync as YE,readdirSync as VE,openSync as zE,readSync as GE,closeSync as XE,existsSync as QE}from"fs";import{basename as ZE,join as Dl,resolve as eA}from"path";import{homedir as Fm}from"os";function nA(n){let e=n.trimStart();return tA.some(t=>e.startsWith(t))}function Vr(n,e){return Array.isArray(n)?n.map(t=>typeof t?.text=="string"?e&&nA(t.text)?"":be(t.text):t?.type==="input_image"&&typeof t.image_url=="string"&&t.image_url.startsWith("data:")?``:"").filter(Boolean).join(`
|
|
181
181
|
`):""}function rA(n){return typeof n=="string"?be(n):Vr(n,!1)}function sA(n){let e=n??"";for(let t of[/tools\.shell_command\((\{[\s\S]*?\})\)/,/tools\.shell_command\((\{[\s\S]*\})\)/]){let r=t.exec(e);if(r)try{return JSON.parse(r[1])}catch{}}return{script:e}}function iA(n){if(typeof n=="string"&&n)try{let e=JSON.parse(n);if(e&&typeof e=="object"&&!Array.isArray(e))return e}catch{}return{arguments:n??""}}function qm(n,e){let t;try{t=zE(n,"r")}catch{return}try{let r=Buffer.alloc(e),s=GE(t,r,0,e,0);return{text:r.subarray(0,s).toString("utf8"),bytes:s}}finally{XE(t)}}function oA(n){let t=qm(n,65536);if(t===void 0)return;let r=t.text.indexOf(`
|
|
182
182
|
`);if(r<0)return t.bytes>=65536?"":void 0;try{let s=JSON.parse(t.text.slice(0,r));return s?.type==="session_meta"&&typeof s.payload?.cwd=="string"?s.payload.cwd:""}catch{return""}}var tA,Um,_n,jl=v(()=>{"use strict";Wr();Wi();tA=["<permissions instructions>","<apps_instructions>","<plugins_instructions>","<skills_instructions>","<recommended_plugins>","<environment_context>","<user_instructions>"];Um=n=>{let e=eA(n);return process.platform==="win32"?e.toLowerCase():e},_n=class extends kt{constructor(t=Dl(Fm(),".codex","sessions")){super();this.root=t}displayName="Codex Mirror";#e=0;#s;#t=new Map;detectsSelf(){return!!process.env.CODEX_THREAD_ID}detectsInstalled(){return QE(Dl(Fm(),".codex"))}sessionsDir(t){return this.root}listSessionFiles(t){let r=Um(t),s=[];for(let i of this.#r()){let o;try{let c=YE(i);if(!c.isFile())continue;o=c.mtimeMs}catch{continue}let a=this.#t.get(i);if(a===void 0){if(a=oA(i),a===void 0)continue;this.#t.set(i,a)}Um(a)===r&&s.push({sessionId:ZE(i,".jsonl"),file:i,mtime:o})}return s}#r(){let t=[],r=s=>{try{return VE(s).map(i=>Dl(s,i))}catch{return[]}};for(let s of r(this.root))for(let i of r(s))for(let o of r(i))for(let a of r(o))a.endsWith(".jsonl")&&t.push(a);return t}parseEntry(t){let r;try{r=JSON.parse(t)}catch{return null}return!r||typeof r.type!="string"?null:r}idOf(t){return t.ord===void 0&&(t.ord=String(this.#e++),t.parent=this.#s,this.#s=t.ord),t.ord}parentOf(t){return t.parent}timestampOf(t){return t.timestamp}isSidechain(t){return!1}isLeafType(t){return!0}isRecoveryNoise(t){return!1}apply(t,r){let s=[],i=t.payload;if(!i)return{events:s};let o=()=>{let a=Date.parse(t.timestamp??"");return!isNaN(a)&&a>=r};if(t.type==="response_item"){if(i.type==="message"){if(i.role==="user"){let a=Vr(i.content,!0).trim();a&&s.push({type:"user",text:a})}else if(i.role==="assistant"){let a=Vr(i.content,!1);a&&s.push({type:"assistant",text:a,thinking:"",tools:[],live:o()})}return{events:s}}if(i.type==="reasoning"){let a=Vr(i.summary,!1);return a&&s.push({type:"assistant",text:"",thinking:a,tools:[],live:o()}),{events:s}}if(i.type==="custom_tool_call"||i.type==="function_call"){let a=i.type==="custom_tool_call"?sA(i.input):iA(i.arguments);return s.push({type:"assistant",text:"",thinking:"",tools:[{id:i.call_id??"",name:i.name??"",input:a}],live:o()}),{events:s}}if(i.type==="custom_tool_call_output"||i.type==="function_call_output"){let a=rA(i.output);return s.push({type:"tool_result",id:i.call_id??"",content:a,isError:!1,digest:Le(a)}),{events:s}}return{events:s}}if(t.type==="event_msg"){if(i.type==="token_count"){let a=i.info?.last_token_usage;if(!a)return{events:s};let c={in:Math.max(0,(a.input_tokens??0)-(a.cached_input_tokens??0)),out:a.output_tokens??0,cached:a.cached_input_tokens??0,cacheCreate:a.cache_write_input_tokens??0};return{events:s,usage:c}}return{events:s}}return t.type==="turn_context"?{events:s,model:i.model}:{events:s}}chainWorking(t){let r=!1;for(let s of t){if(s.type!=="event_msg")continue;let i=s.payload?.type;i==="task_started"?r=!0:(i==="task_complete"||i==="turn_aborted")&&(r=!1)}return r}sessionAlive(){}readPreview(t){for(let r of(qm(t,256*1024)?.text??"").split(`
|
|
183
|
-
`))if(r.includes('"user_message"'))try{let s=JSON.parse(r);if(s?.type==="event_msg"&&s.payload?.type==="user_message"&&typeof s.payload.message=="string"){let i=s.payload.message.replace(/\s+/g," ").trim();if(i)return i.slice(0,200)}}catch{}return""}searchText(t){if(t?.type!=="response_item"||t.payload?.type!=="message")return"";let r=t.payload.role;return r!=="user"&&r!=="assistant"?"":Vr(t.payload.content,r==="user").replace(/\s+/g," ").trim()}}});import{realpathSync as aA}from"fs";import{createHash as cA}from"crypto";import{join as Vi,resolve as lA}from"path";import{homedir as uA}from"os";function Et(){let n=process.env.TYPEBULB_SERVERS_DIR;return n?Vi(n,".."):Vi(uA(),".typebulb")}function et(){Jm||(Jm=!0,console.error(`${Et()} not writable \u2014 continuing stateless: ports won't stick, caches stay cold, and typebulb logs/wait/send/stop may not see this run`))}function tt(){return process.env.TYPEBULB_SERVERS_DIR||Vi(Et(),"servers")}function Km(n){let e=X(n),t=cA("sha1").update(e).digest("hex").slice(0,8),r=e.slice(e.lastIndexOf("/")+1).replace(/\.bulb\.md$/,"");return Vi(Et(),"canvas",`${r}-${t}.png`)}function X(n){let e=lA(n),t=e;try{t=aA.native(e)}catch{}return(process.platform==="win32"?t.toLowerCase():t).replace(/\\/g,"/")}function Wm(n,e){let t=X(n),r=X(e);return t.startsWith(r.endsWith("/")?r:r+"/")?!t.includes("/node_modules/"):!1}var Jm,At=v(()=>{"use strict";Jm=!1});var Be,zi=v(()=>{"use strict";Be="0.55.
|
|
183
|
+
`))if(r.includes('"user_message"'))try{let s=JSON.parse(r);if(s?.type==="event_msg"&&s.payload?.type==="user_message"&&typeof s.payload.message=="string"){let i=s.payload.message.replace(/\s+/g," ").trim();if(i)return i.slice(0,200)}}catch{}return""}searchText(t){if(t?.type!=="response_item"||t.payload?.type!=="message")return"";let r=t.payload.role;return r!=="user"&&r!=="assistant"?"":Vr(t.payload.content,r==="user").replace(/\s+/g," ").trim()}}});import{realpathSync as aA}from"fs";import{createHash as cA}from"crypto";import{join as Vi,resolve as lA}from"path";import{homedir as uA}from"os";function Et(){let n=process.env.TYPEBULB_SERVERS_DIR;return n?Vi(n,".."):Vi(uA(),".typebulb")}function et(){Jm||(Jm=!0,console.error(`${Et()} not writable \u2014 continuing stateless: ports won't stick, caches stay cold, and typebulb logs/wait/send/stop may not see this run`))}function tt(){return process.env.TYPEBULB_SERVERS_DIR||Vi(Et(),"servers")}function Km(n){let e=X(n),t=cA("sha1").update(e).digest("hex").slice(0,8),r=e.slice(e.lastIndexOf("/")+1).replace(/\.bulb\.md$/,"");return Vi(Et(),"canvas",`${r}-${t}.png`)}function X(n){let e=lA(n),t=e;try{t=aA.native(e)}catch{}return(process.platform==="win32"?t.toLowerCase():t).replace(/\\/g,"/")}function Wm(n,e){let t=X(n),r=X(e);return t.startsWith(r.endsWith("/")?r:r+"/")?!t.includes("/node_modules/"):!1}var Jm,At=v(()=>{"use strict";Jm=!1});var Be,zi=v(()=>{"use strict";Be="0.55.2"});import{spawn as Hm}from"child_process";import{readdir as dA,readFile as Vm,writeFile as zm,unlink as Fl,mkdir as fA}from"fs/promises";import{mkdirSync as Gm,writeFileSync as Gi,appendFileSync as pA,readFileSync as Ul}from"fs";import*as xe from"path";import{fileURLToPath as hA}from"url";function ql(n){return xe.join(tt(),`${n}.json`)}function Gr(n){return xe.join(tt(),`${n}.log`)}function Jl(n){return xe.join(tt(),`${n}.wait.json`)}function Xm(n){try{let e=JSON.parse(Ul(Jl(n),"utf8"));return e.cursors&&typeof e.cursors=="object"?e.cursors:{}}catch{return{}}}function Kl(n,e=""){let t=Xm(n)[e];return typeof t=="number"&&Number.isFinite(t)&&t>=0?t:void 0}function Xi(n,e,t=""){try{Gm(tt(),{recursive:!0});let r=Xm(n);r[t]=e,Gi(Jl(n),JSON.stringify({cursors:r}))}catch{}}function Qi(n){let e=Gr(n);try{Gm(tt(),{recursive:!0}),Gi(e,"")}catch{return()=>{}}let t=process.stdout.write.bind(process.stdout),r=process.stderr.write.bind(process.stderr),s=0,i=!1,o=a=>{if(!i)try{let c=typeof a=="string"?Buffer.from(a,"utf8"):Buffer.from(a);if(pA(e,c),s+=c.length,s>2*Ym){let l=Ul(e),f=l.subarray(Math.max(0,l.length-Ym));Gi(e,f),s=f.length}}catch{i=!0}};return process.stdout.write=((a,...c)=>(o(a),t(a,...c))),process.stderr.write=((a,...c)=>(o(a),r(a,...c))),()=>{process.stdout.write=t,process.stderr.write=r}}function Qm(n){try{Gi(Gr(n),"")}catch{}}function He(n,e=0){try{let t=Ul(Gr(n)),r=e>=0&&e<=t.length?e:0;return{text:t.subarray(r).toString("utf8"),offset:t.length}}catch{return{text:"",offset:0}}}function Wl(n){return`\u2500\u2500 run ${n} \u2500\u2500 ${new Date().toTimeString().slice(0,8)}`}function gA(n){let e=mA.exec(n);return e?Number(e[1]):void 0}function Zm(n,e){let t=n.split(`
|
|
184
184
|
`),r=[];if(t.forEach((o,a)=>{let c=gA(o);c!==void 0&&r.push({id:c,idx:a})}),!r.length)return e==="latest"?n:"";let s=e==="latest"?r[r.length-1]:r.find(o=>o.id===e);if(!s)return"";let i=r.find(o=>o.idx>s.idx);return t.slice(s.idx,i?i.idx:t.length).join(`
|
|
185
185
|
`)}function Hl(n){try{return process.kill(n,0),!0}catch(e){return e.code==="EPERM"}}async function eg(n){try{await fA(tt(),{recursive:!0}),await zm(ql(n.pid),JSON.stringify({version:Be,...n}))}catch{et()}}async function tg(n,e){let t=ql(n);try{let r=JSON.parse(await Vm(t,"utf8"));if(r.denied===e)return;r.denied=e,await zm(t,JSON.stringify(r))}catch{}}async function zr(n){await Fl(ql(n)).catch(()=>{}),await Fl(Gr(n)).catch(()=>{}),await Fl(Jl(n)).catch(()=>{})}async function Q(n){let e;try{e=await dA(tt())}catch{return[]}let t=[];return await Promise.all(e.map(async s=>{if(!/^\d+\.json$/.test(s))return;let i=parseInt(s,10),o;try{o=JSON.parse(await Vm(xe.join(tt(),s),"utf8"))}catch{await zr(i);return}o&&typeof o.pid=="number"&&Hl(o.pid)?t.push(o):await zr(i)})),(n?t.filter(s=>s.agent==null&&Wm(s.file,n)):t).sort((s,i)=>s.startedAt-i.startedAt)}async function Yl(n,e){let t=X(n);return(await Q()).find(r=>r.cwd!=null&&X(r.cwd)===t&&(e?r.agent===e:r.agent!=null))}async function Yt(n){try{process.kill(n,"SIGTERM")}catch{}await zr(n)}function Rn(n,e){let t=X(e);return n.filter(r=>r.agent==null&&r.pid!==process.pid&&X(r.file)===t)}async function Vl(n){let e=Rn(await Q(),n);for(let t of e)await Yt(t.pid);return e}function bA(n,e,t){(process.platform==="win32"?Hm("cmd",["/c","start","","/b",n,...e],{cwd:t,stdio:"ignore",windowsHide:!0}):Hm(n,e,{cwd:t,detached:!0,stdio:"ignore"})).unref()}function Xr(){return xe.join(xe.dirname(hA(import.meta.url)),"index.js")}function wA(n,e={}){return{command:process.execPath,args:[Xr(),...e.trust?["--trust"]:[],...e.batch?["--batch",e.batch]:[],...e.mode?["--mode",e.mode]:[],n,...e.open===!1?["--no-open"]:[]]}}function vA(n){return{command:process.execPath,args:[Xr(),`agent:${n}`,"--no-open"]}}async function ng(n,e,t,r){let s=await n();if(s)return s;bA(e.command,e.args,t);let i=Date.now()+2e4;for(;Date.now()<i;){await yA(150);let o=await n();if(o)return o}throw new Error(`Launched ${r} but it did not register within 20s.`)}async function Zi(n,e={}){let t=e.cwd??process.cwd(),r=xe.resolve(t,n),[s]=await Vl(r),i={...e,batch:e.batch??s?.batch,mode:e.mode??s?.mode};return ng(async()=>Rn(await Q(),r)[0],wA(n,i),t,xe.basename(n))}async function rg(n,e=process.cwd()){return ng(()=>Yl(e,n),vA(n),e,`the ${n} mirror`)}var Ym,mA,yA,Ee=v(()=>{"use strict";At();zi();Ym=1e6;mA=/^── run (\d+) ── /;yA=n=>new Promise(e=>setTimeout(e,n))});function In(n){return{...pf(n),server:n.files.get("server.ts")??""}}function eo(n){return!!n.server&&!n.code}var Qr=v(()=>{"use strict";ne();ne()});function to(n){let e=/^---[^\n]*\n([\s\S]*?)\n---/.exec(n),t=e?/^\s*name:\s*(.+?)\s*$/m.exec(e[1]):null;return t?t[1].replace(/^["']|["']$/g,""):void 0}function zl(n){return On(to(n)??"bulb")||"bulb"}var Gl=v(()=>{"use strict";ne()});import{transform as SA}from"sucrase";function Xl(n,e={}){let t=e.serverOnly?["typescript"]:["typescript","jsx"];try{let{code:r}=SA(n,{transforms:t,jsxRuntime:"automatic",jsxImportSource:e.jsxImportSource||"react",production:!0});return{code:r}}catch(r){return{code:"",error:String(r)}}}var sg=v(()=>{});function Ql(n){let e=n.split(""),t=(i,o)=>{for(let a=i;a<o&&a<e.length;a++)e[a]!==`
|
|
186
186
|
`&&(e[a]=" ")},r=0,s="";for(;r<n.length;){let i=n[r],o=n[r+1];if(i==="/"&&o==="/"){let a=r;for(;a<n.length&&n[a]!==`
|