@promptctl/cc-candybar 1.62.0 → 1.62.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +1 -1
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -120,7 +120,7 @@ Config tooling:
|
|
|
120
120
|
Replace: layout: [["seg1", "seg2"], ["seg3"]]
|
|
121
121
|
With: root: { v: [{ h: ["seg1", "seg2"] }, "seg3"] }
|
|
122
122
|
Single-row example: root: { h: ["seg1", "seg2"] }`,line:G(e.source,[`layout`])}),t.root!==void 0&&(r.root=Mc(e,`root`,t.root)),t.actions!==void 0&&(r.actions=Lg(e,t.actions)),t.looks!==void 0&&(r.looks=T_(e,t.looks)),t.presets!==void 0&&(r.presets=D_(e,t.presets)),t.editGlobals!==void 0&&(r.editGlobals=wo(e,`editGlobals`,t.editGlobals)),t.helpers!==void 0&&(r.helpers=O_(e,t.helpers)),Bc(e,r),Um(e,r),Zm(e,r),bs(e,r,gs,`the global settings menu`),r}const Tv=new Set([`globals`,`variables`,`segments`,`layout`,`root`,`actions`,`looks`,`presets`,`editGlobals`,`helpers`]);function Ev(e){let t=Av(e.termCols),n=Av(e.termRows),r=jv(e.ssh),i=Ov(e.tmux),a=Dv(e.configEnv);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}}}function Dv(e){return typeof e==`string`&&e!==``?cv(e):void 0}function Ov(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 kv=1e4;function Av(e){if(typeof e!=`number`||!Number.isFinite(e))return;let t=Math.floor(e);if(!(t<=0))return t>kv?kv:t}function jv(e){return typeof e==`boolean`?e:void 0}var Mv=class extends Error{constructor(e){super(e),this.name=`ProtocolError`}};function Nv(e){let t=Buffer.from(JSON.stringify(e),`utf8`),n=Buffer.alloc(4);return n.writeUInt32BE(t.length,0),Buffer.concat([n,t])}function Pv(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 Mv(`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 Mv(e instanceof Error?e.message:String(e));e instanceof Error&&(n.cause=e),t(n);return}}}}function Fv(e,t,n){return new Promise((r,i)=>{let a=!1,o=t=>{if(!a){a=!0,clearTimeout(s),e.removeAllListeners();try{t()}catch{}}},s=setTimeout(()=>{o(()=>{e.destroy(),i(Error(`TIMEOUT`))})},n),c=Pv(e=>o(()=>r(e)),e=>o(()=>i(e)));e.on(`data`,c),e.on(`error`,e=>o(()=>i(e))),e.on(`close`,()=>o(()=>i(Error(`socket closed before response`)))),e.write(Nv(t))})}async function Iv(e,t,n){let r=null;try{r=await Vv(Ne(),t.connectMs);let i=await Fv(r,{v:3,...e},t.budgetMs);return zv(e.kind,i,n)}catch(e){return Bv(e)}finally{r&&r.destroy()}}function Lv(e,t){return typeof e==`string`?e:t}function Rv(e){return typeof e==`number`&&Number.isInteger(e)&&e>=0?e:0}function zv(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=Lv(r.error,`(no error message)`);switch(r.code){case`VERSION_MISMATCH`:return{kind:`permanent`,cause:`version_mismatch`,clientV:3,daemonV:Rv(r.daemonV)};case`TIMEOUT`:return{kind:`transient`,cause:`timeout`,message:i};case`BAD_REQUEST`:return{kind:`permanent`,cause:`bad_request`,message:i};case`RENDER_FAILED`:return{kind:`permanent`,cause:`render_failed`,message:i};default:return{kind:`permanent`,cause:`malformed_response`,message:`unknown error code: ${String(r.code)}`}}}function Bv(e){if(e instanceof Mv||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 t===`CONNECT_TIMEOUT`||t===`TIMEOUT`?{kind:`transient`,cause:`timeout`,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 Vv(e,t){return new Promise((n,r)=>{let i=g.createConnection({path:e}),a=setTimeout(()=>{i.destroy(),r(Error(`CONNECT_TIMEOUT`))},t);i.once(`connect`,()=>{clearTimeout(a),n(i)}),i.once(`error`,e=>{clearTimeout(a),r(e)})})}function Hv(e){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`malformed_response`:return`daemon error (${e.cause}): ${e.message}`}}const Uv={connectMs:50,budgetMs:150},Wv={connectMs:50,budgetMs:200};function Gv(e){let t=e.output;return typeof t==`string`?t:void 0}function Kv(e,t,n,r){return Iv({kind:`render`,hookData:e,args:t,cwd:n,...r},Uv,Gv)}function qv(e,t){return Iv({kind:`click`,verb:e,value:t},Wv,Gv)}let Jv=null;function Yv(e){if(Jv!==null)return Jv;r.mkdirSync(c.dirname(e),{recursive:!0});try{Jv=r.statSync(e).size}catch{Jv=0}return Jv}function Xv(e){for(let t=2;t>=1;t--){let n=`${e}.${t}`,i=`${e}.${t+1}`;try{r.renameSync(n,i)}catch{}}try{r.renameSync(e,`${e}.1`)}catch{}Jv=0}function Y(e,t){let n=`${new Date().toISOString()} [${e}] ${t}\n`;try{let e=Ge(),t=Yv(e);r.appendFileSync(e,n),Jv=t+Buffer.byteLength(n,`utf8`),Jv>=5242880&&Xv(e)}catch(e){Jv=null;try{process.stderr.write(`${n}cc-candybar: daemon.log unwritable: ${e.message}\n`)}catch{}}}const Zv=`CC_CANDYBAR_RSS_LIMIT_MB`;function Qv(e){let t=e[Zv];if(t===void 0)return 512;let n=/^\d+$/.test(t)?Number(t):NaN;if(!Number.isSafeInteger(n)||n<=0)throw Error(`${Zv} must be a positive integer (MB), got ${JSON.stringify(t)}`);return n}function $v(e){return Qv(e)*2}const ey=1024*1024;function ty(e){return Qv(e)*ey}function ny(e){let t=e.rssLimitBytes??512*ey,n=e.snapshotsKeep??3,r=!1;function i(){if(r)return!0;let i=e.rssBytes();if(i<=t)return!1;r=!0,e.log(`warn`,`RSS ${i} > limit ${t}; writing heap snapshot then shutting down`);try{let t=new Date(e.now()).toISOString().replace(/[:.]/g,`-`),r=c.join(e.snapshotDir,`heap-${t}-${e.pid}.heapsnapshot`),i=e.writeHeapSnapshot(r);e.log(`info`,`heap snapshot written: ${i}`),ry(e.listSnapshots(),n,e.removeFile)}catch(t){e.log(`warn`,`heap snapshot failed: ${t.message}`)}return e.shutdown(0),!0}function a(){let n=e.rssBytes();return n>t*.75?`rss ${n} approaching limit ${t}`:null}function o(e=6e4){let t=setInterval(()=>{i()},e);return t.unref(),{disarm:()=>clearInterval(t)}}return{checkRss:i,describeNextRestart:a,arm:o}}function ry(e,t,n){let r=[...e].sort((e,t)=>{let n=e.slice(e.lastIndexOf(`/`)+1);return t.slice(t.lastIndexOf(`/`)+1).localeCompare(n)});for(let e of r.slice(t))try{n(e)}catch{}}function iy(e,t,n={}){let i=Me();return{now:()=>Date.now(),pid:process.pid,snapshotDir:i,log:Y,rssBytes:()=>process.memoryUsage().rss,writeHeapSnapshot:e=>_.writeHeapSnapshot(e),listSnapshots:()=>{try{return r.readdirSync(i).filter(e=>e.startsWith(`heap-`)&&e.endsWith(`.heapsnapshot`)).map(e=>c.join(i,e))}catch{return[]}},removeFile:e=>r.unlinkSync(e),shutdown:t,startedAtMs:e,...n}}function ay(e={}){if(xy()!==null)return;let n=e.spawn??Sy,r=vy();if(r.kind===`contended`){let e=sy();e!==null&&e>2e3&&(t.stderr.write(`cc-candybar: spawn-lock held ${e}ms (likely crashed holder) — spawning unlocked\n`),oy(n));return}if(r.kind===`error`){t.stderr.write(`cc-candybar: spawn-lock unavailable (${r.reason}) — spawning unlocked\n`),oy(n);return}try{oy(n)}finally{by()}}function oy(e){my()&&cy(e)}function sy(){try{let e=r.statSync(Ve());return Date.now()-e.mtimeMs}catch{return null}}function cy(e){try{e()||t.stderr.write(`cc-candybar: daemon spawn returned false (unable to resolve script path?)
|
|
123
|
-
`)}catch(e){t.stderr.write(`cc-candybar: daemon spawn failed: ${e.message}\n`)}}function ly(e,t){return e===null?{kind:`allow`}:e<-1e4?{kind:`allow-future-garbage`,futureMs:-e}:e<t?{kind:`deny`}:{kind:`allow`}}function uy(e){return Math.min(3e3*2**Math.min(Math.max(e,0),5),6e4)}function dy(e){try{let t=r.readFileSync(e,`utf8`).trim(),n=Number(t);return!Number.isInteger(n)||n<0?0:Math.min(n,5)}catch{return 0}}function fy(e,n){try{r.mkdirSync(c.dirname(e),{recursive:!0}),r.writeFileSync(e,String(n),{mode:384})}catch(e){t.stderr.write(`cc-candybar: could not record spawn.backoff: ${e.message}\n`)}}function py(){try{r.unlinkSync(Ue())}catch(e){e.code!==`ENOENT`&&t.stderr.write(`cc-candybar: could not reset spawn.backoff: ${e.message}\n`)}}function my(){let e=He(),n=Ue(),r=dy(n),i=ly(hy(e),uy(r));return i.kind===`deny`?!1:(i.kind===`allow-future-garbage`&&t.stderr.write(`cc-candybar: spawn.cooldown mtime is ${i.futureMs}ms in the future — ignoring and spawning\n`),gy(e),fy(n,Math.min(r+1,5)),!0)}function hy(e){try{return Date.now()-r.statSync(e).mtimeMs}catch{return null}}function gy(e){try{r.mkdirSync(c.dirname(e),{recursive:!0}),r.writeFileSync(e,`${t.pid} ${Date.now()}\n`,{mode:384})}catch(e){t.stderr.write(`cc-candybar: could not record spawn.cooldown: ${e.message}\n`)}}let _y=null;function vy(){let e=Ve();for(let n=0;n<2;n++){try{let n=r.openSync(e,`wx`,384);try{r.writeSync(n,JSON.stringify({pid:t.pid,ts:Date.now()}))}catch{}return _y={fd:n,path:e},{kind:`held`}}catch(t){let n=t.code;if(n!==`EEXIST`)return{kind:`error`,reason:`openSync(${e}): ${n??t.message}`}}if(!yy(e))return{kind:`contended`};try{r.unlinkSync(e)}catch(e){if(e.code!==`ENOENT`)return{kind:`error`,reason:`unlink stale spawn.lock: ${e.message}`}}}return{kind:`contended`}}function yy(e){try{let t=r.statSync(e);return Date.now()-t.mtimeMs>1e4}catch{return!0}}function by(){if(!_y)return;let{fd:e,path:t}=_y;_y=null;try{r.closeSync(e)}catch{}try{r.unlinkSync(t)}catch{}}function xy(){try{return r.mkdirSync(Me(),{recursive:!0}),null}catch(e){return`mkdir ${Me()}: ${e.message}`}}function Sy(){let e=t.execPath,n=t.argv[1];return n?De({bin:e,args:[`--max-old-space-size=${$v(t.env)}`,n,`daemon`],category:`daemon-spawn`}).ok:!1}const Cy=`cc-candybar`,wy=`dispatch`,Ty=`set-state`,Ey=`step-state`,Dy=`copy`,Oy=`open-vscode`,ky=`toolbar-toggle`,Ay=`show-config-error`,jy=`show-config-warning`,My=`set-config`,Ny=`step-config`,Py=`reset-config`,Fy=`apply-layout-op`,Iy=`undo`,Ly=`redo`,Ry=`apply-update`,zy=`doctor-run`,By=`doctor-fix`;function Vy(e){return e.map(encodeURIComponent).join(`/`)}function Hy(e){return e.length===0?[]:e.split(`/`).map(decodeURIComponent)}function Uy(e){return`${Cy}://${wy}/${e.map(e=>`e=${encodeURIComponent(`${e.verb}/${Vy(e.args)}`)}`).join(`&`)}`}function Wy(e){return new y(e).getAll(`e`).map(Gy)}function Gy(e){let t=e.indexOf(`/`);return t===-1?{verb:e,value:``}:{verb:e.slice(0,t),value:e.slice(t+1)}}const Ky=`1.62.
|
|
123
|
+
`)}catch(e){t.stderr.write(`cc-candybar: daemon spawn failed: ${e.message}\n`)}}function ly(e,t){return e===null?{kind:`allow`}:e<-1e4?{kind:`allow-future-garbage`,futureMs:-e}:e<t?{kind:`deny`}:{kind:`allow`}}function uy(e){return Math.min(3e3*2**Math.min(Math.max(e,0),5),6e4)}function dy(e){try{let t=r.readFileSync(e,`utf8`).trim(),n=Number(t);return!Number.isInteger(n)||n<0?0:Math.min(n,5)}catch{return 0}}function fy(e,n){try{r.mkdirSync(c.dirname(e),{recursive:!0}),r.writeFileSync(e,String(n),{mode:384})}catch(e){t.stderr.write(`cc-candybar: could not record spawn.backoff: ${e.message}\n`)}}function py(){try{r.unlinkSync(Ue())}catch(e){e.code!==`ENOENT`&&t.stderr.write(`cc-candybar: could not reset spawn.backoff: ${e.message}\n`)}}function my(){let e=He(),n=Ue(),r=dy(n),i=ly(hy(e),uy(r));return i.kind===`deny`?!1:(i.kind===`allow-future-garbage`&&t.stderr.write(`cc-candybar: spawn.cooldown mtime is ${i.futureMs}ms in the future — ignoring and spawning\n`),gy(e),fy(n,Math.min(r+1,5)),!0)}function hy(e){try{return Date.now()-r.statSync(e).mtimeMs}catch{return null}}function gy(e){try{r.mkdirSync(c.dirname(e),{recursive:!0}),r.writeFileSync(e,`${t.pid} ${Date.now()}\n`,{mode:384})}catch(e){t.stderr.write(`cc-candybar: could not record spawn.cooldown: ${e.message}\n`)}}let _y=null;function vy(){let e=Ve();for(let n=0;n<2;n++){try{let n=r.openSync(e,`wx`,384);try{r.writeSync(n,JSON.stringify({pid:t.pid,ts:Date.now()}))}catch{}return _y={fd:n,path:e},{kind:`held`}}catch(t){let n=t.code;if(n!==`EEXIST`)return{kind:`error`,reason:`openSync(${e}): ${n??t.message}`}}if(!yy(e))return{kind:`contended`};try{r.unlinkSync(e)}catch(e){if(e.code!==`ENOENT`)return{kind:`error`,reason:`unlink stale spawn.lock: ${e.message}`}}}return{kind:`contended`}}function yy(e){try{let t=r.statSync(e);return Date.now()-t.mtimeMs>1e4}catch{return!0}}function by(){if(!_y)return;let{fd:e,path:t}=_y;_y=null;try{r.closeSync(e)}catch{}try{r.unlinkSync(t)}catch{}}function xy(){try{return r.mkdirSync(Me(),{recursive:!0}),null}catch(e){return`mkdir ${Me()}: ${e.message}`}}function Sy(){let e=t.execPath,n=t.argv[1];return n?De({bin:e,args:[`--max-old-space-size=${$v(t.env)}`,n,`daemon`],category:`daemon-spawn`}).ok:!1}const Cy=`cc-candybar`,wy=`dispatch`,Ty=`set-state`,Ey=`step-state`,Dy=`copy`,Oy=`open-vscode`,ky=`toolbar-toggle`,Ay=`show-config-error`,jy=`show-config-warning`,My=`set-config`,Ny=`step-config`,Py=`reset-config`,Fy=`apply-layout-op`,Iy=`undo`,Ly=`redo`,Ry=`apply-update`,zy=`doctor-run`,By=`doctor-fix`;function Vy(e){return e.map(encodeURIComponent).join(`/`)}function Hy(e){return e.length===0?[]:e.split(`/`).map(decodeURIComponent)}function Uy(e){return`${Cy}://${wy}/${e.map(e=>`e=${encodeURIComponent(`${e.verb}/${Vy(e.args)}`)}`).join(`&`)}`}function Wy(e){return new y(e).getAll(`e`).map(Gy)}function Gy(e){let t=e.indexOf(`/`);return t===-1?{verb:e,value:``}:{verb:e.slice(0,t),value:e.slice(t+1)}}const Ky=`1.62.1`;function qy(){return c.join(f.homedir(),`.claude`,`settings.json`)}function X(e){return{kind:`ok`,value:e}}const Z={kind:`absent`};function Q(e){return{kind:`failed`,reason:e}}function Jy(e,t){return e?.kind===`ok`?e.value:t}const Yy=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/;function Xy(e){let t=Yy.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 Zy(e){return e.join(`.`)}function Qy([e,t,n],[r,i,a]){return e-r||t-i||n-a}const $y=`@promptctl/cc-candybar`;async function eb(e,t,n){let r=`${n}/-/package/${encodeURIComponent(e)}/dist-tags`;try{let e=await t(r,{signal:AbortSignal.timeout(5e3)});if(!e.ok)return Q(`registry responded ${e.status} for ${r}`);let n=await e.json();return typeof n.latest==`string`?Xy(n.latest):Z}catch(e){return Q(e instanceof Error?e.message:String(e))}}function tb(e,t){let n=Xy(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=Qy(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 nb(e,t){switch(t.kind){case`current`:return{stream:`stdout`,text:`✓ cc-candybar ${Zy(t.installed)} is the latest release.\n`};case`ahead`:return{stream:`stdout`,text:`cc-candybar ${Zy(t.installed)} is newer than the registry's latest release (${Zy(t.latest)}): an unpublished build.\n`};case`stale`:{let n=Zy(t.latest);return{stream:`stderr`,text:`⚠ cc-candybar ${Zy(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 rb=`CCCandybarURLHandler`,ib=[],ab={"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 ob(e){return/^[A-Za-z0-9_./=,:-]+$/.test(e)?e:`'${e.replace(/'/g,`'\\''`)}'`}function sb(e,t){return[e,...t].map(ob).join(` `)}function cb(){return c.join(f.homedir(),`Applications`,`${rb}.app`)}function lb(){if(process.platform!==`darwin`)throw Error(`URL handler installation requires macOS (found platform: ${process.platform}).`)}function ub(){if(process.platform===`darwin`)return c.join(f.homedir(),`Library`,`Application Support`,`CCCandybar`);let e=process.env.XDG_DATA_HOME??c.join(f.homedir(),`.local`,`share`);return c.join(e,`cc-candybar`)}function db(){return c.join(ub(),`bin`,`cc-candybar`)}function fb(){return c.join(ub(),`dist`,`index.mjs`)}function pb(e,t){return[`on open location L`,`\tdo shell script "'${e.replace(/"/g,`\\"`)}' '${t.replace(/"/g,`\\"`)}' url-handle " & quoted form of L`,`end open location`].join(`
|
|
124
124
|
`)}function mb(e){if(!e)throw Error(`install: process.argv[1] not set`);return e.endsWith(`.mjs`)||e.endsWith(`.js`)?e:c.resolve(c.dirname(e),`..`,`dist`,`index.mjs`)}function hb(t){let n=ab[`${process.platform}-${process.arch}`];if(n){let r=e(t);try{return{kind:`native`,sourcePath:r.resolve(`${n}/bin/cc-candybar`)}}catch{}}return{kind:`node-shim`,sourcePath:c.resolve(c.dirname(t),`..`,`bin`,`cc-candybar`)}}function gb(e,t){c.resolve(e)!==c.resolve(t)&&r.copyFileSync(e,t)}function _b(e){let t=r.openSync(e,`r`);try{let n=Buffer.alloc(2),i=r.readSync(t,n,0,2,0);if(i<2)throw Error(`install: staged render entry at ${e} is truncated (${i} byte(s)). Re-run: pnpm dlx ${$y}@latest install`);return n.toString(`latin1`)===`#!`?`node-shim`:`native`}finally{r.closeSync(t)}}function vb(){let e=mb(process.argv[1]);if(!r.existsSync(e))throw Error(`install: bundled dist not found at ${e}. Reinstall the package.`);let t=hb(e);if(!r.existsSync(t.sourcePath))throw Error(`install: render entry not found at ${t.sourcePath}. Reinstall the package.`);r.mkdirSync(c.dirname(fb()),{recursive:!0}),r.mkdirSync(c.dirname(db()),{recursive:!0}),gb(e,fb()),gb(t.sourcePath,db()),r.chmodSync(db(),493),r.rmSync(c.join(ub(),`url-handler.mjs`),{force:!0});let n=_b(db());return process.stdout.write(`Staged cc-candybar v${Ky} runtime at ${ub()}\n`+(n===`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:db(),distPath:fb(),entryKind:n}}function yb(){return[{key:`CFBundleIdentifier`,xml:`<string>com.cccandybar.url-handler</string>`},{key:`CFBundleURLTypes`,xml:[`<array>`,` <dict>`,` <key>CFBundleURLName</key>`,` <string>Claude Powerline Click Action</string>`,` <key>CFBundleURLSchemes</key>`,` <array>`,` <string>${Cy}</string>`,` </array>`,` </dict>`,`</array>`].join(`
|
|
125
125
|
`)}]}function bb(e){let t=cb();r.mkdirSync(c.dirname(t),{recursive:!0}),r.existsSync(t)&&r.rmSync(t,{recursive:!0,force:!0}),process.stdout.write(`Building ${t}\n`);let n=Ee({bin:`/usr/bin/osacompile`,args:[`-o`,t,`-e`,pb(process.execPath,e)],category:`install.osacompile`});if(!n.ok)throw process.stderr.write(n.stderr),Error(`osacompile failed (${n.reason})`);let i=c.join(t,`Contents`,`Info.plist`);for(let{key:e}of yb())Ee({bin:`/usr/bin/plutil`,args:[`-remove`,e,i],category:`install.plutil`});for(let{key:e,xml:t}of yb()){let n=Ee({bin:`/usr/bin/plutil`,args:[`-insert`,e,`-xml`,t,i],category:`install.plutil`});if(!n.ok)throw process.stderr.write(n.stderr),Error(`plutil -insert ${e} failed (${n.reason})`)}process.stdout.write(`Registering ${Cy}:// with Launch Services\n`);let a=Ee({bin:`/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister`,args:[`-f`,t],category:`install.lsregister`});if(!a.ok)throw process.stderr.write(a.stderr),Error(`lsregister failed (${a.reason})`);process.stdout.write(`✓ ${rb}.app installed and registered.\n`),process.stdout.write(` Test: open '${Cy}://hello-world' && pbpaste\n`)}function xb(){lb(),bb(vb().distPath)}function Sb(e,t=Cy){let n=`${t}://`;if(!e.startsWith(n))throw Error(`expected ${n} scheme, got: ${e}`);let r=e.slice(n.length),i=r.indexOf(`/`);return i===-1?{verb:Dy,value:r}:{verb:decodeURIComponent(r.slice(0,i)),value:r.slice(i+1)}}async function Cb(e){e||(process.stderr.write(`url-handle: missing URL argument.
|
|
126
126
|
`),process.exit(1));let t;try{t=Sb(e)}catch(e){process.stderr.write(`url-handle: ${e instanceof Error?e.message:String(e)}\n`),process.exit(1)}let n=await qv(t.verb,t.value);n.kind===`ok`&&process.exit(0),n.kind===`transient`&&(ay(),process.stderr.write(`url-handle: daemon unavailable (${n.cause}: ${n.message})\n`),process.exit(1)),process.stderr.write(wb(n)+`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptctl/cc-candybar",
|
|
3
|
-
"version": "1.62.
|
|
3
|
+
"version": "1.62.1",
|
|
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",
|
|
@@ -90,9 +90,9 @@
|
|
|
90
90
|
"mobx": "^6.15.0"
|
|
91
91
|
},
|
|
92
92
|
"optionalDependencies": {
|
|
93
|
-
"@promptctl/cc-candybar-darwin-arm64": "1.62.
|
|
94
|
-
"@promptctl/cc-candybar-darwin-x64": "1.62.
|
|
95
|
-
"@promptctl/cc-candybar-linux-x64": "1.62.
|
|
96
|
-
"@promptctl/cc-candybar-linux-arm64": "1.62.
|
|
93
|
+
"@promptctl/cc-candybar-darwin-arm64": "1.62.1",
|
|
94
|
+
"@promptctl/cc-candybar-darwin-x64": "1.62.1",
|
|
95
|
+
"@promptctl/cc-candybar-linux-x64": "1.62.1",
|
|
96
|
+
"@promptctl/cc-candybar-linux-arm64": "1.62.1"
|
|
97
97
|
}
|
|
98
98
|
}
|