@promptctl/cc-candybar 1.181.1 → 1.182.0
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/dist/index.mjs +2 -2
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import{createRequire as e}from"node:module";import t from"node:process";import{URL as n,URLSearchParams as r,fileURLToPath as i}from"node:url";import{json as a}from"node:stream/consumers";import o from"node:os";import{spawn as s,spawnSync as c}from"node:child_process";import l,{closeSync as u,constants as d,existsSync as f,fstatSync as p,linkSync as m,mkdtempSync as h,openSync as g,readFileSync as _,readSync as v,rmSync as y,statSync as b,writeFileSync as x}from"node:fs";import{StringDecoder as S}from"node:string_decoder";import{inspect as C,parseArgs as w,types as ee}from"node:util";import{clearImmediate as T,setImmediate as te}from"node:timers";import E,{basename as ne,dirname as D,isAbsolute as O,join as re,sep as k}from"node:path";import ie,{createHash as ae,createHmac as oe,randomBytes as se,randomUUID as ce,timingSafeEqual as le}from"node:crypto";import ue from"node:net";import de from"node:v8";import{open as fe,readFile as pe,readdir as me,stat as he}from"node:fs/promises";import{get as ge}from"node:https";import{WriteStream as _e}from"node:tty";import{createInterface as ve}from"node:readline";var ye=Object.create,be=Object.defineProperty,xe=Object.getOwnPropertyDescriptor,Se=Object.getOwnPropertyNames,Ce=Object.getPrototypeOf,we=Object.prototype.hasOwnProperty,Te=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),Ee=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=Se(t),a=0,o=i.length,s;a<o;a++)s=i[a],!we.call(e,s)&&s!==n&&be(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=xe(t,s))||r.enumerable});return e},De=(e,t,n)=>(n=e==null?{}:ye(Ce(e)),Ee(t||!e||!e.__esModule?be(n,`default`,{value:e,enumerable:!0}):n,e));let Oe=!1;const ke=()=>Oe;function Ae(e){Oe=e}function je(e){return ke()?`[DEBUG] ${e()}\n`:``}function A(e,...t){ke()&&console.error(`[DEBUG] ${e}`,...t)}function Me(e){let t=null;return([n,r])=>{r!==t&&(t=r,e(n,r))}}const Ne=(e,t)=>A(t);function Pe(e,t){return ee.isNativeError(e)?e.code===`ENOENT`&&t!==void 0&&!f(t)?`working directory does not exist: ${t}`:e.message:String(e)}const Fe={"click.pbcopy":1e3,"click.open":1e3,"doctor.tmux":1e3,"doctor.font":1e3,"doctor.process":1e3,"claude-input.type":1e3};function Ie(e,t,n){let r=Fe[t];if(r===void 0)return{allowed:!0};let i=e.get(t);if(i===void 0)return{allowed:!0};let a=n-i;return a>=r?{allowed:!0}:{allowed:!1,minIntervalMs:r,sinceLastMs:a}}function Le(e,t){return{...e.inherited,...t.envOverlay}}const Re=({reason:e})=>({ok:!1,reason:`aborted`,stdout:``,stderr:``,exitCode:null,signal:null,error:e instanceof Error?e.message:String(e)});function ze(e,t,n){return{ok:!1,reason:`rate-limited`,stdout:``,stderr:``,exitCode:null,signal:null,error:`rate-limited: ${e} min interval ${t}ms, last start ${n}ms ago`}}function Be(e,t){let n=t.finally(()=>e.ending.delete(n));return e.ending.add(n),n}function Ve(e,t,n){let r=He(e,t,n);return r===null?(e.lastStartAt.set(t,e.scope.clock.now()),null):(e.scope.stats?.onRefused(t),r)}function He(e,t,n){if(e.scope.signal.aborted)return Re(e.scope.signal);if(n?.aborted)return Re(n);let r=Ie(e.lastStartAt,t,e.scope.clock.now());return r.allowed?null:ze(t,r.minIntervalMs,r.sinceLastMs)}const Ue=`\$1 == "+" { live[\$2] = 1; next } \$1 == "-" { delete live[\$2]; next } END { for (g in live) groups = groups " -" g; if (groups != "") system("kill -TERM" groups " 2>/dev/null; sleep ${250/1e3}; kill -KILL" groups " 2>/dev/null") }`;function We(e,t){t!==e.fault&&(e.fault=t,e.scope.observeLifeline(t))}function Ge(e,t,n){e.lifeline?.process===t&&(e.lifeline=null,t.ref(),We(e,n))}function Ke(e){return e.fault===null?[]:[{kind:`lifeline`,message:`programs launched now would outlive their launcher if it died: its launch lifeline ${e.fault}, and the next launch starts another`}]}function qe(e){let{stats:t,clock:n}=e.scope;t?.onStart(`lifeline`);let r=n.now(),i;try{i=s(`awk`,[Ue],{stdio:[`pipe`,`ignore`,`ignore`],detached:!0})}catch(i){return t?.onEnd(`lifeline`,n.now()-r),We(e,`did not start: ${Pe(i,void 0)}`),null}t?.onEnd(`lifeline`,n.now()-r);let a=i.stdin;if(a==null)return i.once(`error`,t=>We(e,`did not start: ${t.message}`)),null;i.once(`spawn`,()=>{e.lifeline?.process===i&&We(e,null)}),i.once(`error`,t=>Ge(e,i,`failed: ${t.message}`)),i.once(`exit`,(t,n)=>Ge(e,i,`exited ${n??t}`)),a.on(`error`,t=>Ge(e,i,`pipe failed: ${t.message}`)),Be(e,new Promise(e=>i.once(`close`,e))),i.unref(),a.unref();for(let t of e.liveGroups)a.write(`+ ${t}\n`);return{process:i,pipe:a}}function Je(e,t){e.liveGroups.add(t),e.lifeline??=qe(e),e.lifeline?.pipe.write(`+ ${t}\n`)}function Ye(e,t){e.liveGroups.delete(t),e.lifeline?.pipe.write(`- ${t}\n`)}function Xe(e){let t=e.lifeline;e.lifeline=null,t?.process.ref(),t?.pipe.end()}const Ze=16*1024*1024,Qe=`output exceeded ${Ze} bytes`;function $e(e,t){try{process.kill(-e,t)}catch(t){let n=t.code;if(n!==`ESRCH`&&!(n===`EPERM`&&!et(e)))throw t}}function et(e){try{return process.kill(e,0),!1}catch(e){return e.code===`EPERM`}}function tt(e,t,n,r){let{stats:i}=e.scope,a=new S(`utf8`),o=``,s=0,c=0,l=r,u=`closed`;return n?.on(`error`,()=>i?.onPipeError(t)),n?.on(`data`,e=>{if(l===null){if(c+=e.length,i?.onDrainRead(t,e.length),c<=16777216)return;u=`cut`,n.destroy();return}let r=Math.max(0,Ze-s);o+=a.write(e.subarray(0,r)),s+=e.length,s>16777216&&l()}),{take:()=>{if(l===null)return``;l=null;let e=o+a.end();return o=``,e},drain:()=>{n===null||n.destroyed||n.readableEnded||nt(e,t,n,()=>u)}}}function nt(e,t,n,r){let{stats:i}=e.scope;if(e.scope.signal.aborted){n.destroy();return}n.once(`close`,()=>{e.drains.delete(n),i?.onDrainClose(t,r())}),n.unref(),e.drains.add(n),i?.onDrainOpen(t)}const rt=()=>`closed`;function it(e,t){e.on(`error`,()=>{}),e.end(t)}async function at(e,t){let{stats:n,clock:r}=e.scope,i=Ve(e,t.category,t.signal);if(i!==null)return i;let a=r.now();return n?.onStart(t.category),new Promise(i=>{let o;try{o=s(t.bin,t.args??[],{cwd:t.cwd,env:Le(e.scope,t),stdio:[`pipe`,`pipe`,`pipe`],detached:!0})}catch(e){n?.onEnd(t.category,r.now()-a),i({ok:!1,reason:`spawn-error`,stdout:``,stderr:``,exitCode:null,signal:null,error:Pe(e,t.cwd)});return}let c=o.pid;c!==void 0&&Je(e,c);let l=new Promise(e=>o.once(`exit`,e)),u=o.stdin;o.stdin=null;let d=()=>T(`output-limit`),f=tt(e,t.category,o.stdout,d),p=tt(e,t.category,o.stderr,d),m=()=>({stdout:f.take(),stderr:p.take()}),h=!1,g=null,_=null,v=null,y=null,b=()=>T(`aborted`),x=()=>{t.signal?.removeEventListener(`abort`,b),e.inFlight.delete(b)},S=i=>{h||(h=!0,g?.(),_?.(),v?.(),x(),c!==void 0&&Ye(e,c),n?.onEnd(t.category,r.now()-a),o.off(`close`,E),o.off(`error`,te),f.drain(),p.drain(),u!==null&&!u.destroyed&&!u.writableFinished&&nt(e,t.category,u,rt),i())},C=e=>S(()=>i(e)),w=(n,r)=>{try{$e(n,r)}catch(n){e.unreaped.set(o,t.category),l.then(()=>e.unreaped.delete(o)),C({ok:!1,reason:`signal-refused`,...m(),exitCode:null,signal:null,error:n instanceof Error?n.message:String(n)})}},ee=()=>E(o.exitCode,o.signalCode);if(c!==void 0){let e=t=>{if(!h){if(mt(c)){r.defer(ee);return}v=r.after(t,()=>e(Math.min(t*2,1e3)))}};l.then(()=>r.defer(()=>e(25)))}let T=e=>{if(y!==null)return;if((o.exitCode!==null||o.signalCode!==null)&&c!==void 0&&mt(c)){y=e===`timeout`?null:e,r.defer(ee);return}y=e,g?.(),x();let t=o.pid;t!==void 0&&(_=r.after(250,()=>{w(t,`SIGKILL`),l.then(()=>r.defer(ee))}),w(t,`SIGTERM`))},te=e=>{C({ok:!1,reason:`spawn-error`,...m(),exitCode:null,signal:null,error:Pe(e,t.cwd)})};o.on(`error`,te);let E=(e,t)=>{if(y!==null){C({ok:!1,reason:y,...m(),exitCode:e,signal:t,...y===`output-limit`?{error:Qe}:{}});return}if(e===0){C({ok:!0,...m(),exitCode:e});return}C({ok:!1,reason:t?`signal`:`non-zero`,...m(),exitCode:e,signal:t})};o.on(`close`,E),t.timeoutMs&&t.timeoutMs>0&&(g=r.after(t.timeoutMs,()=>T(`timeout`))),t.signal?.addEventListener(`abort`,b,{once:!0}),e.inFlight.add(b),u!==null&&it(u,t.stdinInput)})}function ot(e,t){let{stats:n,clock:r}=e.scope,i=Ve(e,t.category);if(i!==null)return i;let a=r.now();n?.onStart(t.category);let o=[`pipe`,`pipe`,`pipe`];try{let i=c(t.bin,t.args??[],{cwd:t.cwd,env:Le(e.scope,t),input:t.stdinInput,timeout:t.timeoutMs&&t.timeoutMs>0?t.timeoutMs:void 0,stdio:o,encoding:`utf8`});n?.onEnd(t.category,r.now()-a);let s=typeof i.stdout==`string`?i.stdout:``,l=typeof i.stderr==`string`?i.stderr:``,u=i.error?.code;return i.error&&u!==`EPIPE`&&u!==`ECONNRESET`?{ok:!1,reason:u===`ETIMEDOUT`?`timeout`:`spawn-error`,stdout:s,stderr:l,exitCode:null,signal:i.signal??null,error:Pe(i.error,t.cwd)}:i.status===0?{ok:!0,stdout:s,stderr:l,exitCode:i.status}:{ok:!1,reason:i.signal?`signal`:`non-zero`,stdout:s,stderr:l,exitCode:i.status,signal:i.signal??null}}catch(e){return n?.onEnd(t.category,r.now()-a),{ok:!1,reason:`spawn-error`,stdout:``,stderr:``,exitCode:null,signal:null,error:Pe(e,t.cwd)}}}function st(e,t){let{stats:n,clock:r}=e.scope,i=Ve(e,t.category);if(i!==null)return i;let a=r.now();n?.onStart(t.category);let o=ct(e.scope,t);return n?.onEnd(t.category,r.now()-a),o}function ct(e,t){let n;try{n=s(t.bin,t.args??[],{cwd:t.cwd,env:Le(e,t),detached:!0,stdio:`ignore`})}catch(e){return{ok:!1,reason:`spawn-error`,stdout:``,stderr:``,exitCode:null,signal:null,error:Pe(e,t.cwd)}}return n.once(`error`,()=>{}),n.pid===void 0?{ok:!1,reason:`spawn-error`,stdout:``,stderr:``,exitCode:null,signal:null,error:`spawn(${t.bin}): no pid (binary not found or unexecutable)`}:(n.unref(),{ok:!0,stdout:``,stderr:``,exitCode:null})}const lt=e=>e.kind===`exit`?`exit ${e.code}`:`timeout`;function ut(e,t,n){let{stats:r,clock:i}=e.scope,a=Ve(e,t.category);if(a!==null)return{ok:!1,reason:a.reason,error:a.error};let o=i.now();r?.onStart(t.category);let c;try{c=s(`/bin/sh`,[`-c`,`out=$1 err=$2 status=$3; shift 3; read go || exit 0; "$@" >"$out" 2>"$err" </dev/null; echo "exit $?" >"$status.$$" && ln "$status.$$" "$status"; rm -f "$status.$$"`,`sh`,n.stdout,n.stderr,n.status,t.bin,...t.args??[]],{cwd:t.cwd,env:Le(e.scope,t),detached:!0,stdio:[`pipe`,`ignore`,`ignore`]})}catch(e){return r?.onEnd(t.category,i.now()-o),{ok:!1,reason:`spawn-error`,error:Pe(e,t.cwd)}}r?.onEnd(t.category,i.now()-o),c.once(`error`,()=>{});let l=c.pid,u=c.stdin;return u.on(`error`,()=>{}),l===void 0?(u.destroy(),{ok:!1,reason:`spawn-error`,error:`spawn(/bin/sh): no pid (shell not found or unexecutable)`}):(c.unref(),u.unref(),{ok:!0,pid:l,release:()=>u.end(`go
|
|
3
|
-
`),withdraw:()=>u.end()})}function dt(e){let t;try{t=_(e,`utf8`).trim()}catch(e){if(e.code===`ENOENT`)return null;throw e}let n=/^exit (\d+)$/.exec(t);if(n)return{kind:`exit`,code:Number(n[1])};if(t===`timeout`)return{kind:`timeout`};throw Error(`${e}: not a job verdict: ${JSON.stringify(t)}`)}function ft(e,t){try{return process.kill(-e,t),!0}catch(e){let t=e.code;if(t===`ESRCH`||t===`EPERM`)return!1;throw e}}function pt(e){return ft(e,0)}function mt(e){try{return process.kill(-e,0),!1}catch(e){return e.code===`ESRCH`}}function ht(e,t,n,r){let i=`${t}.${process.pid}`;try{x(i,`${lt(n)}\n`)}catch(e){if(e.code===`ENOENT`)return{stands:!1,signalled:!1};throw e}let a=!0;try{m(i,t)}catch(e){if(e.code!==`EEXIST`)throw e;a=!1}finally{y(i,{force:!0})}let o=ft(e,`SIGTERM`);return o&&r.after(250,()=>ft(e,`SIGKILL`),{unref:!0}),{stands:a,signalled:o}}function gt(e,t){return vt(e,t).launcher}function _t(e,t){let{launcher:n,state:r}=vt(e,t);return{...n,launchSync:e=>ot(r,e)}}function vt(e,t){let n={clock:t,launch:e=>Be(r,at(r,e)),launchDetachedSync:e=>st(r,e),launchJobSync:(e,t)=>ut(r,e,t),lifelineWarnings:()=>Ke(r),settled:async()=>(await Promise.all(r.ending),{unreaped:[...r.unreaped.values()]}),__lifelineForTest:()=>{let e=r.lifeline;return{pid:e?.process.pid,cut:()=>{e?.pipe.end(),e&&Ge(r,e.process,`cut by a test`)}}}},r={scope:{stats:null,observeLifeline:()=>n.lifelineWarnings().forEach(e=>process.emitWarning(e.message)),signal:new AbortController().signal,...e,clock:t},lastStartAt:new Map,inFlight:new Set,liveGroups:new Set,lifeline:null,fault:null,ending:new Set,unreaped:new Map,drains:new Set};return r.scope.signal.addEventListener(`abort`,()=>{r.inFlight.forEach(e=>e()),r.drains.forEach(e=>e.destroy()),Xe(r)},{once:!0}),{launcher:n,state:r}}const yt={now:()=>Date.now(),monotonic:()=>performance.now(),after:(e,t,n)=>{let r=setTimeout(t,e);return n?.unref&&r.unref(),()=>clearTimeout(r)},every:(e,t,n)=>{let r=setInterval(t,e);return n?.unref&&r.unref(),()=>clearInterval(r)},defer:e=>{let t=te(e);return()=>T(t)}};function bt(e,t,n){return new Promise((r,i)=>{let a=()=>Object.assign(Error(`The operation was aborted`),{name:`AbortError`,code:`ABORT_ERR`,cause:n?.reason});if(n?.aborted){i(a());return}let o=()=>{s(),i(a())},s=e.after(t,()=>{n?.removeEventListener(`abort`,o),r()});n?.addEventListener(`abort`,o,{once:!0})})}function xt(e,t){let n=new AbortController;return e.after(t,()=>n.abort(new DOMException(`The operation was aborted due to timeout`,`TimeoutError`)),{unref:!0}),n.signal}function St(){let e={env:process.env,home:o.homedir(),tmp:o.tmpdir()},t=yt;return{host:e,launcher:_t({inherited:process.env},t),clock:t}}const Ct=/^[A-Za-z0-9_./,:@%+-][A-Za-z0-9_./,:@%+=-]*$/;function wt(e){return`'${e.replaceAll(`'`,`'\\''`)}'`}function Tt(e){return Ct.test(e)?e:wt(e)}function Et(e){return`${e.dir===void 0?``:`cd ${Tt(e.dir)} && `}${e.env.map(([e,t])=>`${e}=${Tt(t)} `).join(``)}${[e.program,...e.args].map(Tt).join(` `)}`}const Dt=`cc-extra`;function Ot(e){return E.join(E.dirname(e),Dt,`src`,`bun-attach.js`)}function kt(e){return E.join(E.dirname(e),`bun-graph.js`)}const At=`attach-preload.cjs`;function jt(e){return E.join(E.dirname(e),At)}function Mt(e,t){return Et({...t,env:[...t.env,[`BUN_OPTIONS`,`--preload ${e.replace(/[\\\s]/g,`\\$&`)}`]]})}const Nt=e=>!e.startsWith(`.`)&&!e.endsWith(`~`);function Pt(e,t){return t.isSymbolicLink()?Buffer.from(l.readlinkSync(e)):l.readFileSync(e)}function Ft(e,t,n=Nt){return l.readdirSync(t).filter(n).sort().flatMap(n=>{let r=E.join(t,n),i=l.lstatSync(r,{throwIfNoEntry:!1});return i===void 0?[]:i.isDirectory()?Ft(e,r):[[E.relative(e,r).split(E.sep).join(`/`),Pt(r,i)]]})}function It(e){let t=ie.createHash(`sha256`);for(let[n,r]of e)t.update(n).update(`\0`).update(r).update(`\0`);return t.digest(`hex`)}function Lt(e){return It(Ft(e,e))}const Rt=[`Cargo.toml`,`Cargo.lock`,`src`];function zt(e){return It(Ft(e,e,e=>Rt.includes(e)))}const Bt=e=>e.slice(0,7),Vt=`1.
|
|
3
|
+
`),withdraw:()=>u.end()})}function dt(e){let t;try{t=_(e,`utf8`).trim()}catch(e){if(e.code===`ENOENT`)return null;throw e}let n=/^exit (\d+)$/.exec(t);if(n)return{kind:`exit`,code:Number(n[1])};if(t===`timeout`)return{kind:`timeout`};throw Error(`${e}: not a job verdict: ${JSON.stringify(t)}`)}function ft(e,t){try{return process.kill(-e,t),!0}catch(e){let t=e.code;if(t===`ESRCH`||t===`EPERM`)return!1;throw e}}function pt(e){return ft(e,0)}function mt(e){try{return process.kill(-e,0),!1}catch(e){return e.code===`ESRCH`}}function ht(e,t,n,r){let i=`${t}.${process.pid}`;try{x(i,`${lt(n)}\n`)}catch(e){if(e.code===`ENOENT`)return{stands:!1,signalled:!1};throw e}let a=!0;try{m(i,t)}catch(e){if(e.code!==`EEXIST`)throw e;a=!1}finally{y(i,{force:!0})}let o=ft(e,`SIGTERM`);return o&&r.after(250,()=>ft(e,`SIGKILL`),{unref:!0}),{stands:a,signalled:o}}function gt(e,t){return vt(e,t).launcher}function _t(e,t){let{launcher:n,state:r}=vt(e,t);return{...n,launchSync:e=>ot(r,e)}}function vt(e,t){let n={clock:t,launch:e=>Be(r,at(r,e)),launchDetachedSync:e=>st(r,e),launchJobSync:(e,t)=>ut(r,e,t),lifelineWarnings:()=>Ke(r),settled:async()=>(await Promise.all(r.ending),{unreaped:[...r.unreaped.values()]}),__lifelineForTest:()=>{let e=r.lifeline;return{pid:e?.process.pid,cut:()=>{e?.pipe.end(),e&&Ge(r,e.process,`cut by a test`)}}}},r={scope:{stats:null,observeLifeline:()=>n.lifelineWarnings().forEach(e=>process.emitWarning(e.message)),signal:new AbortController().signal,...e,clock:t},lastStartAt:new Map,inFlight:new Set,liveGroups:new Set,lifeline:null,fault:null,ending:new Set,unreaped:new Map,drains:new Set};return r.scope.signal.addEventListener(`abort`,()=>{r.inFlight.forEach(e=>e()),r.drains.forEach(e=>e.destroy()),Xe(r)},{once:!0}),{launcher:n,state:r}}const yt={now:()=>Date.now(),monotonic:()=>performance.now(),after:(e,t,n)=>{let r=setTimeout(t,e);return n?.unref&&r.unref(),()=>clearTimeout(r)},every:(e,t,n)=>{let r=setInterval(t,e);return n?.unref&&r.unref(),()=>clearInterval(r)},defer:e=>{let t=te(e);return()=>T(t)}};function bt(e,t,n){return new Promise((r,i)=>{let a=()=>Object.assign(Error(`The operation was aborted`),{name:`AbortError`,code:`ABORT_ERR`,cause:n?.reason});if(n?.aborted){i(a());return}let o=()=>{s(),i(a())},s=e.after(t,()=>{n?.removeEventListener(`abort`,o),r()});n?.addEventListener(`abort`,o,{once:!0})})}function xt(e,t){let n=new AbortController;return e.after(t,()=>n.abort(new DOMException(`The operation was aborted due to timeout`,`TimeoutError`)),{unref:!0}),n.signal}function St(){let e={env:process.env,home:o.homedir(),tmp:o.tmpdir()},t=yt;return{host:e,launcher:_t({inherited:process.env},t),clock:t}}const Ct=/^[A-Za-z0-9_./,:@%+-][A-Za-z0-9_./,:@%+=-]*$/;function wt(e){return`'${e.replaceAll(`'`,`'\\''`)}'`}function Tt(e){return Ct.test(e)?e:wt(e)}function Et(e){return`${e.dir===void 0?``:`cd ${Tt(e.dir)} && `}${e.env.map(([e,t])=>`${e}=${Tt(t)} `).join(``)}${[e.program,...e.args].map(Tt).join(` `)}`}const Dt=`cc-extra`;function Ot(e){return E.join(E.dirname(e),Dt,`src`,`bun-attach.js`)}function kt(e){return E.join(E.dirname(e),`bun-graph.js`)}const At=`attach-preload.cjs`;function jt(e){return E.join(E.dirname(e),At)}function Mt(e,t){return Et({...t,env:[...t.env,[`BUN_OPTIONS`,`--preload ${e.replace(/[\\\s]/g,`\\$&`)}`]]})}const Nt=e=>!e.startsWith(`.`)&&!e.endsWith(`~`);function Pt(e,t){return t.isSymbolicLink()?Buffer.from(l.readlinkSync(e)):l.readFileSync(e)}function Ft(e,t,n=Nt){return l.readdirSync(t).filter(n).sort().flatMap(n=>{let r=E.join(t,n),i=l.lstatSync(r,{throwIfNoEntry:!1});return i===void 0?[]:i.isDirectory()?Ft(e,r):[[E.relative(e,r).split(E.sep).join(`/`),Pt(r,i)]]})}function It(e){let t=ie.createHash(`sha256`);for(let[n,r]of e)t.update(n).update(`\0`).update(r).update(`\0`);return t.digest(`hex`)}function Lt(e){return It(Ft(e,e))}const Rt=[`Cargo.toml`,`Cargo.lock`,`src`];function zt(e){return It(Ft(e,e,e=>Rt.includes(e)))}const Bt=e=>e.slice(0,7),Vt=`1.182.0`;function Ht(e){let t=E.dirname(E.dirname(e));return l.existsSync(E.join(t,`src`))?t:null}function Ut(e){if(e===null)throw Error("this bundle carries no source digest (build via `pnpm build`, which stamps it)");return{version:Vt,digest:e}}function j(){return`3e84cd49ee767c5851e286d85f84f2502149c12d691c2a06342ba788c4c10d0c`}function Wt(e){let t=JSON.parse(l.readFileSync(E.join(e,`package.json`),`utf8`)),n=typeof t==`object`&&t?t.version:void 0;if(typeof n!=`string`)throw Error(`${E.join(e,`package.json`)} has no version string`);return n}function Gt(e,t){try{let n=Ht(i(e));if(n===null)return{kind:`not-source-checkout`};let r=t(),a=Lt(E.join(n,`src`));return a===r.digest?{kind:`current`,root:n,stamp:r}:{kind:`stale`,root:n,source:{version:Wt(n),digest:a},running:r}}catch(e){return{kind:`unchecked`,reason:e.message}}}function Kt(e,t){let n=e[t];return n&&n.length>0?n:void 0}function qt(e){let t=Kt(e.env,`XDG_STATE_HOME`)??E.join(e.home,`.local`,`state`);return E.join(t,`cc-candybar`)}function Jt(e){let t=Kt(e.env,`XDG_CACHE_HOME`)??E.join(e.home,`.cache`);return E.join(t,`cc-candybar`)}function Yt(e){return qt(e)}function M(e){return e.env.CC_CANDYBAR_SOCKET||Xt()}function Xt(){let e=o.userInfo().uid;return E.join(`/tmp`,`cc-candybar-${e}`,`socket`)}function Zt(e){l.mkdirSync(e,{recursive:!0,mode:448});let t=l.lstatSync(e);if(t.isSymbolicLink())throw Error(`directory is a symlink: ${e}`);if(!t.isDirectory())throw Error(`not a directory: ${e}`);let n=o.userInfo().uid;if(typeof n==`number`&&t.uid!==n)throw Error(`directory is not owned by uid ${n}: ${e} (owner uid=${t.uid})`);if(t.mode&63)throw Error(`directory has unsafe permissions: ${e} (mode=${(t.mode&511).toString(8)}, expected 0700)`)}function Qt(e){Zt(E.dirname(e));for(let t of[e,$t(e)])try{if(l.lstatSync(t).isSymbolicLink())throw Error(`path is a symlink: ${t}`)}catch(e){if(e.code!==`ENOENT`)throw e}}function $t(e){return`${e}.lease`}function en(e){return $t(M(e))}function tn(e){return E.join(qt(e),`session-state.json`)}function nn(e){return E.join(qt(e),`settings-history.json`)}function rn(e){let t=e.env.CC_CANDYBAR_DAEMON_REGISTRY_DIR;if(t)return t;let n=o.userInfo().uid;return E.join(`/tmp`,`cc-candybar-${n}`,`daemons`)}function an(e){return E.join(qt(e),`spawn.lock`)}function on(e){return E.join(qt(e),`spawn.cooldown`)}function sn(e){return E.join(qt(e),`spawn.backoff`)}function cn(e){return E.join(qt(e),`watch-probe`)}function ln(e){return E.join(qt(e),`daemon.log`)}function un(e){return{socket:M(e),lease:en(e),state:qt(e),registry:rn(e),log:ln(e),sessionState:tn(e),settingsHistory:nn(e),watchProbe:cn(e),spawnBackoff:sn(e)}}function dn(e){let{env:t}=e,n=`/usr/local/share:/usr/share`,r=process.platform===`darwin`?`${E.join(Kt(t,`HOMEBREW_PREFIX`)??`/opt/homebrew`,`share`)}:${n}`:n;return{home:e.home,configHome:Kt(t,`XDG_CONFIG_HOME`)??E.join(e.home,`.config`),dataHome:Kt(t,`XDG_DATA_HOME`)??E.join(e.home,`.local`,`share`),dataDirs:(Kt(t,`XDG_DATA_DIRS`)??r).split(`:`).filter(e=>e!==``)}}function fn(e,t,n){let r=pn(e);l.mkdirSync(E.dirname(r),{recursive:!0});let i=`${r}.tmp`,a=n??l.statSync(r,{throwIfNoEntry:!1})?.mode;try{l.writeFileSync(i,t,a===void 0?{}:{mode:a}),l.renameSync(i,r)}catch(e){throw l.rmSync(i,{force:!0}),e}}function pn(e){return mn(e).at(-1)}function mn(e){let{hops:t,stopped:n}=hn(e);if(n!==null)throw n;return t}function hn(e){let t=[e];try{for(let e=0;e<_n;e++){let e=gn(t[t.length-1]);if(e===null)return{hops:t,stopped:null};t.push(e)}return{hops:t,stopped:Error(`${e}: more than ${_n} symbolic links`)}}catch(e){return{hops:t,stopped:e}}}function gn(e){try{return l.lstatSync(e).isSymbolicLink()?E.resolve(l.realpathSync(E.dirname(e)),l.readlinkSync(e)):null}catch(e){let{code:t}=e;if(t===`ENOENT`||t===`ENOTDIR`)return null;throw e}}const _n=40,vn=[`TERM_PROGRAM`,`TERM_PROGRAM_VERSION`,`TERM`,`ITERM_PROFILE`,`XDG_CONFIG_HOME`];function yn(e){return Object.fromEntries(vn.flatMap(t=>{let n=e[t]??``;return n===``?[]:[[t,n]]}))}const bn=[`native`,`node`,`frames`];function xn(e,t){return{kind:e,bundle:t,source:null}}const Sn=[`ansi`,`frame`],Cn=Object.keys({termCols:!0,termRows:!0,ssh:!0,tmux:!0,configEnv:!0,claudeConfigDir:!0,terminalEnv:!0,client:!0});function wn(e){let t=Mn(e.termCols),n=Mn(e.termRows),r=Nn(e.ssh),i=An(e.tmux),a=kn(e.configEnv),o=kn(e.claudeConfigDir),s=On(e.terminalEnv),c=Hn(e.client);return{...t!==void 0&&{termCols:t},...n!==void 0&&{termRows:n},...r!==void 0&&{ssh:r},...i!==void 0&&{tmux:i},...a!==void 0&&{configEnv:a},...o!==void 0&&{claudeConfigDir:o},...s!==void 0&&{terminalEnv:s},...c!==void 0&&{client:c}}}function Tn(e,t){return Cn.filter(n=>e[n]!==void 0&&t[n]===void 0).map(t=>({hint:t,sent:e[t]}))}function N(e){return e.length===0?null:`Client hints refused: ${e.map(({hint:e,sent:t})=>`${e}=${JSON.stringify(t)}`).join(`, `)} — is the statusline client older than the daemon? Reinstall it (\`cc-candybar install\`, or \`just install-rust\` in a checkout).`}const En={unknown:e=>`Unknown flags: ${e}`,"no-value":e=>`${e} names no file — the bar renders with no ${e}`,positional:e=>`Unexpected arguments: ${e}`};function Dn(e){let t=Object.keys(En).flatMap(t=>{let n=e.filter(e=>e.why===t).map(e=>e.arg);return n.length===0?[]:[En[t](n.join(`, `))]});return t.length===0?null:t.join(`
|
|
4
4
|
`)}function On(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e,n=vn.filter(e=>t[e]!==void 0);return n.every(e=>typeof t[e]==`string`&&t[e]!==``)?Object.fromEntries(n.map(e=>[e,t[e]])):void 0}function kn(e){return typeof e==`string`&&E.isAbsolute(e)?e:void 0}function An(e){if(e===null)return null;if(typeof e!=`object`)return;let{socket:t,pane:n,truecolor:r}=e;if(!(typeof t!=`string`||t===``)&&!(typeof n!=`string`||n===``)&&!(r!==null&&(typeof r!=`string`||r===``)))return{socket:t,pane:n,truecolor:r}}const jn=1e4;function Mn(e){if(typeof e!=`number`||!Number.isFinite(e))return;let t=Math.floor(e);if(!(t<=0))return t>jn?jn:t}function Nn(e){return typeof e==`boolean`?e:void 0}const Pn=new Set([...[],1]);function Fn(e){return typeof e==`object`&&e&&e.kind===`url`?{kind:`url`,frame:e}:{kind:`request`,req:e}}var In=class extends Error{constructor(e){super(e),this.name=`ProtocolError`}},Ln=class extends Error{constructor(e){super(e===`connect`?`CONNECT_TIMEOUT`:`TIMEOUT`),this.phase=e,this.name=`ClientTimeoutError`}};function Rn(e){return zn(JSON.stringify(e))}function zn(e){let t=Buffer.from(e,`utf8`),n=Buffer.alloc(4);return n.writeUInt32BE(t.length,0),Buffer.concat([n,t])}function Bn(e,t){let n=Buffer.alloc(0);return function(r){for(n=Buffer.concat([n,r]);n.length>=4;){let r=n.readUInt32BE(0);if(r>16777216){t(new In(`frame too large: ${r}`));return}if(n.length<4+r)return;let i=n.subarray(4,4+r);n=n.subarray(4+r);try{e(JSON.parse(i.toString(`utf8`)))}catch(e){let n=new In(e instanceof Error?e.message:String(e));e instanceof Error&&(n.cause=e),t(n);return}}}}function Vn(e,t,n,r){return new Promise((i,a)=>{let o=!1,s=t=>{if(!o){o=!0,c(),e.off(`data`,l),e.off(`error`,u),e.off(`close`,d);try{t()}catch{}}},c=r.after(n-r.now(),()=>{s(()=>{e.destroy(),a(new Ln(`deadline`))})}),l=Bn(e=>s(()=>i(e)),e=>s(()=>a(e))),u=e=>s(()=>a(e)),d=()=>s(()=>a(Error(`socket closed before response`)));e.on(`data`,l),e.on(`error`,u),e.on(`close`,d),e.write(Rn(t))})}function Hn(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let{kind:t,bundle:n,source:r}=e,i=kn(n);return bn.includes(t)&&i!==void 0&&(r===null||typeof r==`string`&&r!==``)?{kind:t,bundle:i,source:r}:void 0}async function Un(e,t,n,r){let i;try{i=await Yn(M(e.host),n.connectMs,e.clock)}catch(e){return Jn(e)}return Wn(i,e.clock,t,n,r)}async function Wn(e,t,n,r,i){try{let a=t.now()+r.budgetMs,o=n(a),s=await Vn(e,{v:3,...o},a,t);return qn(o.kind,s,i)}catch(e){return Jn(e)}finally{e.destroy()}}function Gn(e,t){return typeof e==`string`?e:t}function Kn(e){return typeof e==`number`&&Number.isInteger(e)&&e>=0?e:0}function qn(e,t,n){let r=t;if(r.ok===!0){let r=n(t);return r===void 0?{kind:`permanent`,cause:`malformed_response`,message:`ok response without payload for "${e}" request`}:{kind:`ok`,value:r}}let i=Gn(r.error,`(no error message)`);switch(r.code){case`VERSION_MISMATCH`:return{kind:`permanent`,cause:`version_mismatch`,clientV:3,daemonV:Kn(r.daemonV)};case`TIMEOUT`:return{kind:`busy`,phase:`deadline`,message:i};case`BAD_REQUEST`:return{kind:`permanent`,cause:`bad_request`,message:i};case`RENDER_FAILED`:return{kind:`permanent`,cause:`render_failed`,message:i};case`SWITCHED_OFF`:return{kind:`permanent`,cause:`switched_off`,message:i};default:return{kind:`permanent`,cause:`malformed_response`,message:`unknown error code: ${String(r.code)}`}}}function Jn(e){if(e instanceof In||e instanceof SyntaxError)return{kind:`permanent`,cause:`malformed_response`,message:e instanceof Error?e.message:String(e)};let t=e instanceof Error?e.message:String(e);return e instanceof Ln?{kind:`busy`,phase:e.phase,message:t}:t.includes(`ECONNREFUSED`)||t.includes(`ENOENT`)||t.includes(`ENOTSOCK`)?{kind:`transient`,cause:`unreachable`,message:t}:{kind:`transient`,cause:`io_error`,message:t}}function Yn(e,t,n){return new Promise((r,i)=>{let a=ue.createConnection({path:e}),o=n.after(t,()=>{a.destroy(),i(new Ln(`connect`))});a.once(`connect`,()=>{o(),r(a)}),a.once(`error`,e=>{o(),i(e)})})}function Xn(e){if(e.kind===`busy`)return`daemon busy (${e.message})`;if(e.kind===`transient`)return`daemon unavailable (${e.cause}: ${e.message})\nHint: daemon may not be running. Run \`cc-candybar\` once to spawn it.`;switch(e.cause){case`version_mismatch`:{let t=e.daemonV===0?`unknown`:`v${e.daemonV}`;return`daemon protocol mismatch (client v${e.clientV} ≠ daemon ${t})`}case`bad_request`:case`render_failed`:case`switched_off`:case`malformed_response`:return`daemon error (${e.cause}): ${e.message}`}}function Zn(e){return e===void 0?{kind:`unstated`}:typeof e==`number`&&Number.isSafeInteger(e)&&e>0?{kind:`stated`,at:e}:{kind:`refused`,problem:`request 'deadline' is not epoch milliseconds: ${JSON.stringify(e)}`}}function Qn(e,t,n){let r=e.kind===`stated`?n.monoMs+(e.at-n.epochMs):t+150-50,i=Math.min(r,t+200);return Math.round(i-60-n.monoMs)}const $n={connectMs:50,budgetMs:150},er={connectMs:50,budgetMs:350};function tr(e){let t=e.output;return typeof t==`string`?t:void 0}function nr(e){return qn(`render`,e,tr)}function rr(e,t,n,r,i,a=$n){return Un(e,e=>({kind:`render`,hookData:t,args:n,cwd:r,deadline:e,...i}),a,tr)}function ir(e,t,n){return Un(e,()=>({kind:`pane-session`,socket:t,pane:n}),er,e=>`paneSession`in e?e.paneSession:void 0)}function ar(e,t,n){return Un(e,()=>({kind:`click`,verb:t,value:n}),er,tr)}const or=5e3;async function sr(e){let t=[];for(let n of e){let e=await n.read();if(e.kind===`text`)return`# memory report from: ${n.name}\n${e.text}`;t.push(`# ${n.name}: unavailable — ${e.reason}`)}return[`# memory report: no probe answered`,...t.length>0?t:[`# no probe is known for this platform`]].join(`
|
|
5
5
|
`)}const cr=`/usr/bin/footprint`;function lr(e,t,n){return t===`darwin`?[pr(e,cr,[`-p`,String(n)]),pr(e,`/usr/bin/vmmap`,[`--summary`,String(n)])]:t===`linux`?[mr(`/proc/self/smaps_rollup`),mr(`/proc/self/status`)]:[]}function ur(e,t,n){return t===`darwin`?dr(n,t=>e.launch({bin:cr,args:t,timeoutMs:or,category:`limits.charge`})):async e=>({kind:`charged`,measure:`rss`,bytes:e})}function dr(e,t){return async n=>{let r=await t([`-p`,String(e),`--noCategories`,`-f`,`bytes`]);if(!r.ok)return{kind:`stand-in`,bytes:n,unread:`footprint ${r.reason}${r.error===void 0?``:`: ${r.error}`}${hr(r.stderr)}`};let i=fr(r.stdout);return i===null?{kind:`stand-in`,bytes:n,unread:`footprint printed no phys_footprint line`}:{kind:`charged`,measure:`phys_footprint`,bytes:i}}}function fr(e){let t=/^\s*phys_footprint:\s+(\d+) B\s*$/m.exec(e);return t===null?null:Number(t[1])}function pr(e,t,n){return{name:`${t} ${n.join(` `)}`,read:async()=>{let r=await e.launch({bin:t,args:[...n],timeoutMs:or,category:`limits.memory-report`});return r.ok?r.stdout.trim().length>0?{kind:`text`,text:r.stdout}:{kind:`unavailable`,reason:`exited 0 but printed nothing`}:{kind:`unavailable`,reason:`${r.reason}${r.error===void 0?``:`: ${r.error}`}${hr(r.stderr)}`}}}}function mr(e){return{name:e,read:async()=>{try{let t=l.readFileSync(e,`utf8`);return t.trim().length>0?{kind:`text`,text:t}:{kind:`unavailable`,reason:`empty file`}}catch(e){return{kind:`unavailable`,reason:e.message}}}}}function hr(e){let t=e.split(`
|
|
6
6
|
`).map(e=>e.trim()).find(e=>e.length>0);return t===void 0?``:` (${t})`}const gr=`CC_CANDYBAR_RSS_LIMIT_MB`;function _r(e){let t=e[gr];if(t===void 0)return 1024;let n=/^\d+$/.test(t)?Number(t):NaN;if(!Number.isSafeInteger(n)||n<=0)throw Error(`${gr} must be a positive integer (MB), got ${JSON.stringify(t)}`);return n}function vr(e){return _r(e)*2}const yr=1024*1024,br=e=>Math.round(e/yr);function xr(e){return _r(e)*yr}const Sr={memoryReport:{prefix:`memory-`,suffix:`.txt`},heapSnapshot:{prefix:`heap-`,suffix:`.heapsnapshot`}};function Cr(e,t){return e>t}function wr(e,t){if(e.kind===`charged`)return e;let n=t.kind===`unmeasured`?0:t.charge.kind===`charged`?t.rss-t.charge.bytes:t.charge.gap;return{...e,bytes:e.bytes-n,gap:n}}const Tr=.75;function Er(e,t){return e>t*Tr}function Dr(e,t,n){let{prefix:r,suffix:i}=Sr[t];return E.join(e,`${r}${n}${i}`)}function Or(e){for(let t of Object.keys(Sr)){let{prefix:n,suffix:r}=Sr[t];if(e.startsWith(n)&&e.endsWith(r))return t}return null}function kr(e){let t=e.limitBytes??1024*yr,n=e.snapshotsKeep??3,r=!1,i={kind:`unmeasured`},a=null,o=!1,s;function c(){return a??=l().finally(()=>{a=null}),a}async function l(){if(r)return!0;let{rss:a,heapTotal:s}=e.memoryBytes(),c=wr(await e.memoryCharge(a),i),l={kind:`measured`,charge:c,rss:a,heapTotal:s};if(i=l,e.log(`info`,`memory ${Mr(l,t)}`),o||c.bytes<=t)return!1;r=!0,e.log(`warn`,`${Ar(c)} > limit ${br(t)} MB (rss ${br(a)} MB, v8 heap ${br(s)} MB); recording memory then shutting down`);let u=`${new Date(e.clock.now()).toISOString().replace(/[:.]/g,`-`)}-${e.pid}`;return await Nr(e.log,`memory report`,async()=>{let t=Dr(e.snapshotDir,`memoryReport`,u),n=await e.captureMemoryReport();o||(e.writeMemoryReport(t,n),e.log(`info`,`memory report written: ${t}`))}),o?(e.log(`info`,`daemon closed during the breach: no snapshot, no exit`),!1):(await Nr(e.log,`heap snapshot`,()=>{e.writeLogNow();let t=Dr(e.snapshotDir,`heapSnapshot`,u);e.log(`info`,`heap snapshot written: ${e.writeHeapSnapshot(t)}`)}),await Nr(e.log,`artifact rotation`,async()=>{for(let{artifacts:t}of Pr(e.listArtifacts()).slice(n))for(let n of Object.values(t))await Nr(e.log,`evicting ${n}`,()=>e.removeFile(n))}),e.shutdown(0),!0)}function u(){return i.kind===`measured`&&Er(i.charge.bytes,t)?`${Ar(i.charge)} approaching limit ${br(t)} MB (v8 heap ${br(i.heapTotal)} MB)`:null}function d(){let n;try{n={kind:`ok`,value:Pr(e.listArtifacts())}}catch(e){n={kind:`failed`,reason:e.message}}return{pid:e.pid,memory:i,limit:t,postMortems:n}}function f(t=6e4){let n=async()=>{try{if(await c())return}catch(t){e.log(`warn`,`memory check failed: ${t.message}`)}o||(s=e.clock.after(t,()=>void n(),{unref:!0}))};n()}function p(){o=!0,s?.()}return{check:c,describeNextRestart:u,serving:d,arm:f,disarm:p}}function Ar(e){return e.kind===`charged`?`${e.measure} ${br(e.bytes)} MB`:`rss ${br(e.bytes+e.gap)} MB${e.gap===0?``:` less its last ${br(e.gap)} MB gap`} (standing in: ${e.unread})`}function jr(e){return e.kind===`charged`?e.measure:`rss-stand-in`}function Mr({charge:e,rss:t,heapTotal:n},r){let i=e.kind===`stand-in`?` unread=${JSON.stringify(e.unread)} gap=${br(e.gap)}MB`:``;return`measure=${jr(e)} charge=${br(e.bytes)}MB rss=${br(t)}MB heap=${br(n)}MB limit=${br(r)}MB${i}`}async function Nr(e,t,n){try{await n()}catch(n){e(`warn`,`${t} failed: ${n.message}`)}}function Pr(e){let t=new Map;for(let n of e){let e=E.basename(n),r=Or(e);if(r===null)continue;let{prefix:i,suffix:a}=Sr[r],o=e.slice(i.length,e.length-a.length);t.set(o,{...t.get(o),[r]:n})}let n=Object.keys(Sr);return[...t].sort(([e],[t])=>Cr(e,t)?-1:1).map(([e,t])=>({identity:e,artifacts:Object.fromEntries(n.flatMap(e=>t[e]===void 0?[]:[[e,t[e]]]))}))}function Fr(e,t,n,r={}){let i=n.snapshotDir;return{clock:n.clock,pid:process.pid,snapshotDir:i,log:n.log,memoryBytes:()=>{let e=process.memoryUsage();return{rss:e.rss,heapTotal:e.heapTotal}},memoryCharge:ur(n.launcher,process.platform,process.pid),captureMemoryReport:()=>sr(lr(n.launcher,process.platform,process.pid)),writeMemoryReport:(e,t)=>l.writeFileSync(e,t,{mode:384}),writeHeapSnapshot:e=>de.writeHeapSnapshot(e),writeLogNow:n.writeLogNow,listArtifacts:()=>{let e;try{e=l.readdirSync(i)}catch(e){if(e.code===`ENOENT`)return[];throw e}return e.filter(e=>Or(e)!==null).map(e=>E.join(i,e))},removeFile:e=>l.unlinkSync(e),shutdown:t,startedAtMs:e,...r}}function Ir(e,n={}){let{host:r,clock:i}=e;if(Qr(r)!==null)return;let a=n.spawn??(()=>ei(e)),o=Yr(r,i);if(o.kind===`contended`){let e=Rr(r,i);e!==null&&e>2e3&&(t.stderr.write(`cc-candybar: spawn-lock held ${e}ms (likely crashed holder) — spawning unlocked\n`),Lr(r,i,a));return}if(o.kind===`error`){t.stderr.write(`cc-candybar: spawn-lock unavailable (${o.reason}) — spawning unlocked\n`),Lr(r,i,a);return}try{Lr(r,i,a)}finally{Zr()}}function Lr(e,t,n){Gr(e,t)&&zr(n)}function Rr(e,t){try{let n=l.statSync(an(e));return t.now()-n.mtimeMs}catch{return null}}function zr(e){try{e()||t.stderr.write(`cc-candybar: daemon spawn returned false (unable to resolve script path?)
|
|
@@ -32,7 +32,7 @@ import{createRequire as e}from"node:module";import t from"node:process";import{U
|
|
|
32
32
|
`}function Ba(e,t,n){return e.split(`
|
|
33
33
|
`).join(`${n}${t}`)}function Va(e,t,n){let[r,...i]=e,a=i.length===0?t:`{\n ${Ba(Va(i,t,n),` `,`
|
|
34
34
|
`)}${n.trailingComma}\n}`;return`${n.key(r)}: ${a}`}function Ha(e,t,n,r){return e.slice(0,t)+r+e.slice(n)}function Ua(e,t){return e.lastIndexOf(`
|
|
35
|
-
`,t-1)+1}function Wa(e){return/^[ \t]*$/.test(e)}function Ga(e,t){let n=Ua(e,t);return/^[ \t]*/.exec(e.slice(n))[0]}function Ka(e,t){return Wa(e.slice(Ua(e,t),t))}const qa=/(?:\/\/[^\n]*?)?(\r\n|\n|$)/y;function Ja(e,t){let n=t;for(;n<e.length&&(e[n]===` `||e[n]===` `);)n++;let r=e[n]===`,`?n+1:-1;for(r!==-1&&(n=r);n<e.length&&(e[n]===` `||e[n]===` `);)n++;qa.lastIndex=n;let i=qa.exec(e);if(i===null)return{commaEnd:r,line:null};let a=n+i[0].length;return{commaEnd:r,line:{at:a-i[1].length,next:a}}}function Ya(e,t){let{commaEnd:n,line:r}=Ja(e,t.end);if(Ka(e,t.start)&&r!==null)return Ha(e,Ua(e,t.start),r.next,``);if(n!==-1){let r=n;for(;r<e.length&&e[r]===` `;)r++;return Ha(e,t.start,r,``)}let i=t.start;for(;i>0&&(e[i-1]===` `||e[i-1]===` `);)i--;return e[i-1]===`,`?Ha(e,i-1,t.end,``):Ha(e,t.start,t.end,``)}function Xa(e,t,n,r,i){let a=n.commaEnd!==-1,o=a?e:Ha(e,t.end,t.end,`,`),s=n.line.at+ +!a,c=za(e);return Ha(o,s,s,`${c}${i}${Ba(r,i,c)}${a?`,`:``}`)}function Za(e,t,n,r){let i=t.kind===`object`?t.entries:t.elements,a=i[i.length-1],o=Ga(e,t.span.start);if(a===void 0){let i=o+` `,a=za(e);return Ha(e,t.span.start+1,t.span.end-1,`${a}${i}${Ba(n,i,a)}${r.trailingComma}${a}${o}`)}let{commaEnd:s,line:c}=Ja(e,a.span.end);if(Ka(e,a.span.start)&&c!==null){let t=e.slice(Ua(e,a.span.start),a.span.start);return Xa(e,a.span,{commaEnd:s,line:c},n,t)}let l=s===-1?a.span.end:s;return Ha(e,l,l,`${s===-1?`, `:` `}${n}${s===-1?``:`,`}`)}function Qa(e,t,n,r){if(t.length===0)throw new Sa(`setValue needs a non-empty path`,0);if(/^\s*$/.test(e)){let i=za(e);return`{${i} ${Ba(Va(t,n,r),` `,i)}${r.trailingComma}${i}}${i}`}return $a(e,Oa(e),t,n,r)}function $a(e,t,n,r,i){let a=t;for(let t=0;t<n.length;t++){if(a.kind!==`object`)throw new Sa(`cannot set ${n.join(`.`)}: ${n.slice(0,t).join(`.`)||`the document`} is not an object`,a.span.start);let o=ka(a,n[t]);if(o===void 0)return Za(e,a,Va(n.slice(t),r,i),i);if(t===n.length-1){let t=Ga(e,o.keySpan.start);return Ha(e,o.value.span.start,o.value.span.end,Ba(r,t,za(e)))}a=o.value}throw new Sa(`unreachable: path exhausted`,0)}function eo(e,t,n=0){if(t.length===0)throw new Sa(`deleteValue needs a non-empty path`,0);if(/^\s*$/.test(e))return e;let r=t.slice(0,-1),i=Aa(Oa(e),r),a=i===void 0?void 0:ka(i,t[t.length-1]);if(a===void 0||i?.kind!==`object`)return e;let o=Ya(e,a.span);return r.length>n&&i.entries.length===1?eo(o,r,n):o}const eee=[`h`,`v`,`children`];function to(e){if(e.kind===`string`)return e.value;if(e.kind!==`object`)return;let t=ka(e,`seg`)?.value,n=ka(e,`kind`)?.value,r=ka(e,`name`)?.value,i=t?.kind===`string`?t.value:n?.kind===`string`&&n.value===`segment`&&r?.kind===`string`?r.value:void 0;if(i===void 0)return;let a=ka(e,`id`)?.value;return a?.kind===`string`?a.value:i}function no(e){return e.kind===`object`?eee.map(t=>ka(e,t)?.value).filter(e=>e?.kind===`array`):[]}function ro(e){let t=ka(e,`rows`)?.value;return t?.kind===`object`?t.entries:null}function io(e){if(e.kind!==`object`)return!0;let t=ro(e);return t===null||t.length>0||e.entries.some(e=>e.key!==`rows`)}function*ao(e,t){yield{node:e,bareAt:t};for(let t of no(e))for(let e of t.elements)yield*ao(e,null);for(let n of ro(e)??[])yield*ao(n.value,t===null?null:[...t,`rows`,n.key])}function oo(e,t){for(let{node:n}of ao(e,null))if(to(n)===t)return!0;return!1}function so(e,t,n){let r=Aa(Oa(e),t);if(r===void 0)return null;for(let{node:i,bareAt:a}of ao(r,t))if(to(i)===n)return a===null?{text:e,ref:i}:so(Qa(e,a,`{ h: [${ja(e,i)}] }`,Ia),t,n);return null}function co(e,t,n){let r=so(e,t,n);return r===null?null:Ya(r.text,r.ref.span)}function lo(e,t,n,r,i){let a=so(e,t,r);if(a===null)return null;let{text:o,ref:s}=a,c=n.id===void 0?JSON.stringify(n.seg):`{ seg: ${JSON.stringify(n.seg)}, id: ${JSON.stringify(n.id)} }`,{commaEnd:l,line:u}=Ja(o,s.span.end);if(Ka(o,s.span.start)&&u!==null){let e=o.slice(Ua(o,s.span.start),s.span.start);return i===`after`?Xa(o,s.span,{commaEnd:l,line:u},c,e):Ha(o,s.span.start,s.span.start,`${c},${za(o)}${e}`)}let d=ja(o,s),f=i===`before`?`${c}, ${d}`:`${d}, ${c}`;return Ha(o,s.span.start,s.span.end,f)}function uo(e,t,n,r,i){let a=so(e,t,n);if(a===null)return null;let{text:o,ref:s}=a,c=`{ ${Fa(r)}: ${i} }`;return s.kind===`string`?Ha(o,s.span.start,s.span.end,`{ seg: ${JSON.stringify(s.value)}, settings: ${c} }`):ka(s,`settings`)===void 0?$a(o,s,[`settings`],c,Ia):$a(o,s,[`settings`,r],i,Ia)}function F(e){return{kind:`ok`,value:e}}const I={kind:`absent`};function L(e){return{kind:`failed`,reason:e}}function fo(e,t){return e?.kind===`ok`?e.value:t}const po={kind:`pending`};function mo(e){return e===po}function ho(){var e=typeof SuppressedError==`function`?SuppressedError:function(e,t){var n=Error();return n.name=`SuppressedError`,n.error=e,n.suppressed=t,n},t={},n=[];function r(e,t){if(t!=null){if(Object(t)!==t)throw TypeError(`using declarations can only be used with objects, functions, null, or undefined.`);if(e)var r=t[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)];if(r===void 0&&(r=t[Symbol.dispose||Symbol.for(`Symbol.dispose`)],e))var i=r;if(typeof r!=`function`)throw TypeError(`Object is not disposable.`);i&&(r=function(){try{i.call(t)}catch(e){return Promise.reject(e)}}),n.push({v:t,d:r,a:e})}else e&&n.push({d:t,a:e});return t}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var r,i=this.e,a=0;function o(){for(;r=n.pop();)try{if(!r.a&&a===1)return a=0,n.push(r),Promise.resolve().then(o);if(r.d){var e=r.d.call(r.v);if(r.a)return a|=2,Promise.resolve(e).then(o,s)}else a|=1}catch(e){return s(e)}if(a===1)return i===t?Promise.resolve():Promise.reject(i);if(i!==t)throw i}function s(n){return i=i===t?n:new e(n,i),o()}return o()}}}function go(e){if(!e)return``;try{return _o(b(e))}catch{return``}}function _o(e){return`${e.mtimeMs}:${e.size}`}const vo=new class{slots;head=null;tail=null;constructor(e){this.slots=e}async run(e){await this.acquire();try{return await e()}finally{this.release()}}async acquire(){if(this.slots>0){this.slots--;return}await new Promise(e=>{let t={wake:e,next:null};this.tail?this.tail.next=t:this.head=t,this.tail=t})}release(){let e=this.head;if(!e){this.slots++;return}this.head=e.next,this.head||(this.tail=null),e.wake()}}(8);function yo(e){return((...t)=>vo.run(()=>e(...t)))}const bo=yo(me),xo=yo(he),So={reads:0,bytes:0,longLines:0,largestLine:0};function Co(){return{...So}}const wo=[];function To(e){wo.length<8&&wo.push(e)}async function Eo(e,t,n){return vo.run(async()=>{let r=wo.pop()??Buffer.allocUnsafe(524288),i=await Oo(e,t,n,r);if(i.kind!==`ok`)return To(r),i;let a=r;return F({...i.value,[Symbol.dispose]:()=>{a!==void 0&&To(a),a=void 0}})})}function Do(e,t){try{var n=ho();return t(n.u(e).lines)}catch(e){n.e=e}finally{n.d()}}async function Oo(e,t,n,r){let i=null;try{i=await fe(e,`r`);let a=await i.stat(),{size:o,ino:s}=a,c=_o(a),l=t!==void 0&&(s!==t.ino||o<t.offset),u=l||t===void 0?0:t.offset,d=l||n===void 0?o:Math.min(o,n),f=0,p=await ko(i,r.subarray(0,d-u),u);f+=p.length;let m=p.lastIndexOf(10),h=u+p.length,g=p.length<Math.min(r.length,d-u);for(;m<0&&h<d&&!g;){let e=await ko(i,r.subarray(0,d-h),h);f+=e.length;let t=e.indexOf(10);t>=0&&(m=h-u+t),g=e.length<Math.min(r.length,d-h),h+=e.length}let _=m+1,v=_>r.length?_:0,y=v>0?await ko(i,Buffer.allocUnsafe(_),u):p.subarray(0,_);f+=v>0?y.length:0;let b=y.length===_;return So.reads++,So.bytes+=f,So.longLines+=+(v>0),So.largestLine=Math.max(So.largestLine,v),F({lines:b?y:y.subarray(0,0),start:u,atEnd:!b||(v>0?u+_>=d:h>=d||g),size:o,stamp:c,ino:s,reset:l,longLine:v})}catch(t){return t.code===`ENOENT`?I:L(`readAppended ${e}: ${t instanceof Error?t.message:String(t)}`)}finally{await i?.close().catch(e=>{A(`transcript-fs: close failed: ${e instanceof Error?e.message:String(e)}`)})}}async function ko(e,t,n){let r=0;for(;r<t.length;){let{bytesRead:i}=await e.read(t,r,t.length-r,n+r);if(i===0)break;r+=i}return t.subarray(0,r)}async function Ao(e,t){return vo.run(async()=>{let n=null;try{n=await fe(e,`r`);let{size:r}=await n.stat(),i=Math.max(0,r-t);return F({buf:await ko(n,Buffer.alloc(r-i),i),fromStart:i===0})}catch(t){return t.code===`ENOENT`?I:L(`readTail ${e}: ${t instanceof Error?t.message:String(t)}`)}finally{await n?.close().catch(e=>{A(`transcript-fs: close failed: ${e instanceof Error?e.message:String(e)}`)})}})}function jo(e,t){let n;try{n=g(e,d.O_RDONLY|d.O_NONBLOCK)}catch(e){let{code:t}=e;return t===`ENOENT`||t===`ENOTDIR`?I:L(e instanceof Error?e.message:String(e))}try{let e=p(n,{bigint:!0});if(!e.isFile())return L(`not a regular file`);let r=Number(e.size),i=Math.max(0,r-t),a=Buffer.alloc(r-i),o=0;for(;o<a.length;){let e=v(n,a,o,a.length-o,i+o);if(e===0)break;o+=e}return F({buf:a.subarray(0,o),fromStart:i===0,file:`${e.dev}:${e.ino}`})}catch(e){return L(e instanceof Error?e.message:String(e))}finally{try{u(n)}catch(e){A(`transcript-fs: close failed: ${e instanceof Error?e.message:String(e)}`)}}}const Mo=`CLAUDE_CONFIG_DIR`;function No(e,t){let n=(e.CLAUDE_CONFIG_DIR??``).split(`,`)[0].trim();return n===``?void 0:E.resolve(t,n)}function Po(e,t){return e??E.join(t,`.claude`)}function Fo(e){return E.join(e,`settings.json`)}function Io(e){let t=jo(e,2**53-1);switch(t.kind){case`absent`:return null;case`failed`:throw Error(`cannot read ${e}: ${t.reason}`);case`ok`:return{text:t.value.buf.toString(`utf8`),file:t.value.file}}}const Lo=(e,t)=>Error(`cannot read ${e}: ${Ko(t)}`,{cause:t});function Ro(e){return Io(e)?.text??``}function zo(e){return Bo(e,Ro(e))}function Bo(e,t){let n;try{if(/^\s*$/.test(t))return{};n=La.parse(t)}catch(t){throw Lo(e,t)}if(!Go(n))throw Error(`cannot read ${e}: not a JSON object`);return n}function Vo(e){switch(e){case`darwin`:return`/Library/Application Support/ClaudeCode`;case`win32`:return`C:\\Program Files\\ClaudeCode`;default:return`/etc/claude-code`}}const Ho=e=>E.join(e,`.claude`,`settings.local.json`);function Uo(e){let t=E.join(e.managedDir,`managed-settings.d`),n=[...Wo(t).reverse().map(e=>({scope:`managed`,path:E.join(t,e)})),{scope:`managed`,path:E.join(e.managedDir,`managed-settings.json`)},{scope:`project-local`,path:Ho(e.projectDir)},{scope:`project`,path:E.join(e.projectDir,`.claude`,`settings.json`)},{scope:`user`,path:e.userFile}].flatMap(e=>{let t=Io(e.path);if(t===null)return[];let n=Bo(e.path,t.text),{env:r={}}=n;if(!Go(r))throw Error(`cannot read ${e.path}: \`env\` is not an object`);return[{source:{...e,settings:n,env:r},file:t.file}]}),r=n.find(e=>e.source.scope===`user`);return n.filter(e=>e.source.scope!==`project`||e.file!==r?.file).map(e=>e.source)}function Wo(e){try{return l.readdirSync(e).filter(e=>!e.startsWith(`.`)&&e.endsWith(`.json`)).sort()}catch(t){if(t.code===`ENOENT`)return[];throw Lo(e,t)}}const Go=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Ko=e=>e instanceof Error?e.message:String(e),qo=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;function Jo(e){let t=qo.exec(e);return t?{kind:`ok`,value:[Number(t[1]),Number(t[2]),Number(t[3])]}:{kind:`failed`,reason:`"${e}" is not a release version (expected MAJOR.MINOR.PATCH)`}}function Yo(e){return e.join(`.`)}function Xo([e,t,n],[r,i,a]){return e-r||t-i||n-a}const Zo=`@promptctl/cc-candybar`;async function Qo(e,t,n,r){let i=`${n}/-/package/${encodeURIComponent(e)}/dist-tags`;try{let e=await t(i,{signal:xt(r,5e3)});if(!e.ok)return L(`registry responded ${e.status} for ${i}`);let n=await e.json();return typeof n.latest==`string`?Jo(n.latest):I}catch(e){return L(e instanceof Error?e.message:String(e))}}function $o(e,t){let n=Jo(e);if(n.kind===`failed`)return{kind:`unchecked`,installed:e,reason:n.reason};switch(t.kind){case`failed`:return{kind:`unchecked`,installed:e,reason:t.reason};case`absent`:return{kind:`unchecked`,installed:e,reason:"the registry lists no `latest` dist-tag"};case`ok`:{let e=Xo(n.value,t.value);return e<0?{kind:`stale`,installed:n.value,latest:t.value}:e>0?{kind:`ahead`,installed:n.value,latest:t.value}:{kind:`current`,installed:n.value}}}}function es(e,t){switch(t.kind){case`current`:return{stream:`stdout`,text:`✓ cc-candybar ${Yo(t.installed)} is the latest release.\n`};case`ahead`:return{stream:`stdout`,text:`cc-candybar ${Yo(t.installed)} is newer than the registry's latest release (${Yo(t.latest)}): an unpublished build.\n`};case`stale`:{let n=Yo(t.latest);return{stream:`stderr`,text:`⚠ cc-candybar ${Yo(t.installed)} was staged, but the latest release is ${n}.\n pnpm's release-age gate (minimumReleaseAge) and its dlx cache can both\n resolve \`@latest\` to an older release without saying so.\n To install ${n} now, name it explicitly:\n pnpm dlx ${e}@${n} install\n`}}case`unchecked`:return{stream:`stderr`,text:`⚠ Could not check for a cc-candybar release newer than ${t.installed} (${t.reason}); the registry check was skipped.\n`}}}const ts={"darwin-arm64":`@promptctl/cc-candybar-darwin-arm64`,"darwin-x64":`@promptctl/cc-candybar-darwin-x64`,"linux-x64":`@promptctl/cc-candybar-linux-x64`,"linux-arm64":`@promptctl/cc-candybar-linux-arm64`};function ns(e,t){return`${e}-${t}`in ts}const rs=`CCCandybarURLHandler`,is=`cc-candybar-url-handler`,as=[];function os(e,t){return[e,...t].map(Tt).join(` `)}function ss(e){return E.join(e.home,`Applications`,`${rs}.app`)}function cs(){if(process.platform!==`darwin`)throw Error(`URL handler installation requires macOS (found platform: ${process.platform}).`)}function ls(e){return process.platform===`darwin`?E.join(e.home,`Library`,`Application Support`,`CCCandybar`):E.join(dn(e).dataHome,`cc-candybar`)}function us(e){return E.join(e,`bin`,`cc-candybar`)}function ds(e){return E.join(e,`dist`,`index.mjs`)}function fs(e,t){let n=Ht(e);return jt(n===null?ds(ls(t)):E.join(n,`dist`,`index.mjs`))}function ps(e){return E.join(e,`Contents`,`MacOS`,rs)}function ms(e){let t=Ht(e);if(t!==null){let e=E.join(t,`bin`,`cc-candybar-url-handler-native`);if(!l.existsSync(e))throw Error(`install: the URL handler app is not built at ${e}. Run \`just install-url-handler\` in the checkout.`);return e}let n=hs(e,`bin/${is}`);switch(n.kind){case`found`:return n.path;case`no-package`:throw Error(`install: no URL handler app ships for ${n.platform}; the scheme is macOS-only.`);case`missing`:throw Error(`install: the URL handler app was not found in ${n.pkgName} (bin/${is}). The optional platform package is missing or older than this release: reinstall the package.`)}}function hs(t,n){let r=`${process.platform}-${process.arch}`,i=ts[r];if(i===void 0)return{kind:`no-package`,platform:r};try{return{kind:`found`,path:e(t).resolve(`${i}/${n}`)}}catch{return{kind:`missing`,pkgName:i}}}function gs(e){let t=hs(e,`bin/cc-candybar`);return t.kind===`found`?{kind:`native`,sourcePath:t.path}:{kind:`node-shim`,sourcePath:E.resolve(E.dirname(e),`..`,`bin`,`cc-candybar`)}}function _s(e,t){E.resolve(e)!==E.resolve(t)&&l.copyFileSync(e,t)}function vs(e,t){E.resolve(e)!==E.resolve(t)&&(l.rmSync(t,{recursive:!0,force:!0}),l.cpSync(e,t,{recursive:!0}))}function ys(e){let t=l.openSync(e,`r`);try{let n=Buffer.alloc(2),r=l.readSync(t,n,0,2,0);if(r<2)throw Error(`install: staged render entry at ${e} is truncated (${r} byte(s)). Re-run: pnpm dlx ${Zo}@latest install`);return n.toString(`latin1`)===`#!`?`node-shim`:`native`}finally{l.closeSync(t)}}function bs(e,t){if(!l.existsSync(e))throw Error(`install: bundled dist not found at ${e}. Reinstall the package.`);let n=gs(e);if(!l.existsSync(n.sourcePath))throw Error(`install: render entry not found at ${n.sourcePath}. Reinstall the package.`);let r=E.join(E.dirname(e),Dt);if(!l.existsSync(r))throw Error(`install: the attach launcher was not found at ${r}. Reinstall the package.`);let i=E.join(E.dirname(e),At);if(!l.existsSync(i))throw Error(`install: the attach preload was not found at ${i}. Reinstall the package.`);let a=ds(t),o=us(t);l.mkdirSync(E.dirname(a),{recursive:!0}),l.mkdirSync(E.dirname(o),{recursive:!0}),_s(e,a),vs(r,E.join(E.dirname(a),Dt)),_s(i,E.join(E.dirname(a),At)),_s(n.sourcePath,o),l.chmodSync(o,493),l.rmSync(E.join(t,`url-handler.mjs`),{force:!0});let s=ys(o);return process.stdout.write(`Staged cc-candybar v${Vt} runtime at ${t}\n`+(s===`native`?` render entry: native binary (${process.platform}-${process.arch})\n`:` render entry: node shim (no native binary for ${process.platform}-${process.arch}; renders are correct but pay node startup)\n`)),{binPath:o,distPath:a,entryKind:s}}function xs(){return[`<?xml version="1.0" encoding="UTF-8"?>`,`<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">`,`<plist version="1.0">`,`<dict>`,` <key>CFBundleIdentifier</key>`,` <string>com.cccandybar.url-handler</string>`,` <key>CFBundleName</key>`,` <string>${rs}</string>`,` <key>CFBundleExecutable</key>`,` <string>${rs}</string>`,` <key>CFBundlePackageType</key>`,` <string>APPL</string>`,` <key>CFBundleVersion</key>`,` <string>${Vt}</string>`,` <key>CFBundleShortVersionString</key>`,` <string>${Vt}</string>`,` <key>LSMinimumSystemVersion</key>`,` <string>12.0</string>`,` <key>LSUIElement</key>`,` <true/>`,` <key>CFBundleURLTypes</key>`,` <array>`,` <dict>`,` <key>CFBundleURLName</key>`,` <string>cc-candybar click</string>`,` <key>CFBundleURLSchemes</key>`,` <array>`,` <string>${Ei}</string>`,` </array>`,` </dict>`,` </array>`,`</dict>`,`</plist>`,``].join(`
|
|
35
|
+
`,t-1)+1}function Wa(e){return/^[ \t]*$/.test(e)}function Ga(e,t){let n=Ua(e,t);return/^[ \t]*/.exec(e.slice(n))[0]}function Ka(e,t){return Wa(e.slice(Ua(e,t),t))}const qa=/(?:\/\/[^\n]*?)?(\r\n|\n|$)/y;function Ja(e,t){let n=t;for(;n<e.length&&(e[n]===` `||e[n]===` `);)n++;let r=e[n]===`,`?n+1:-1;for(r!==-1&&(n=r);n<e.length&&(e[n]===` `||e[n]===` `);)n++;qa.lastIndex=n;let i=qa.exec(e);if(i===null)return{commaEnd:r,line:null};let a=n+i[0].length;return{commaEnd:r,line:{at:a-i[1].length,next:a}}}function Ya(e,t){let{commaEnd:n,line:r}=Ja(e,t.end);if(Ka(e,t.start)&&r!==null)return Ha(e,Ua(e,t.start),r.next,``);if(n!==-1){let r=n;for(;r<e.length&&e[r]===` `;)r++;return Ha(e,t.start,r,``)}let i=t.start;for(;i>0&&(e[i-1]===` `||e[i-1]===` `);)i--;return e[i-1]===`,`?Ha(e,i-1,t.end,``):Ha(e,t.start,t.end,``)}function Xa(e,t,n,r,i){let a=n.commaEnd!==-1,o=a?e:Ha(e,t.end,t.end,`,`),s=n.line.at+ +!a,c=za(e);return Ha(o,s,s,`${c}${i}${Ba(r,i,c)}${a?`,`:``}`)}function Za(e,t,n,r){let i=t.kind===`object`?t.entries:t.elements,a=i[i.length-1],o=Ga(e,t.span.start);if(a===void 0){let i=o+` `,a=za(e);return Ha(e,t.span.start+1,t.span.end-1,`${a}${i}${Ba(n,i,a)}${r.trailingComma}${a}${o}`)}let{commaEnd:s,line:c}=Ja(e,a.span.end);if(Ka(e,a.span.start)&&c!==null){let t=e.slice(Ua(e,a.span.start),a.span.start);return Xa(e,a.span,{commaEnd:s,line:c},n,t)}let l=s===-1?a.span.end:s;return Ha(e,l,l,`${s===-1?`, `:` `}${n}${s===-1?``:`,`}`)}function Qa(e,t,n,r){if(t.length===0)throw new Sa(`setValue needs a non-empty path`,0);if(/^\s*$/.test(e)){let i=za(e);return`{${i} ${Ba(Va(t,n,r),` `,i)}${r.trailingComma}${i}}${i}`}return $a(e,Oa(e),t,n,r)}function $a(e,t,n,r,i){let a=t;for(let t=0;t<n.length;t++){if(a.kind!==`object`)throw new Sa(`cannot set ${n.join(`.`)}: ${n.slice(0,t).join(`.`)||`the document`} is not an object`,a.span.start);let o=ka(a,n[t]);if(o===void 0)return Za(e,a,Va(n.slice(t),r,i),i);if(t===n.length-1){let t=Ga(e,o.keySpan.start);return Ha(e,o.value.span.start,o.value.span.end,Ba(r,t,za(e)))}a=o.value}throw new Sa(`unreachable: path exhausted`,0)}function eo(e,t,n=0){if(t.length===0)throw new Sa(`deleteValue needs a non-empty path`,0);if(/^\s*$/.test(e))return e;let r=t.slice(0,-1),i=Aa(Oa(e),r),a=i===void 0?void 0:ka(i,t[t.length-1]);if(a===void 0||i?.kind!==`object`)return e;let o=Ya(e,a.span);return r.length>n&&i.entries.length===1?eo(o,r,n):o}const eee=[`h`,`v`,`children`];function to(e){if(e.kind===`string`)return e.value;if(e.kind!==`object`)return;let t=ka(e,`seg`)?.value,n=ka(e,`kind`)?.value,r=ka(e,`name`)?.value,i=t?.kind===`string`?t.value:n?.kind===`string`&&n.value===`segment`&&r?.kind===`string`?r.value:void 0;if(i===void 0)return;let a=ka(e,`id`)?.value;return a?.kind===`string`?a.value:i}function no(e){return e.kind===`object`?eee.map(t=>ka(e,t)?.value).filter(e=>e?.kind===`array`):[]}function ro(e){let t=ka(e,`rows`)?.value;return t?.kind===`object`?t.entries:null}function io(e){if(e.kind!==`object`)return!0;let t=ro(e);return t===null||t.length>0||e.entries.some(e=>e.key!==`rows`)}function*ao(e,t){yield{node:e,bareAt:t};for(let t of no(e))for(let e of t.elements)yield*ao(e,null);for(let n of ro(e)??[])yield*ao(n.value,t===null?null:[...t,`rows`,n.key])}function oo(e,t){for(let{node:n}of ao(e,null))if(to(n)===t)return!0;return!1}function so(e,t,n){let r=Aa(Oa(e),t);if(r===void 0)return null;for(let{node:i,bareAt:a}of ao(r,t))if(to(i)===n)return a===null?{text:e,ref:i}:so(Qa(e,a,`{ h: [${ja(e,i)}] }`,Ia),t,n);return null}function co(e,t,n){let r=so(e,t,n);return r===null?null:Ya(r.text,r.ref.span)}function lo(e,t,n,r,i){let a=so(e,t,r);if(a===null)return null;let{text:o,ref:s}=a,c=n.id===void 0?JSON.stringify(n.seg):`{ seg: ${JSON.stringify(n.seg)}, id: ${JSON.stringify(n.id)} }`,{commaEnd:l,line:u}=Ja(o,s.span.end);if(Ka(o,s.span.start)&&u!==null){let e=o.slice(Ua(o,s.span.start),s.span.start);return i===`after`?Xa(o,s.span,{commaEnd:l,line:u},c,e):Ha(o,s.span.start,s.span.start,`${c},${za(o)}${e}`)}let d=ja(o,s),f=i===`before`?`${c}, ${d}`:`${d}, ${c}`;return Ha(o,s.span.start,s.span.end,f)}function uo(e,t,n,r,i){let a=so(e,t,n);if(a===null)return null;let{text:o,ref:s}=a,c=`{ ${Fa(r)}: ${i} }`;return s.kind===`string`?Ha(o,s.span.start,s.span.end,`{ seg: ${JSON.stringify(s.value)}, settings: ${c} }`):ka(s,`settings`)===void 0?$a(o,s,[`settings`],c,Ia):$a(o,s,[`settings`,r],i,Ia)}function F(e){return{kind:`ok`,value:e}}const I={kind:`absent`};function L(e){return{kind:`failed`,reason:e}}function fo(e,t){return e?.kind===`ok`?e.value:t}const po={kind:`pending`};function mo(e){return e===po}function ho(){var e=typeof SuppressedError==`function`?SuppressedError:function(e,t){var n=Error();return n.name=`SuppressedError`,n.error=e,n.suppressed=t,n},t={},n=[];function r(e,t){if(t!=null){if(Object(t)!==t)throw TypeError(`using declarations can only be used with objects, functions, null, or undefined.`);if(e)var r=t[Symbol.asyncDispose||Symbol.for(`Symbol.asyncDispose`)];if(r===void 0&&(r=t[Symbol.dispose||Symbol.for(`Symbol.dispose`)],e))var i=r;if(typeof r!=`function`)throw TypeError(`Object is not disposable.`);i&&(r=function(){try{i.call(t)}catch(e){return Promise.reject(e)}}),n.push({v:t,d:r,a:e})}else e&&n.push({d:t,a:e});return t}return{e:t,u:r.bind(null,!1),a:r.bind(null,!0),d:function(){var r,i=this.e,a=0;function o(){for(;r=n.pop();)try{if(!r.a&&a===1)return a=0,n.push(r),Promise.resolve().then(o);if(r.d){var e=r.d.call(r.v);if(r.a)return a|=2,Promise.resolve(e).then(o,s)}else a|=1}catch(e){return s(e)}if(a===1)return i===t?Promise.resolve():Promise.reject(i);if(i!==t)throw i}function s(n){return i=i===t?n:new e(n,i),o()}return o()}}}function go(e){if(!e)return``;try{return _o(b(e))}catch{return``}}function _o(e){return`${e.mtimeMs}:${e.size}`}const vo=new class{slots;head=null;tail=null;constructor(e){this.slots=e}async run(e){await this.acquire();try{return await e()}finally{this.release()}}async acquire(){if(this.slots>0){this.slots--;return}await new Promise(e=>{let t={wake:e,next:null};this.tail?this.tail.next=t:this.head=t,this.tail=t})}release(){let e=this.head;if(!e){this.slots++;return}this.head=e.next,this.head||(this.tail=null),e.wake()}}(8);function yo(e){return((...t)=>vo.run(()=>e(...t)))}const bo=yo(me),xo=yo(he),So={reads:0,bytes:0,longLines:0,largestLine:0};function Co(){return{...So}}const wo=[];function To(e){wo.length<8&&wo.push(e)}async function Eo(e,t,n){return vo.run(async()=>{let r=wo.pop()??Buffer.allocUnsafe(524288),i=await Oo(e,t,n,r);if(i.kind!==`ok`)return To(r),i;let a=r;return F({...i.value,[Symbol.dispose]:()=>{a!==void 0&&To(a),a=void 0}})})}function Do(e,t){try{var n=ho();return t(n.u(e).lines)}catch(e){n.e=e}finally{n.d()}}async function Oo(e,t,n,r){let i=null;try{i=await fe(e,`r`);let a=await i.stat(),{size:o,ino:s}=a,c=_o(a),l=t!==void 0&&(s!==t.ino||o<t.offset),u=l||t===void 0?0:t.offset,d=l||n===void 0?o:Math.min(o,n),f=0,p=await ko(i,r.subarray(0,d-u),u);f+=p.length;let m=p.lastIndexOf(10),h=u+p.length,g=p.length<Math.min(r.length,d-u);for(;m<0&&h<d&&!g;){let e=await ko(i,r.subarray(0,d-h),h);f+=e.length;let t=e.indexOf(10);t>=0&&(m=h-u+t),g=e.length<Math.min(r.length,d-h),h+=e.length}let _=m+1,v=_>r.length?_:0,y=v>0?await ko(i,Buffer.allocUnsafe(_),u):p.subarray(0,_);f+=v>0?y.length:0;let b=y.length===_;return So.reads++,So.bytes+=f,So.longLines+=+(v>0),So.largestLine=Math.max(So.largestLine,v),F({lines:b?y:y.subarray(0,0),start:u,atEnd:!b||(v>0?u+_>=d:h>=d||g),size:o,stamp:c,ino:s,reset:l,longLine:v})}catch(t){return t.code===`ENOENT`?I:L(`readAppended ${e}: ${t instanceof Error?t.message:String(t)}`)}finally{await i?.close().catch(e=>{A(`transcript-fs: close failed: ${e instanceof Error?e.message:String(e)}`)})}}async function ko(e,t,n){let r=0;for(;r<t.length;){let{bytesRead:i}=await e.read(t,r,t.length-r,n+r);if(i===0)break;r+=i}return t.subarray(0,r)}async function Ao(e,t){return vo.run(async()=>{let n=null;try{n=await fe(e,`r`);let{size:r}=await n.stat(),i=Math.max(0,r-t);return F({buf:await ko(n,Buffer.alloc(r-i),i),fromStart:i===0})}catch(t){return t.code===`ENOENT`?I:L(`readTail ${e}: ${t instanceof Error?t.message:String(t)}`)}finally{await n?.close().catch(e=>{A(`transcript-fs: close failed: ${e instanceof Error?e.message:String(e)}`)})}})}function jo(e,t){let n;try{n=g(e,d.O_RDONLY|d.O_NONBLOCK)}catch(e){let{code:t}=e;return t===`ENOENT`||t===`ENOTDIR`?I:L(e instanceof Error?e.message:String(e))}try{let e=p(n,{bigint:!0});if(!e.isFile())return L(`not a regular file`);let r=Number(e.size),i=Math.max(0,r-t),a=Buffer.alloc(r-i),o=0;for(;o<a.length;){let e=v(n,a,o,a.length-o,i+o);if(e===0)break;o+=e}return F({buf:a.subarray(0,o),fromStart:i===0,file:`${e.dev}:${e.ino}`})}catch(e){return L(e instanceof Error?e.message:String(e))}finally{try{u(n)}catch(e){A(`transcript-fs: close failed: ${e instanceof Error?e.message:String(e)}`)}}}const Mo=`CLAUDE_CONFIG_DIR`;function No(e,t){let n=(e.CLAUDE_CONFIG_DIR??``).split(`,`)[0].trim();return n===``?void 0:E.resolve(t,n)}function Po(e,t){return e??E.join(t,`.claude`)}function Fo(e){return E.join(e,`settings.json`)}function Io(e){let t=jo(e,2**53-1);switch(t.kind){case`absent`:return null;case`failed`:throw Error(`cannot read ${e}: ${t.reason}`);case`ok`:return{text:t.value.buf.toString(`utf8`),file:t.value.file}}}const Lo=(e,t)=>Error(`cannot read ${e}: ${Ko(t)}`,{cause:t});function Ro(e){return Io(e)?.text??``}function zo(e){return Bo(e,Ro(e))}function Bo(e,t){let n;try{if(/^\s*$/.test(t))return{};n=La.parse(t)}catch(t){throw Lo(e,t)}if(!Go(n))throw Error(`cannot read ${e}: not a JSON object`);return n}function Vo(e){switch(e){case`darwin`:return`/Library/Application Support/ClaudeCode`;case`win32`:return`C:\\Program Files\\ClaudeCode`;default:return`/etc/claude-code`}}const Ho=e=>E.join(e,`.claude`,`settings.local.json`);function Uo(e){let t=E.join(e.managedDir,`managed-settings.d`),n=[...Wo(t).reverse().map(e=>({scope:`managed`,path:E.join(t,e)})),{scope:`managed`,path:E.join(e.managedDir,`managed-settings.json`)},{scope:`project-local`,path:Ho(e.projectDir)},{scope:`project`,path:E.join(e.projectDir,`.claude`,`settings.json`)},{scope:`user`,path:e.userFile}].flatMap(e=>{let t=Io(e.path);if(t===null)return[];let n=Bo(e.path,t.text),{env:r={}}=n;if(!Go(r))throw Error(`cannot read ${e.path}: \`env\` is not an object`);return[{source:{...e,settings:n,env:r},file:t.file}]}),r=n.find(e=>e.source.scope===`user`);return n.filter(e=>e.source.scope!==`project`||e.file!==r?.file).map(e=>e.source)}function Wo(e){try{return l.readdirSync(e).filter(e=>!e.startsWith(`.`)&&e.endsWith(`.json`)).sort()}catch(t){if(t.code===`ENOENT`)return[];throw Lo(e,t)}}const Go=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Ko=e=>e instanceof Error?e.message:String(e),qo=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;function Jo(e){let t=qo.exec(e);return t?{kind:`ok`,value:[Number(t[1]),Number(t[2]),Number(t[3])]}:{kind:`failed`,reason:`"${e}" is not a release version (expected MAJOR.MINOR.PATCH)`}}function Yo(e){return e.join(`.`)}function Xo([e,t,n],[r,i,a]){return e-r||t-i||n-a}const Zo=`@promptctl/cc-candybar`;async function Qo(e,t,n,r){let i=`${n}/-/package/${encodeURIComponent(e)}/dist-tags`;try{let e=await t(i,{signal:xt(r,5e3)});if(!e.ok)return L(`registry responded ${e.status} for ${i}`);let n=await e.json();return typeof n.latest==`string`?Jo(n.latest):I}catch(e){return L(e instanceof Error?e.message:String(e))}}function $o(e,t){let n=Jo(e);if(n.kind===`failed`)return{kind:`unchecked`,installed:e,reason:n.reason};switch(t.kind){case`failed`:return{kind:`unchecked`,installed:e,reason:t.reason};case`absent`:return{kind:`unchecked`,installed:e,reason:"the registry lists no `latest` dist-tag"};case`ok`:{let e=Xo(n.value,t.value);return e<0?{kind:`stale`,installed:n.value,latest:t.value}:e>0?{kind:`ahead`,installed:n.value,latest:t.value}:{kind:`current`,installed:n.value}}}}function es(e,t){switch(t.kind){case`current`:return{stream:`stdout`,text:`✓ cc-candybar ${Yo(t.installed)} is the latest release.\n`};case`ahead`:return{stream:`stdout`,text:`cc-candybar ${Yo(t.installed)} is newer than the registry's latest release (${Yo(t.latest)}): an unpublished build.\n`};case`stale`:{let n=Yo(t.latest);return{stream:`stderr`,text:`⚠ cc-candybar ${Yo(t.installed)} was staged, but the latest release is ${n}.\n pnpm's release-age gate (minimumReleaseAge) and its dlx cache can both\n resolve \`@latest\` to an older release without saying so.\n To install ${n} now, name it explicitly:\n pnpm dlx ${e}@${n} install\n`}}case`unchecked`:return{stream:`stderr`,text:`⚠ Could not check for a cc-candybar release newer than ${t.installed} (${t.reason}); the registry check was skipped.\n`}}}const ts={"darwin-arm64":`@promptctl/cc-candybar-darwin-arm64`,"darwin-x64":`@promptctl/cc-candybar-darwin-x64`,"linux-x64":`@promptctl/cc-candybar-linux-x64`,"linux-arm64":`@promptctl/cc-candybar-linux-arm64`};function ns(e,t){return`${e}-${t}`in ts}const rs=`CCCandybarURLHandler`,is=`cc-candybar-url-handler`,as=[];function os(e,t){return[e,...t].map(Tt).join(` `)}function ss(e){return E.join(e.home,`Applications`,`${rs}.app`)}function cs(){if(process.platform!==`darwin`)throw Error(`URL handler installation requires macOS (found platform: ${process.platform}).`)}function ls(e){return process.platform===`darwin`?E.join(e.home,`Library`,`Application Support`,`CCCandybar`):E.join(dn(e).dataHome,`cc-candybar`)}function us(e){return E.join(e,`bin`,`cc-candybar`)}function ds(e){return E.join(e,`dist`,`index.mjs`)}function fs(e,t){let n=Ht(e);return jt(n===null?ds(ls(t)):E.join(n,`dist`,`index.mjs`))}function ps(e){return E.join(e,`Contents`,`MacOS`,rs)}function ms(e){let t=Ht(e);if(t!==null){let e=E.join(t,`bin`,`cc-candybar-url-handler-native`);if(!l.existsSync(e))throw Error(`install: the URL handler app is not built at ${e}. Run \`just install-url-handler\` in the checkout.`);return e}let n=hs(e,`bin/${is}`);switch(n.kind){case`found`:return n.path;case`no-package`:throw Error(`install: no URL handler app ships for ${n.platform}; the scheme is macOS-only.`);case`missing`:throw Error(`install: the URL handler app was not found in ${n.pkgName} (bin/${is}). The optional platform package is missing or older than this release: reinstall the package.`)}}function hs(t,n){let r=`${process.platform}-${process.arch}`,i=ts[r];if(i===void 0)return{kind:`no-package`,platform:r};try{return{kind:`found`,path:e(t).resolve(`${i}/${n}`)}}catch{return{kind:`missing`,pkgName:i}}}function gs(e){let t=hs(e,`bin/cc-candybar`);return t.kind===`found`?{kind:`native`,sourcePath:t.path}:{kind:`node-shim`,sourcePath:E.resolve(E.dirname(e),`..`,`bin`,`cc-candybar`)}}function _s(e,t){E.resolve(e)!==E.resolve(t)&&l.copyFileSync(e,t)}function vs(e,t){E.resolve(e)!==E.resolve(t)&&(l.rmSync(t,{recursive:!0,force:!0}),l.cpSync(e,t,{recursive:!0}))}function ys(e){let t=l.openSync(e,`r`);try{let n=Buffer.alloc(2),r=l.readSync(t,n,0,2,0);if(r<2)throw Error(`install: staged render entry at ${e} is truncated (${r} byte(s)). Re-run: pnpm dlx ${Zo}@latest install`);return n.toString(`latin1`)===`#!`?`node-shim`:`native`}finally{l.closeSync(t)}}function bs(e,t){if(!l.existsSync(e))throw Error(`install: bundled dist not found at ${e}. Reinstall the package.`);let n=gs(e);if(!l.existsSync(n.sourcePath))throw Error(`install: render entry not found at ${n.sourcePath}. Reinstall the package.`);let r=E.join(E.dirname(e),Dt);if(!l.existsSync(r))throw Error(`install: the attach launcher was not found at ${r}. Reinstall the package.`);let i=E.join(E.dirname(e),At);if(!l.existsSync(i))throw Error(`install: the attach preload was not found at ${i}. Reinstall the package.`);let a=ds(t),o=us(t);l.mkdirSync(E.dirname(a),{recursive:!0}),l.mkdirSync(E.dirname(o),{recursive:!0}),_s(e,a),vs(r,E.join(E.dirname(a),Dt)),_s(i,E.join(E.dirname(a),At)),_s(n.sourcePath,o),l.chmodSync(o,493),l.rmSync(E.join(t,`url-handler.mjs`),{force:!0});let s=ys(o);return process.stdout.write(`Staged cc-candybar v${Vt} runtime at ${t}\n`+(s===`native`?` render entry: native binary (${process.platform}-${process.arch})\n`:` render entry: node shim (no native binary for ${process.platform}-${process.arch}; renders are correct but pay node startup)\n`)),{binPath:o,distPath:a,entryKind:s}}function xs(){return[`<?xml version="1.0" encoding="UTF-8"?>`,`<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">`,`<plist version="1.0">`,`<dict>`,` <key>CFBundleIdentifier</key>`,` <string>com.cccandybar.url-handler</string>`,` <key>CFBundleName</key>`,` <string>${rs}</string>`,` <key>CFBundleDisplayName</key>`,` <string>cc-candybar</string>`,` <key>CFBundleExecutable</key>`,` <string>${rs}</string>`,` <key>CFBundlePackageType</key>`,` <string>APPL</string>`,` <key>CFBundleVersion</key>`,` <string>${Vt}</string>`,` <key>CFBundleShortVersionString</key>`,` <string>${Vt}</string>`,` <key>LSMinimumSystemVersion</key>`,` <string>12.0</string>`,` <key>LSUIElement</key>`,` <true/>`,` <key>CFBundleURLTypes</key>`,` <array>`,` <dict>`,` <key>CFBundleURLName</key>`,` <string>cc-candybar click</string>`,` <key>CFBundleURLSchemes</key>`,` <array>`,` <string>${Ei}</string>`,` </array>`,` </dict>`,` </array>`,`</dict>`,`</plist>`,``].join(`
|
|
36
36
|
`)}function Ss(e,{host:t,launcher:n}){let r=ss(t),i=`${r}.installing`,a=ps(i);process.stdout.write(`Building ${r}\n`),l.rmSync(i,{recursive:!0,force:!0});try{l.mkdirSync(E.dirname(a),{recursive:!0}),l.copyFileSync(e,a),l.chmodSync(a,493),l.writeFileSync(E.join(i,`Contents`,`Info.plist`),xs());let t=n.launchSync({bin:`/usr/bin/codesign`,args:[`--force`,`--sign`,`-`,i],category:`install.codesign`});if(!t.ok)throw process.stderr.write(t.stderr),Error(`codesign failed (${t.reason})`);l.rmSync(r,{recursive:!0,force:!0}),l.renameSync(i,r)}catch(e){throw l.rmSync(i,{recursive:!0,force:!0}),e}let o=n.launchSync({bin:`/usr/bin/killall`,args:[rs],category:`install.killall`});if(!o.ok&&o.exitCode!==1)throw process.stderr.write(o.stderr),Error(`killall ${rs} failed (${o.reason})`);process.stdout.write(o.ok?`Quit the running ${rs}; the next click starts the new one\n`:`${rs} was not running\n`),process.stdout.write(`Registering ${Ei}:// with Launch Services\n`);let s=n.launchSync({bin:`/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister`,args:[`-f`,r],category:`install.lsregister`});if(!s.ok)throw process.stderr.write(s.stderr),Error(`lsregister failed (${s.reason})`);process.stdout.write(`✓ ${rs}.app installed and registered.\n`),process.stdout.write(` Test: open '${Ei}://hello-world' && pbpaste\n`)}function Cs(e,t){cs();let n=ms(e);bs(e,ls(t.host)),Ss(n,t)}async function ws(e,t){e||(process.stderr.write(`url-handle: missing URL argument.
|
|
37
37
|
`),process.exit(1));let n=ga(e);n.ok||(process.stderr.write(`url-handle: ${n.problem}\n`),process.exit(1));let r=await ar(t,n.verb,n.value);r.kind===`ok`&&process.exit(0);let i=Ts(r);i.kick&&Ir(t),process.stderr.write(i.stderr),process.exit(i.code)}function Ts(e){switch(e.kind){case`busy`:return{stderr:`url-handle: daemon busy (${e.message})\n`,code:+(e.phase===`connect`),kick:!1};case`transient`:return{stderr:`url-handle: daemon unavailable (${e.cause}: ${e.message})\n`,code:1,kick:!0};case`permanent`:return{stderr:Es(e)+`
|
|
38
38
|
`,code:1,kick:!1}}}function Es(e){switch(e.cause){case`version_mismatch`:return`url-handle: daemon rejected click (version mismatch: client v${e.clientV} ≠ daemon v${e.daemonV})`;case`bad_request`:return`url-handle: daemon rejected click (bad request: ${e.message})`;case`render_failed`:return`url-handle: daemon rejected click (handler failed: ${e.message})`;case`switched_off`:return`url-handle: daemon rejected click (switched off: ${e.message})`;case`malformed_response`:return`url-handle: daemon rejected click (malformed response: ${e.message})`}}function Ds(){return`✓ install complete.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptctl/cc-candybar",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.182.0",
|
|
4
4
|
"description": "Statusline renderer for Claude Code — a JSON5-configurable DSL with daemon-cached data sources, byte-clean palette-aware composition, and OSC8 click verbs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
|
@@ -111,9 +111,9 @@
|
|
|
111
111
|
"yaml": "^2.9.1"
|
|
112
112
|
},
|
|
113
113
|
"optionalDependencies": {
|
|
114
|
-
"@promptctl/cc-candybar-darwin-arm64": "1.
|
|
115
|
-
"@promptctl/cc-candybar-darwin-x64": "1.
|
|
116
|
-
"@promptctl/cc-candybar-linux-arm64": "1.
|
|
117
|
-
"@promptctl/cc-candybar-linux-x64": "1.
|
|
114
|
+
"@promptctl/cc-candybar-darwin-arm64": "1.182.0",
|
|
115
|
+
"@promptctl/cc-candybar-darwin-x64": "1.182.0",
|
|
116
|
+
"@promptctl/cc-candybar-linux-arm64": "1.182.0",
|
|
117
|
+
"@promptctl/cc-candybar-linux-x64": "1.182.0"
|
|
118
118
|
}
|
|
119
119
|
}
|