blade-code 0.10.137 → 0.10.138

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.
Files changed (131) hide show
  1. package/dist/blade.js +2 -2
  2. package/dist/chunk-03zfvfen.js +10 -0
  3. package/dist/{chunk-e76gej4y.js → chunk-14j2dbd6.js} +2 -2
  4. package/dist/{chunk-h74p51hg.js → chunk-16648v5c.js} +1 -1
  5. package/dist/{chunk-c2mx5zg0.js → chunk-1bqatrxs.js} +1 -1
  6. package/dist/{chunk-chspy9f8.js → chunk-23c4pys6.js} +7 -7
  7. package/dist/{chunk-7ykqvsph.js → chunk-2m79vd9p.js} +1 -1
  8. package/dist/{chunk-g9vdmvk2.js → chunk-2t0wp7gm.js} +2 -2
  9. package/dist/chunk-303b3x5q.js +1 -0
  10. package/dist/{chunk-wzkh3e6a.js → chunk-3eskgvpy.js} +1 -1
  11. package/dist/chunk-3g2z6hae.js +1 -0
  12. package/dist/chunk-3t5r41yh.js +1 -0
  13. package/dist/{chunk-6e3mh79j.js → chunk-516adpx6.js} +1 -1
  14. package/dist/{chunk-ky9br0z8.js → chunk-56py3ryh.js} +1 -1
  15. package/dist/chunk-59980a8h.js +1 -0
  16. package/dist/{chunk-mthf5akx.js → chunk-5bfvdy62.js} +2 -2
  17. package/dist/chunk-5gy3x011.js +1 -0
  18. package/dist/{chunk-q0s3gcjm.js → chunk-5j68055h.js} +1 -1
  19. package/dist/{chunk-5dwmhsrx.js → chunk-5v1pjexj.js} +1 -1
  20. package/dist/chunk-5xgyx25z.js +2 -0
  21. package/dist/{chunk-wxtj6gqb.js → chunk-65c3vjwm.js} +1 -1
  22. package/dist/{chunk-69rjav47.js → chunk-6ezffjq1.js} +1 -1
  23. package/dist/{chunk-9frd4fpk.js → chunk-6qhbdcse.js} +2 -2
  24. package/dist/{chunk-wa71vstt.js → chunk-7j4s1nrc.js} +1 -1
  25. package/dist/{chunk-bzqbmz6t.js → chunk-7vdf66jp.js} +59 -59
  26. package/dist/chunk-8cnxy251.js +1 -0
  27. package/dist/chunk-8cqm87j5.js +1 -0
  28. package/dist/{chunk-na4wzne8.js → chunk-8py443a5.js} +1 -1
  29. package/dist/{chunk-ybc5myz7.js → chunk-8rccn1y2.js} +1 -1
  30. package/dist/{chunk-1evc05gr.js → chunk-92n2p24j.js} +2 -2
  31. package/dist/{chunk-0c82q1sz.js → chunk-9m7d3ajv.js} +1 -1
  32. package/dist/{chunk-p0gbxaqz.js → chunk-a5hkv8er.js} +2 -2
  33. package/dist/{chunk-a26vtcv5.js → chunk-ar85hxx2.js} +2 -2
  34. package/dist/{chunk-ramana2t.js → chunk-atdq9btn.js} +2 -2
  35. package/dist/{chunk-xt0ktytp.js → chunk-awheqy52.js} +2 -2
  36. package/dist/{chunk-69nwa6bn.js → chunk-az08pq83.js} +1 -1
  37. package/dist/{chunk-0ccm29qy.js → chunk-bq6d0v5b.js} +2 -2
  38. package/dist/{chunk-affzv7f1.js → chunk-byeq45rv.js} +1 -1
  39. package/dist/{chunk-e8pfbb6c.js → chunk-d11mqbqk.js} +1 -1
  40. package/dist/{chunk-4jqw75ce.js → chunk-d64b7wta.js} +1 -1
  41. package/dist/chunk-ddcz0nwv.js +1 -0
  42. package/dist/{chunk-g799czsy.js → chunk-dv2m2xe5.js} +1 -1
  43. package/dist/chunk-e71y87zg.js +1 -0
  44. package/dist/{chunk-nxnmqk4s.js → chunk-earhezc8.js} +1 -1
  45. package/dist/{chunk-mavranwn.js → chunk-ec7ykyqz.js} +3 -3
  46. package/dist/{chunk-wc9wsyrc.js → chunk-egadh3e9.js} +1 -1
  47. package/dist/{chunk-mzye1ah2.js → chunk-fbrdcveb.js} +1 -1
  48. package/dist/{chunk-rgjr7jsd.js → chunk-fndqbf45.js} +1 -1
  49. package/dist/{chunk-vp6d1fqp.js → chunk-ft1bdqbs.js} +2 -2
  50. package/dist/{chunk-h05qhgrb.js → chunk-gcg56vaw.js} +2 -2
  51. package/dist/chunk-h2gp7smy.js +1 -0
  52. package/dist/{chunk-y6jee9w7.js → chunk-he0f6h5q.js} +1 -1
  53. package/dist/{chunk-74bswv4z.js → chunk-hrcz179j.js} +2 -2
  54. package/dist/{chunk-5btfnf2r.js → chunk-j21hez8g.js} +4 -4
  55. package/dist/{chunk-5sf2rc1z.js → chunk-j58wrt5n.js} +3 -3
  56. package/dist/{chunk-xg9fyvw0.js → chunk-jb4hmk56.js} +2 -2
  57. package/dist/{chunk-wxypv01z.js → chunk-jy7k2dwm.js} +2 -2
  58. package/dist/{chunk-w9z34f27.js → chunk-k10d8t4f.js} +1 -1
  59. package/dist/chunk-mc2mr1kn.js +2 -0
  60. package/dist/{chunk-v5503t2t.js → chunk-mjnkxem3.js} +4 -4
  61. package/dist/chunk-n2tfj82m.js +1 -0
  62. package/dist/{chunk-f2b9cyj5.js → chunk-nnas8tdt.js} +2 -2
  63. package/dist/{chunk-6xvrrypm.js → chunk-npc7jt96.js} +1 -1
  64. package/dist/{chunk-zk9rf1d7.js → chunk-nqts5by0.js} +2 -2
  65. package/dist/{chunk-gpj7k3er.js → chunk-nyw686sf.js} +2 -2
  66. package/dist/chunk-pty1ncam.js +6 -0
  67. package/dist/chunk-qdjqbgts.js +1 -0
  68. package/dist/{chunk-vg3zwv4g.js → chunk-r7bv1hmq.js} +1 -1
  69. package/dist/{chunk-karq4wfd.js → chunk-rhwkvx96.js} +1 -1
  70. package/dist/{chunk-0k2x2ae6.js → chunk-t88sfhjj.js} +1 -1
  71. package/dist/{chunk-39de5k03.js → chunk-v2fewxvw.js} +2 -2
  72. package/dist/chunk-wv1mnf2m.js +1 -0
  73. package/dist/{chunk-bx75fd0d.js → chunk-y66f1t18.js} +387 -387
  74. package/dist/{chunk-etf3e9kt.js → chunk-yvmexv2c.js} +1 -1
  75. package/dist/{chunk-75yy9yre.js → chunk-z9qv0d6k.js} +1 -1
  76. package/dist/{chunk-z3hpstky.js → chunk-zx78c1an.js} +1 -1
  77. package/dist/web/assets/ChatView-CZLmEMBO.js +63 -0
  78. package/dist/web/assets/{CodeBlockHighlighter-Czp4VZIg.js → CodeBlockHighlighter-6-iPmomS.js} +1 -1
  79. package/dist/web/assets/{FilePreview-BJWuYfyF.js → FilePreview-D0aSwNF3.js} +1 -1
  80. package/dist/web/assets/{KanbanBoard-DrYzt5Kh.js → KanbanBoard-xPziptbY.js} +1 -1
  81. package/dist/web/assets/{MarkdownRenderer-DxkR5r7t.js → MarkdownRenderer-TWNqhwrr.js} +3 -3
  82. package/dist/web/assets/{ScrollArea-D71pJjgW.js → ScrollArea-CSQyGeWr.js} +1 -1
  83. package/dist/web/assets/{SessionHistorySurface-2y9bnndm.js → SessionHistorySurface-PRpOrUav.js} +1 -1
  84. package/dist/web/assets/{SettingsModal-BbaTL5Rk.js → SettingsModal-Ds-Uf-3r.js} +5 -10
  85. package/dist/web/assets/{Sidebar-COZltpL9.js → Sidebar-D6VyjkRY.js} +1 -1
  86. package/dist/web/assets/{TaskSwitcher-3giB7l1P.js → TaskSwitcher-BEsAgt0k.js} +1 -1
  87. package/dist/web/assets/{TerminalPanel-gvTTiTgX.js → TerminalPanel-C_2lnmKH.js} +1 -1
  88. package/dist/web/assets/{archive-DndqAA2q.js → archive-CPBIxP8f.js} +1 -1
  89. package/dist/web/assets/{arrow-left-XNYfpUAb.js → arrow-left-z3DhPgf-.js} +1 -1
  90. package/dist/web/assets/{calendar-clock-BQOfNcCK.js → calendar-clock-tYt1E6zR.js} +1 -1
  91. package/dist/web/assets/{chevron-right-Cvq3LzHK.js → chevron-right-BGTvSaVS.js} +1 -1
  92. package/dist/web/assets/{chevrons-up-down-Dia1U9Sz.js → chevrons-up-down-Jw3ElnjQ.js} +1 -1
  93. package/dist/web/assets/{clock-3-CnxLS8cv.js → clock-3-v0h4RrLK.js} +1 -1
  94. package/dist/web/assets/{copy-CWCS3Lql.js → copy-CF3TUa0u.js} +1 -1
  95. package/dist/web/assets/{download-DXdsM18t.js → download-ZG8PfhmH.js} +1 -1
  96. package/dist/web/assets/{external-link-1IN2ZfaO.js → external-link-BKCjDDt-.js} +1 -1
  97. package/dist/web/assets/{folder-Bpq602dI.js → folder-M-NM2bQG.js} +1 -1
  98. package/dist/web/assets/{index-57UZsfTt.css → index-DC2p1vGD.css} +1 -1
  99. package/dist/web/assets/index-VQVOzFZT.js +203 -0
  100. package/dist/web/assets/{pause-BYhoGDZq.js → pause-CP_wlUro.js} +1 -1
  101. package/dist/web/assets/{pencil-pRZQVHFU.js → pencil-U3n9D8ed.js} +1 -1
  102. package/dist/web/assets/{play-DGZdCyPk.js → play-NBWnc2gU.js} +1 -1
  103. package/dist/web/assets/{plus-CAQ3qlUJ.js → plus-CmPqJgff.js} +1 -1
  104. package/dist/web/assets/session-events-DKjIMNKI.js +29 -0
  105. package/dist/web/assets/{settings-BPfzj_Vf.js → settings-CVFpbh_y.js} +1 -1
  106. package/dist/web/assets/team-B9Na0Ocd.js +6 -0
  107. package/dist/web/assets/{teamService-BScT9o9A.js → teamService-ZQZLqsjy.js} +1 -1
  108. package/dist/web/assets/{terminal-CldJbdMr.js → terminal-BdmigqIS.js} +1 -1
  109. package/dist/web/index.html +2 -2
  110. package/package.json +1 -1
  111. package/dist/chunk-35668hyn.js +0 -1
  112. package/dist/chunk-3gmcvd0c.js +0 -1
  113. package/dist/chunk-5774a669.js +0 -1
  114. package/dist/chunk-7n035mhg.js +0 -1
  115. package/dist/chunk-9a7bppj7.js +0 -2
  116. package/dist/chunk-b08thknq.js +0 -1
  117. package/dist/chunk-d6tbr25k.js +0 -1
  118. package/dist/chunk-dt9n4f4e.js +0 -1
  119. package/dist/chunk-ermypm1x.js +0 -2
  120. package/dist/chunk-esp69w6w.js +0 -1
  121. package/dist/chunk-g1y60ey9.js +0 -1
  122. package/dist/chunk-gf5v8aff.js +0 -1
  123. package/dist/chunk-m9kh7djg.js +0 -6
  124. package/dist/chunk-ntmkzrs8.js +0 -1
  125. package/dist/chunk-pj15kt5b.js +0 -10
  126. package/dist/chunk-pv1vwasz.js +0 -1
  127. package/dist/chunk-vda03kxj.js +0 -1
  128. package/dist/web/assets/ChatView-DpvPjAh7.js +0 -63
  129. package/dist/web/assets/index-DEOQizD2.js +0 -203
  130. package/dist/web/assets/session-events-C5_Q0kZV.js +0 -29
  131. package/dist/web/assets/team-QZ9byb3E.js +0 -1
@@ -1,2 +1,2 @@
1
1
  import{createRequire as a}from"node:module";var c=a(import.meta.url);
2
- export{c as Bk};
2
+ export{c as Ek};
@@ -1,2 +1,2 @@
1
- import{pi as H,qi as I}from"./chunk-ramana2t.js";import{Mutex as J}from"async-mutex";class B extends Error{limit;resource="resident_runtimes";retryable=!0;constructor(b){super("Session runtime capacity is full");this.limit=b;this.name="SessionRuntimeCapacityError"}}class D extends Error{constructor(){super("Session runtime residency is closed");this.name="SessionRuntimeResidencyClosedError"}}class A extends Error{constructor(b){super(`Session runtime residency already owns key: ${b}`);this.name="SessionRuntimeResidencyConflictError"}}class K{maxResident;idleMs;now;residents=new Map;reservations=new Map;operations=new J;nextGeneration=1;closed=!1;constructor(b){if(!H(b.maxResident))throw Error("Invalid max resident Session Runtime limit");if(!I(b.idleMs))throw Error("Invalid Session Runtime idle timeout");this.maxResident=b.maxResident,this.idleMs=b.idleMs,this.now=b.now??Date.now}acquire(b){let j=this.residents.get(b);if(!j||j.poisoned)return;return j.pins++,j.lastUsedAt=this.now(),this.createLease(j)}owns(b,j){let q=this.residents.get(b);return Boolean(q&&(j===void 0||q.value===j))}async reserve(b,j){if(!b.trim())throw Error("Session runtime residency key must not be blank");return this.operations.runExclusive(async()=>{if(this.closed)throw new D;if(this.residents.has(b)||this.reservations.has(b))throw new A(b);while(this.retainedCount()>=this.maxResident){if(!j.allowEviction)throw new B(this.maxResident);let z=this.oldestEvictableWebResident();if(!z)throw new B(this.maxResident);await this.disposeResident(z,!0)}let q={generation:this.allocateGeneration(),surface:j.surface};return this.reservations.set(b,q),this.createReservation(b,q)})}async remove(b,j){return this.operations.runExclusive(async()=>{let q=this.residents.get(b);if(!q||j!==void 0&&q.value!==j)return!1;if(q.pins>0)return!1;return await this.disposeResident(q,!0),!0})}async forget(b,j){return this.operations.runExclusive(async()=>{let q=this.residents.get(b);if(!q||j!==void 0&&q.value!==j||q.pins>0)return!1;return this.residents.delete(b),!0})}async sweepIdle(){return this.operations.runExclusive(async()=>{if(this.closed)return 0;let b=0;while(!0){let j=this.oldestIdleWebResident();if(!j)return b;await this.disposeResident(j,!0),b++}})}async disposeAll(){await this.operations.runExclusive(async()=>{this.closed=!0,this.reservations.clear();let b;for(let j of[...this.residents.values()])try{await this.disposeResident(j,!1)}catch(q){b??=q}if(this.residents.clear(),b!==void 0)throw b})}getStats(){let b=0;for(let j of this.residents.values())if(j.pins>0)b++;return{resident:this.residents.size,reserved:this.reservations.size,pinned:b,maxResident:this.maxResident}}retainedCount(){return this.residents.size+this.reservations.size}allocateGeneration(){let b=this.nextGeneration;return this.nextGeneration=this.nextGeneration===Number.MAX_SAFE_INTEGER?1:this.nextGeneration+1,b}createReservation(b,j){let q=!1;return{commit:(z)=>{if(q)throw new A(b);if(z.key!==b||z.surface!==j.surface||this.reservations.get(b)!==j||this.closed)throw this.reservations.delete(b),q=!0,this.closed?new D:new A(b);this.reservations.delete(b);let G={...z,generation:j.generation,pins:1,lastUsedAt:this.now(),poisoned:!1};return this.residents.set(b,G),q=!0,this.createLease(G)},cancel:()=>{if(q)return;if(this.reservations.get(b)===j)this.reservations.delete(b);q=!0}}}createLease(b){let j=!1;return{value:b.value,release:()=>{if(j)return;j=!0;let q=this.residents.get(b.key);if(q!==b||q.generation!==b.generation)return;q.pins=Math.max(0,q.pins-1),q.lastUsedAt=this.now()}}}oldestEvictableWebResident(){return this.sortedWebResidents().find((b)=>this.canEvict(b))}oldestIdleWebResident(){let b=this.now();return this.sortedWebResidents().find((j)=>b-j.lastUsedAt>=this.idleMs&&this.canEvict(j))}sortedWebResidents(){return[...this.residents.values()].filter((b)=>b.surface==="web").sort((b,j)=>b.lastUsedAt-j.lastUsedAt||b.generation-j.generation)}canEvict(b){if(b.pins>0||b.poisoned)return!1;try{return b.canEvict()}catch{return!1}}async disposeResident(b,j){if(this.residents.get(b.key)!==b)return;this.residents.delete(b.key);try{await b.dispose()}catch(q){if(j&&!this.closed&&!this.residents.has(b.key))b.lastUsedAt=this.now(),b.poisoned=!0,this.residents.set(b.key,b);throw q}}}
1
+ import{si as H,ti as I}from"./chunk-atdq9btn.js";import{Mutex as J}from"async-mutex";class B extends Error{limit;resource="resident_runtimes";retryable=!0;constructor(b){super("Session runtime capacity is full");this.limit=b;this.name="SessionRuntimeCapacityError"}}class D extends Error{constructor(){super("Session runtime residency is closed");this.name="SessionRuntimeResidencyClosedError"}}class A extends Error{constructor(b){super(`Session runtime residency already owns key: ${b}`);this.name="SessionRuntimeResidencyConflictError"}}class K{maxResident;idleMs;now;residents=new Map;reservations=new Map;operations=new J;nextGeneration=1;closed=!1;constructor(b){if(!H(b.maxResident))throw Error("Invalid max resident Session Runtime limit");if(!I(b.idleMs))throw Error("Invalid Session Runtime idle timeout");this.maxResident=b.maxResident,this.idleMs=b.idleMs,this.now=b.now??Date.now}acquire(b){let j=this.residents.get(b);if(!j||j.poisoned)return;return j.pins++,j.lastUsedAt=this.now(),this.createLease(j)}owns(b,j){let q=this.residents.get(b);return Boolean(q&&(j===void 0||q.value===j))}async reserve(b,j){if(!b.trim())throw Error("Session runtime residency key must not be blank");return this.operations.runExclusive(async()=>{if(this.closed)throw new D;if(this.residents.has(b)||this.reservations.has(b))throw new A(b);while(this.retainedCount()>=this.maxResident){if(!j.allowEviction)throw new B(this.maxResident);let z=this.oldestEvictableWebResident();if(!z)throw new B(this.maxResident);await this.disposeResident(z,!0)}let q={generation:this.allocateGeneration(),surface:j.surface};return this.reservations.set(b,q),this.createReservation(b,q)})}async remove(b,j){return this.operations.runExclusive(async()=>{let q=this.residents.get(b);if(!q||j!==void 0&&q.value!==j)return!1;if(q.pins>0)return!1;return await this.disposeResident(q,!0),!0})}async forget(b,j){return this.operations.runExclusive(async()=>{let q=this.residents.get(b);if(!q||j!==void 0&&q.value!==j||q.pins>0)return!1;return this.residents.delete(b),!0})}async sweepIdle(){return this.operations.runExclusive(async()=>{if(this.closed)return 0;let b=0;while(!0){let j=this.oldestIdleWebResident();if(!j)return b;await this.disposeResident(j,!0),b++}})}async disposeAll(){await this.operations.runExclusive(async()=>{this.closed=!0,this.reservations.clear();let b;for(let j of[...this.residents.values()])try{await this.disposeResident(j,!1)}catch(q){b??=q}if(this.residents.clear(),b!==void 0)throw b})}getStats(){let b=0;for(let j of this.residents.values())if(j.pins>0)b++;return{resident:this.residents.size,reserved:this.reservations.size,pinned:b,maxResident:this.maxResident}}retainedCount(){return this.residents.size+this.reservations.size}allocateGeneration(){let b=this.nextGeneration;return this.nextGeneration=this.nextGeneration===Number.MAX_SAFE_INTEGER?1:this.nextGeneration+1,b}createReservation(b,j){let q=!1;return{commit:(z)=>{if(q)throw new A(b);if(z.key!==b||z.surface!==j.surface||this.reservations.get(b)!==j||this.closed)throw this.reservations.delete(b),q=!0,this.closed?new D:new A(b);this.reservations.delete(b);let G={...z,generation:j.generation,pins:1,lastUsedAt:this.now(),poisoned:!1};return this.residents.set(b,G),q=!0,this.createLease(G)},cancel:()=>{if(q)return;if(this.reservations.get(b)===j)this.reservations.delete(b);q=!0}}}createLease(b){let j=!1;return{value:b.value,release:()=>{if(j)return;j=!0;let q=this.residents.get(b.key);if(q!==b||q.generation!==b.generation)return;q.pins=Math.max(0,q.pins-1),q.lastUsedAt=this.now()}}}oldestEvictableWebResident(){return this.sortedWebResidents().find((b)=>this.canEvict(b))}oldestIdleWebResident(){let b=this.now();return this.sortedWebResidents().find((j)=>b-j.lastUsedAt>=this.idleMs&&this.canEvict(j))}sortedWebResidents(){return[...this.residents.values()].filter((b)=>b.surface==="web").sort((b,j)=>b.lastUsedAt-j.lastUsedAt||b.generation-j.generation)}canEvict(b){if(b.pins>0||b.poisoned)return!1;try{return b.canEvict()}catch{return!1}}async disposeResident(b,j){if(this.residents.get(b.key)!==b)return;this.residents.delete(b.key);try{await b.dispose()}catch(q){if(j&&!this.closed&&!this.residents.has(b.key))b.lastUsedAt=this.now(),b.poisoned=!0,this.residents.set(b.key,b);throw q}}}
2
2
  export{B as v,K as w};
@@ -0,0 +1 @@
1
+ import{nf as a,of as b,pf as c}from"./chunk-nyw686sf.js";import"./chunk-v2fewxvw.js";import"./chunk-mjnkxem3.js";import"./chunk-v508x7cg.js";import"./chunk-5j68055h.js";import"./chunk-az08pq83.js";import"./chunk-atdq9btn.js";import"./chunk-npc7jt96.js";import"./chunk-mc2mr1kn.js";import"./chunk-dv2m2xe5.js";import"./chunk-fbrdcveb.js";import"./chunk-ft1bdqbs.js";import"./chunk-jb4hmk56.js";import"./chunk-65c3vjwm.js";import"./chunk-2t0wp7gm.js";import"./chunk-jy7k2dwm.js";import"./chunk-earhezc8.js";import"./chunk-t88sfhjj.js";import"./chunk-516adpx6.js";export{a as validatePermissions,c as validateOutput,b as loadConfiguration};
@@ -1,4 +1,4 @@
1
- import"./chunk-v508x7cg.js";import{Gi as Q}from"./chunk-ramana2t.js";import"./chunk-6xvrrypm.js";import"./chunk-9a7bppj7.js";import{Si as L}from"./chunk-g799czsy.js";import"./chunk-mzye1ah2.js";import"./chunk-vp6d1fqp.js";import"./chunk-xg9fyvw0.js";import"./chunk-wxtj6gqb.js";import"./chunk-g9vdmvk2.js";import"./chunk-wxypv01z.js";import"./chunk-nxnmqk4s.js";import"./chunk-0k2x2ae6.js";import{Bk as F}from"./chunk-6e3mh79j.js";var K=[22,19,0];function T(G){let A=/^v?(\d+)\.(\d+)\.(\d+)/.exec(G);if(!A)return!1;let H=A.slice(1).map(Number);for(let z=0;z<K.length;z++){let B=H[z]??0,J=K[z];if(B!==J)return B>J}return!0}var X={command:"doctor",describe:"Check the health of your Blade installation",builder:(G)=>G.option("rebuild-index",{type:"boolean",default:!1,describe:"Rebuild the SQLite session index from JSONL transcripts"}),handler:async(G)=>{if(G.rebuildIndex){console.log(`Rebuilding session index from JSONL transcripts...
2
- `);try{let{rebuildProjectionIndex:z}=await import("./chunk-na4wzne8.js"),{SessionService:B}=await import("./chunk-d6tbr25k.js"),J=await z(B.projectionDeriverForSearch());if(J===null)console.log("[WARN] Session index unavailable (SQLite driver missing); reads fall back to JSONL scan.");else console.log(`[OK] Session index rebuilt: ${J} session(s) indexed.`)}catch(z){console.log("[FAIL] Session index rebuild failed"),console.log(` Error: ${z instanceof Error?z.message:"未知错误"}`),process.exit(1)}return}console.log(`Running Blade health check...
1
+ import"./chunk-v508x7cg.js";import{Ji as Q}from"./chunk-atdq9btn.js";import"./chunk-npc7jt96.js";import"./chunk-mc2mr1kn.js";import{Vi as L}from"./chunk-dv2m2xe5.js";import"./chunk-fbrdcveb.js";import"./chunk-ft1bdqbs.js";import"./chunk-jb4hmk56.js";import"./chunk-65c3vjwm.js";import"./chunk-2t0wp7gm.js";import"./chunk-jy7k2dwm.js";import"./chunk-earhezc8.js";import"./chunk-t88sfhjj.js";import{Ek as F}from"./chunk-516adpx6.js";var K=[22,19,0];function T(G){let A=/^v?(\d+)\.(\d+)\.(\d+)/.exec(G);if(!A)return!1;let H=A.slice(1).map(Number);for(let z=0;z<K.length;z++){let B=H[z]??0,J=K[z];if(B!==J)return B>J}return!0}var X={command:"doctor",describe:"Check the health of your Blade installation",builder:(G)=>G.option("rebuild-index",{type:"boolean",default:!1,describe:"Rebuild the SQLite session index from JSONL transcripts"}),handler:async(G)=>{if(G.rebuildIndex){console.log(`Rebuilding session index from JSONL transcripts...
2
+ `);try{let{rebuildProjectionIndex:z}=await import("./chunk-8py443a5.js"),{SessionService:B}=await import("./chunk-303b3x5q.js"),J=await z(B.projectionDeriverForSearch());if(J===null)console.log("[WARN] Session index unavailable (SQLite driver missing); reads fall back to JSONL scan.");else console.log(`[OK] Session index rebuilt: ${J} session(s) indexed.`)}catch(z){console.log("[FAIL] Session index rebuild failed"),console.log(` Error: ${z instanceof Error?z.message:"未知错误"}`),process.exit(1)}return}console.log(`Running Blade health check...
3
3
  `);let A=0;try{await Q.getInstance().initialize(),console.log("[OK] Configuration: OK")}catch(z){console.log("[FAIL] Configuration: FAILED"),console.log(` Error: ${z instanceof Error?z.message:"未知错误"}`),A++}let H=process.version;if(T(H))console.log(`[OK] Node.js version: ${H}`);else console.log(`[WARN] Node.js version: ${H} (required: >=22.19.0)`),A++;try{let z=await import("fs/promises"),B=L();await z.access(B,(await import("fs")).constants.R_OK|(await import("fs")).constants.W_OK),console.log("[OK] File system permissions: OK")}catch(z){console.log("[FAIL] File system permissions: FAILED"),console.log(" Error: Cannot read/write in current directory"),A++}try{await import("ink"),console.log("[OK] Dependencies: OK")}catch(z){console.log("[FAIL] Dependencies: FAILED"),console.log(" Error: Missing required dependencies"),A++}if(console.log(`
4
4
  Health Check Summary:`),A===0)console.log("All checks passed! Blade is ready to use.");else console.log(`Warning: Found ${A} issue(s). Please resolve them for optimal performance.`),process.exit(1)}};export{T as isSupportedNodeVersion,X as doctorCommands};
@@ -0,0 +1 @@
1
+ import{k as a,l as b,m as c,n as d,o as e}from"./chunk-5v1pjexj.js";import"./chunk-2t0wp7gm.js";import"./chunk-516adpx6.js";export{b as setSkipUntilVersion,d as performUpgrade,c as getUpgradeCommand,e as checkVersionOnStartup,a as checkVersion};
@@ -1,2 +1,2 @@
1
1
  import{nanoid as q}from"nanoid";var u=/^[A-Za-z0-9][A-Za-z0-9._-]*$/;function B(j="session",m=21){if(!u.test(j))throw Error(`Invalid session ID prefix: ${j}`);return`${j}-${q(m)}`}
2
- export{B as Wf};
2
+ export{B as Zf};
@@ -1,2 +1,2 @@
1
- import{Mj as S}from"./chunk-g9vdmvk2.js";import{Bk as f}from"./chunk-6e3mh79j.js";import*as $ from"fs/promises";import*as K from"path";import j from"semver";import{ProxyAgent as H,fetch as I}from"undici";function R(){return process.env.HTTPS_PROXY||process.env.HTTP_PROXY||process.env.https_proxy||process.env.http_proxy}function N(){let q=R();if(q)try{return new H(q)}catch(z){console.warn(`[proxyFetch] Invalid proxy URL: ${q}`)}return}async function M(q,z={}){let{timeout:W=30000,signal:Q,...B}=z;if(Q?.aborted)throw new DOMException("The operation was aborted.","AbortError");let J=N(),X=new AbortController,Y=!1,F=setTimeout(()=>{Y=!0,X.abort()},W),b=()=>X.abort();Q?.addEventListener("abort",b);try{let Z={method:B.method,headers:B.headers,body:B.body,signal:X.signal,dispatcher:J};return await I(q.toString(),Z)}catch(Z){if(Z instanceof Error&&Z.name==="AbortError"){if(Y)throw Error(`Request timeout after ${W}ms`);throw Z}throw Z}finally{clearTimeout(F),Q?.removeEventListener("abort",b)}}var w="blade-code",y="https://cdn.jsdelivr.net/npm/blade-code@latest/CHANGELOG.md",G=K.join(process.env.HOME||process.env.USERPROFILE||".",".blade"),O=K.join(G,"version-cache.json"),P=3600000,k=`https://registry.npmjs.org/${w}/latest`;async function L(){try{if(process.env.BLADE_VERSION)return process.env.BLADE_VERSION;return S()}catch{return"unknown"}}async function T(){try{let q=await $.readFile(O,"utf-8"),z=JSON.parse(q);if(Date.now()-z.checkedAt<P)return z;return{...z,checkedAt:0}}catch{return null}}async function D(q){try{await $.mkdir(G,{recursive:!0,mode:493}),await $.writeFile(O,JSON.stringify(q,null,2))}catch{}}async function x(){try{let q=await M(k,{timeout:5000,headers:{Accept:"application/json"}});if(!q.ok)return null;return(await q.json()).version||null}catch{return null}}async function _(q=!1){let z=await L(),W=y;if(z==="unknown")return{currentVersion:z,latestVersion:null,hasUpdate:!1,shouldPrompt:!1,releaseNotesUrl:W,error:"Unable to determine current version"};let Q=await T(),B=Q?.skipUntilVersion,J=null;if(!q&&Q?.latestVersion&&Q.checkedAt>0)J=Q.latestVersion;else if(J=await x(),J)await D({latestVersion:J,checkedAt:Date.now(),skipUntilVersion:B});else if(Q?.latestVersion)await D({checkedAt:0,skipUntilVersion:B});if(!J||!j.valid(J))return{currentVersion:z,latestVersion:null,hasUpdate:!1,shouldPrompt:!1,releaseNotesUrl:W,error:"Unable to check for updates"};if(j.lt(J,z))J=z,await D({latestVersion:J,checkedAt:Date.now(),skipUntilVersion:B});let X=j.gt(J,z),Y=X;if(X&&B)Y=j.gt(J,B);return{currentVersion:z,latestVersion:J,hasUpdate:X,shouldPrompt:Y,releaseNotesUrl:W}}async function u(q){let z=await T();await D({latestVersion:z?.latestVersion??q,checkedAt:z?.checkedAt||Date.now(),skipUntilVersion:q})}function g(){return`npm install -g ${w}@latest --registry https://registry.npmjs.org`}async function C(){let{spawn:q}=await import("child_process");return new Promise((z)=>{let W=g(),Q=q(W,{stdio:"inherit",shell:!0});Q.on("close",(B)=>{if(B===0)z({success:!0,message:"Upgrade successful! Please restart blade."});else z({success:!1,message:`Upgrade failed (exit code: ${B})`})}),Q.on("error",(B)=>{z({success:!1,message:`Upgrade failed: ${B.message}`})})})}async function V(){try{let q=await _();return q.shouldPrompt?q:null}catch{return null}}
1
+ import{Pj as S}from"./chunk-2t0wp7gm.js";import{Ek as f}from"./chunk-516adpx6.js";import*as $ from"fs/promises";import*as K from"path";import j from"semver";import{ProxyAgent as H,fetch as I}from"undici";function R(){return process.env.HTTPS_PROXY||process.env.HTTP_PROXY||process.env.https_proxy||process.env.http_proxy}function N(){let q=R();if(q)try{return new H(q)}catch(z){console.warn(`[proxyFetch] Invalid proxy URL: ${q}`)}return}async function M(q,z={}){let{timeout:W=30000,signal:Q,...B}=z;if(Q?.aborted)throw new DOMException("The operation was aborted.","AbortError");let J=N(),X=new AbortController,Y=!1,F=setTimeout(()=>{Y=!0,X.abort()},W),b=()=>X.abort();Q?.addEventListener("abort",b);try{let Z={method:B.method,headers:B.headers,body:B.body,signal:X.signal,dispatcher:J};return await I(q.toString(),Z)}catch(Z){if(Z instanceof Error&&Z.name==="AbortError"){if(Y)throw Error(`Request timeout after ${W}ms`);throw Z}throw Z}finally{clearTimeout(F),Q?.removeEventListener("abort",b)}}var w="blade-code",y="https://cdn.jsdelivr.net/npm/blade-code@latest/CHANGELOG.md",G=K.join(process.env.HOME||process.env.USERPROFILE||".",".blade"),O=K.join(G,"version-cache.json"),P=3600000,k=`https://registry.npmjs.org/${w}/latest`;async function L(){try{if(process.env.BLADE_VERSION)return process.env.BLADE_VERSION;return S()}catch{return"unknown"}}async function T(){try{let q=await $.readFile(O,"utf-8"),z=JSON.parse(q);if(Date.now()-z.checkedAt<P)return z;return{...z,checkedAt:0}}catch{return null}}async function D(q){try{await $.mkdir(G,{recursive:!0,mode:493}),await $.writeFile(O,JSON.stringify(q,null,2))}catch{}}async function x(){try{let q=await M(k,{timeout:5000,headers:{Accept:"application/json"}});if(!q.ok)return null;return(await q.json()).version||null}catch{return null}}async function _(q=!1){let z=await L(),W=y;if(z==="unknown")return{currentVersion:z,latestVersion:null,hasUpdate:!1,shouldPrompt:!1,releaseNotesUrl:W,error:"Unable to determine current version"};let Q=await T(),B=Q?.skipUntilVersion,J=null;if(!q&&Q?.latestVersion&&Q.checkedAt>0)J=Q.latestVersion;else if(J=await x(),J)await D({latestVersion:J,checkedAt:Date.now(),skipUntilVersion:B});else if(Q?.latestVersion)await D({checkedAt:0,skipUntilVersion:B});if(!J||!j.valid(J))return{currentVersion:z,latestVersion:null,hasUpdate:!1,shouldPrompt:!1,releaseNotesUrl:W,error:"Unable to check for updates"};if(j.lt(J,z))J=z,await D({latestVersion:J,checkedAt:Date.now(),skipUntilVersion:B});let X=j.gt(J,z),Y=X;if(X&&B)Y=j.gt(J,B);return{currentVersion:z,latestVersion:J,hasUpdate:X,shouldPrompt:Y,releaseNotesUrl:W}}async function u(q){let z=await T();await D({latestVersion:z?.latestVersion??q,checkedAt:z?.checkedAt||Date.now(),skipUntilVersion:q})}function g(){return`npm install -g ${w}@latest --registry https://registry.npmjs.org`}async function C(){let{spawn:q}=await import("child_process");return new Promise((z)=>{let W=g(),Q=q(W,{stdio:"inherit",shell:!0});Q.on("close",(B)=>{if(B===0)z({success:!0,message:"Upgrade successful! Please restart blade."});else z({success:!1,message:`Upgrade failed (exit code: ${B})`})}),Q.on("error",(B)=>{z({success:!1,message:`Upgrade failed: ${B.message}`})})})}async function V(){try{let q=await _();return q.shouldPrompt?q:null}catch{return null}}
2
2
  export{_ as k,u as l,g as m,C as n,V as o};
@@ -0,0 +1,2 @@
1
+ import{Ni as M,Oi as i,Qi as o}from"./chunk-mc2mr1kn.js";import{Aj as B,Bj as X,Cj as K,vj as e,zj as $}from"./chunk-ft1bdqbs.js";import{Zj as p}from"./chunk-t88sfhjj.js";var w=[{min:0,max:59},{min:0,max:23},{min:1,max:31},{min:1,max:12},{min:0,max:7}],Z1={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6},l=new Map;function I(J,Z,j){let Y=new Set;for(let H of J.split(",")){let[k,G]=H.split("/"),V=G?Number.parseInt(G,10):1;if(!Number.isInteger(V)||V<1)throw Error(`Invalid cron step in "${J}"`);let W=Z,Q=j;if(k!=="*"&&k!=="")if(k.includes("-")){let[b,J1]=k.split("-");W=Number.parseInt(b,10),Q=Number.parseInt(J1,10)}else W=Number.parseInt(k,10),Q=W;if(!Number.isInteger(W)||!Number.isInteger(Q)||W<Z||Q>j||W>Q)throw Error(`Invalid cron range "${k}" in field "${J}"`);for(let b=W;b<=Q;b+=V)Y.add(b)}return Y}function u(J){let Z=J.trim().split(/\s+/);if(Z.length!==5)throw Error(`Cron expression must have 5 fields (min hour dom mon dow), got ${Z.length}`);let[j,Y,H,k,G]=Z,V=I(G,w[4].min,w[4].max),W=new Set([...V].map((Q)=>Q===7?0:Q));return{minutes:I(j,w[0].min,w[0].max),hours:I(Y,w[1].min,w[1].max),daysOfMonth:I(H,w[2].min,w[2].max),months:I(k,w[3].min,w[3].max),daysOfWeek:W,domRestricted:H.trim()!=="*",dowRestricted:G.trim()!=="*"}}function B1(J,Z){if(!Z)return{minute:J.getMinutes(),hour:J.getHours(),dayOfMonth:J.getDate(),month:J.getMonth()+1,dayOfWeek:J.getDay()};let j=l.get(Z);if(!j)j=new Intl.DateTimeFormat("en-US",{timeZone:Z,month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",weekday:"short",hourCycle:"h23"}),l.set(Z,j);let Y=Object.fromEntries(j.formatToParts(J).filter((H)=>H.type!=="literal").map((H)=>[H.type,H.value]));return{minute:Number(Y.minute),hour:Number(Y.hour),dayOfMonth:Number(Y.day),month:Number(Y.month),dayOfWeek:Z1[Y.weekday]??-1}}function K1(J,Z,j){let Y=B1(Z,j);if(!J.minutes.has(Y.minute))return!1;if(!J.hours.has(Y.hour))return!1;if(!J.months.has(Y.month))return!1;let H=J.daysOfMonth.has(Y.dayOfMonth),k=J.daysOfWeek.has(Y.dayOfWeek);if(J.domRestricted&&J.dowRestricted)return H||k;if(J.domRestricted)return H;if(J.dowRestricted)return k;return!0}function Y1(J,Z,j){let Y=u(J),H=new Date(Z.getTime());H.setSeconds(0,0),H.setMinutes(H.getMinutes()+1);let k=new Date(Z.getTime());k.setFullYear(k.getFullYear()+4);while(H.getTime()<=k.getTime()){if(K1(Y,H,j))return new Date(H.getTime());H.setMinutes(H.getMinutes()+1)}return null}var d={s:1000,m:60000,h:3600000,d:86400000};function n1(J){let j=J.trim().toLowerCase().match(/^(\d+)\s*([smhd]?)$/);if(!j)return null;let Y=Number.parseInt(j[1],10);if(!Number.isInteger(Y)||Y<=0)return null;let H=j[2]||"m";return Y*d[H]}function j1(J){for(let Z of["d","h","m","s"]){let j=d[Z];if(J%j===0)return`${J/j}${Z}`}return`${Math.round(J/1000)}s`}function U(J,Z,j){switch(J.kind){case"cron":{if(!J.cron)return null;try{return Y1(J.cron,Z,J.timezone)}catch{return null}}case"interval":{if(!J.intervalMs||J.intervalMs<=0)return null;let H=new Date((j??Z).getTime()+J.intervalMs);return H.getTime()<=Z.getTime()?new Date(Z.getTime()+1000):H}case"once":{if(!J.runAt)return null;let Y=new Date(J.runAt);if(Number.isNaN(Y.getTime()))return null;return Y.getTime()>Z.getTime()?Y:null}default:return null}}function F(J){switch(J.kind){case"cron":if(!J.cron)return"cron trigger requires a cron expression";try{if(u(J.cron),J.timezone)new Intl.DateTimeFormat("en-US",{timeZone:J.timezone}).format();return null}catch(Z){return Z instanceof Error?Z.message:"invalid cron expression"}case"interval":if(!J.intervalMs||J.intervalMs<60000)return"interval trigger requires intervalMs >= 60000 (1 minute)";return null;case"once":{if(!J.runAt)return"once trigger requires runAt timestamp";let Z=new Date(J.runAt);if(Number.isNaN(Z.getTime()))return"once trigger runAt is not a valid date";return null}default:return"unknown trigger kind"}}function i1(J){switch(J.kind){case"cron":return`cron: ${J.cron??"?"}`;case"interval":return`every ${J.intervalMs?j1(J.intervalMs):"?"}`;case"once":return`once at ${J.runAt??"?"}`;default:return"unknown"}}import{mkdir as u1,readFile as d1}from"node:fs/promises";import $1 from"node:path";import{nanoid as m1}from"nanoid";import h1 from"write-file-atomic";var x=160,H1=240,m=$.String({pattern:"^[a-f0-9]{64}$"}),k1=B($.Object({id:$.String({minLength:1,maxLength:128}),position:$.Integer({minimum:0,maximum:x-1}),queuedAt:$.String({minLength:20,maxLength:32}),kind:K(["user","internal"]),state:K(["pending","locked"]),delivery:K(["current_turn","next_turn","recovery"]),mutable:$.Boolean(),preview:$.Optional($.String({maxLength:H1})),previewTruncated:$.Boolean(),attachmentCount:$.Integer({minimum:0,maximum:20})},{additionalProperties:!1})),h=B($.Object({version:m,pending:$.Integer({minimum:0,maximum:x}),mutable:$.Integer({minimum:0,maximum:x}),locked:$.Integer({minimum:0,maximum:x}),internal:$.Integer({minimum:0,maximum:x}),items:$.Array(k1,{maxItems:x})},{additionalProperties:!1})),Q1=$.Union([$.Object({type:$.Literal("remove"),messageId:$.String({minLength:1,maxLength:128})},{additionalProperties:!1}),$.Object({type:$.Literal("move"),messageId:$.String({minLength:1,maxLength:128}),toPosition:$.Integer({minimum:0,maximum:x-1})},{additionalProperties:!1})]),a1=B($.Object({expectedVersion:m,operation:Q1},{additionalProperties:!1})),t1=B($.Object({snapshot:h},{additionalProperties:!1})),W1=K(["revision_conflict","already_claimed","immutable_origin","immutable_boundary","not_found","runtime_unavailable","invalid_mutation","storage_unavailable"]),r1=B($.Object({error:$.Object({code:W1,message:$.String({minLength:1,maxLength:256})},{additionalProperties:!1}),snapshot:h},{additionalProperties:!1}));var c=128,X1=128,b1=8,G1=1e6,V1=8640000000000000,D=$.Integer({minimum:0,maximum:G1}),L=$.Integer({minimum:0,maximum:V1}),w1=$.String({minLength:1,maxLength:c,pattern:"^[^\x00-\x1F]+$"}),D1=K(["starting","thinking","responding","executing_tools","compacting","continuing"]),z1=$.Refine($.Object({name:w1,kind:$.Optional(K(["readonly","write","execute"])),startedAt:L,progress:$.Optional(D),total:$.Optional(D)},{additionalProperties:!1}),(J)=>J.progress===void 0&&J.total===void 0||J.progress!==void 0&&J.total!==void 0&&J.progress<=J.total,()=>"progress and total must be present together with progress <= total"),x1=$.Refine($.Object({phase:D1,startedAt:L,updatedAt:L,turn:D,maxTurns:$.Union([D,$.Null()]),outputStarted:$.Boolean(),toolCallsStarted:D,toolCallsCompleted:D,activeTools:$.Array(z1,{maxItems:b1}),activeToolOverflow:D},{additionalProperties:!1}),(J)=>J.startedAt<=J.updatedAt&&J.toolCallsCompleted<=J.toolCallsStarted&&J.activeTools.length+J.activeToolOverflow<=J.toolCallsStarted-J.toolCallsCompleted,()=>"turn activity snapshot counters and timestamps are inconsistent"),p1=B($.Object({version:$.Literal(1),generation:$.String({minLength:1,maxLength:X1,pattern:"^[^\x00-\x1F]+$"}),revision:D,snapshot:$.Union([x1,$.Null()])},{additionalProperties:!1}));function e1(J){let Z=[...J].filter((j)=>{let Y=j.codePointAt(0)??0;return Y>31&&Y!==127}).join("").trim().slice(0,c);if(!Z)throw Error("Turn activity tool name is empty");return Z}var g=16384;function J0(J){let Z=/^\s*\/btw(?:\s+([\s\S]*))?\s*$/iu.exec(J);if(!Z)return;return{question:(Z[1]??"").trim()}}var O=B(K(["default","autoEdit","yolo","plan"]));var A=B(K(["user","assistant","system","tool"])),O1=B($.Union([$.Object({type:$.Literal("text"),text:$.String()}),$.Object({type:$.Literal("image_url"),image_url:$.Object({url:$.String()})})])),s=$.Union([$.String(),$.Array(O1)]),H0=B($.Object({id:$.String(),role:A,content:s,timestamp:$.Number(),metadata:$.Optional($.Record($.String(),$.Unknown())),thinkingContent:$.Optional($.String()),tool_call_id:$.Optional($.String()),name:$.Optional($.String()),tool_calls:$.Optional($.Unknown())})),P1=B(K(["queued","running","completed","failed","cancelled","interrupted"])),N=B(K(["local","worktree"])),R=B(K(["high","medium","low"])),E=B(K(["feature","bug","maintenance","research"])),q1=B(K(["applied","discarded","conflicted"])),v1=B($.Object({status:q1,updatedAt:$.String(),sourceCommit:$.Optional($.String()),changedFiles:$.Optional($.Integer({minimum:0})),message:$.Optional($.String())})),f1=B($.Object({changedFiles:$.Integer({minimum:0}),additions:$.Integer({minimum:0}),deletions:$.Integer({minimum:0}),commits:$.Integer({minimum:0})})),I1=B($.Object({path:$.String({minLength:1}),patch:$.String({maxLength:2097152}),additions:$.Integer({minimum:0}),deletions:$.Integer({minimum:0}),binary:$.Boolean(),truncated:$.Boolean()})),k0=B($.Object({sessionId:$.String(),projectPath:$.String(),baseCommit:$.String(),files:$.Array(I1,{maxItems:100}),truncated:$.Boolean()})),N1=$.Union([$.String(),$.Number(),$.Boolean(),$.Array($.String())]),C1=B($.Object({name:$.String(),type:K(["string","number","integer","boolean","select","multi-select"]),title:$.String(),description:$.Optional($.String()),required:$.Boolean(),defaultValue:$.Optional(N1),options:$.Optional($.Array($.Object({value:$.String(),label:$.String()}))),format:$.Optional(K(["date","uri","email","date-time"])),minimum:$.Optional($.Number()),maximum:$.Optional($.Number()),minLength:$.Optional($.Number()),maxLength:$.Optional($.Number()),minItems:$.Optional($.Number()),maxItems:$.Optional($.Number())})),Q0=B($.Object({serverName:$.String(),mode:K(["form","url"]),message:$.String(),fields:$.Optional($.Array(C1)),requestedSchema:$.Optional($.Record($.String(),$.Unknown())),url:$.Optional($.String()),domain:$.Optional($.String()),elicitationId:$.Optional($.String())})),U1=B($.Object({type:K(["permission","question","elicitation"]),requestId:$.String()})),F1=B($.Object({code:K(["authentication","permission","rate_limit","timeout","network","model_unavailable","context_limit","unsupported_input","workspace_unavailable","capacity","runtime"]),message:$.String({minLength:1,maxLength:500}),retryable:$.Boolean(),resource:$.Optional(K(["pending_count","pending_bytes","resident_runtimes"]))})),P=B(K(["auto","off","minimal","low","medium","high","xhigh","max"])),q=B(K(["auto","standard","fast","flex"])),v=B(K(["auto","low","medium","high"])),z=B($.Union([K(["auto","pragmatic","friendly","explanatory"]),$.String({minLength:7,maxLength:300,pattern:"^(?:(?:user|project):[a-z0-9][a-z0-9._-]{0,63}(?::[a-z0-9][a-z0-9._-]{0,63}){0,3}|plugin:[a-z0-9][a-z0-9._-]{0,63}:[a-z0-9][a-z0-9._-]{0,63}(?::[a-z0-9][a-z0-9._-]{0,63}){0,3})$"})])),C=B($.Object({sessionId:$.String(),projectPath:$.String(),title:$.Optional($.String()),gitBranch:$.Optional($.String()),rootId:$.String(),parentId:$.Optional($.String()),relationType:$.Optional(K(["subagent","fork"])),resumedFrom:$.Optional($.String()),rootAgentId:$.Optional($.String()),resumeDepth:$.Optional($.Integer({minimum:0})),taskStatus:X(P1,"completed"),taskStatusReason:$.Optional($.String()),taskFailure:$.Optional(F1),taskStartedAt:$.Optional($.String()),taskCompletedAt:$.Optional($.String()),taskPromptSummary:$.Optional($.String()),taskPriority:$.Optional(R),taskKind:$.Optional(E),taskDueAt:$.Optional($.String()),taskModelId:$.Optional($.String()),selectedModelId:$.Optional($.String()),permissionMode:$.Optional(O),reasoningEffort:$.Optional(P),serviceTier:$.Optional(q),responseVerbosity:$.Optional(v),communicationStyle:$.Optional(z),communicationStyleDigest:$.Optional($.String({pattern:"^[a-f0-9]{64}$"})),projectInstructionsDigest:$.Optional($.String({pattern:"^[a-f0-9]{64}$"})),taskRetryAvailable:$.Optional($.Boolean()),taskRetriedFrom:$.Optional($.Object({sessionId:$.String(),projectPath:$.String()})),taskDelivery:$.Optional(v1),taskIsolation:$.Optional(N),taskSourceProjectPath:$.Optional($.String()),taskWorktreePath:$.Optional($.String()),taskWorktreeBranch:$.Optional($.String()),taskBaseCommit:$.Optional($.String()),taskDiffStat:$.Optional(f1),taskQueuePosition:$.Optional($.Integer({minimum:1})),taskQueueDepth:$.Optional($.Integer({minimum:0})),taskConcurrencyLimit:$.Optional($.Integer({minimum:1})),archivedAt:$.Optional($.String()),archivedBySessionId:$.Optional($.String()),pendingInteraction:$.Optional(U1),messageCount:$.Number(),firstMessageTime:$.String(),lastMessageTime:$.String(),hasErrors:$.Boolean()})),W0=B($.Object({sessions:$.Array(C),nextCursor:$.Optional($.String())})),X0=B($.Object({session:C,archivedSessionIds:$.Array($.String())})),b0=B($.Object({session:C,restoredSessionIds:$.Array($.String())})),G0=B($.Object({version:$.Union([$.Literal(1),$.Literal(2)]),sessionId:$.String(),goalId:$.String(),objective:$.String(),status:K(["active","verifying","paused","blocked","usage_limited","budget_limited","complete"]),tokenBudget:$.Optional($.Number()),tokensUsed:$.Number(),timeUsedSeconds:$.Number(),continuationCount:$.Number(),statusReason:$.Optional($.String()),completionVerification:$.Optional($.Object({attempt:$.Integer({minimum:1}),status:K(["pending","pass","fail","partial"]),requestedAt:$.String(),completedAt:$.Optional($.String()),verifierSessionId:$.Optional($.String()),summary:$.Optional($.String()),evidenceSha256:$.Optional($.String({pattern:"^[a-f0-9]{64}$"}))})),prematureStop:$.Optional($.Object({pattern:$.Unsafe({type:"string"}),consecutiveCount:$.Integer({minimum:1}),detectedAt:$.String()})),verificationStall:$.Optional($.Unsafe({type:"object"})),executionFrontier:$.Optional($.Object({taskListId:$.String({minLength:1,maxLength:256}),total:$.Integer({minimum:0}),completed:$.Integer({minimum:0}),inProgress:$.Integer({minimum:0}),pending:$.Integer({minimum:0}),blocked:$.Integer({minimum:0}),nextTask:$.Optional($.Object({id:$.String({minLength:1}),subject:$.String({minLength:1,maxLength:512}),priority:K(["high","medium","low"])})),digestSha256:$.String({pattern:"^[a-f0-9]{64}$"}),observedAt:$.String()})),frontierStall:$.Optional($.Object({category:K(["waiting_dependency","same_task_no_effect","repeated_deferral"]),consecutiveCount:$.Integer({minimum:1,maximum:3}),digestSha256:$.String({pattern:"^[a-f0-9]{64}$"}),detectedAt:$.String()})),createdAt:$.String(),updatedAt:$.String()})),a=B($.Object({role:A,content:s,metadata:$.Optional($.Unknown()),reasoningContent:$.Optional($.String()),thinkingContent:$.Optional($.String()),tool_call_id:$.Optional($.String()),name:$.Optional($.String()),tool_calls:$.Optional($.Unknown())})),V0=B($.Object({session:C,messages:$.Array(a)})),t=B(K(["conversation","code","both"])),L1=B($.Object({messageId:$.String(),preview:$.String(),createdAt:$.String(),fileCount:$.Integer({minimum:0})})),w0=B($.Object({targetMessageId:$.String({minLength:1}),mode:X(t,"conversation")})),D0=B($.Object({checkpoint:L1,mode:t,removedTurns:$.Integer({minimum:1}),restoredFiles:$.Array($.String()),messages:$.Array(a)})),M1=K(["running","completed","failed","cancelled"]),n=B($.Object({id:$.String(),subagentType:$.String(),description:$.String(),status:M1,background:$.Boolean(),rootAgentId:$.String(),resumedFrom:$.Optional($.String()),resumeDepth:$.Integer({minimum:0}),createdAt:$.Number(),lastActiveAt:$.Number(),completedAt:$.Optional($.Number()),restartRecovery:$.Optional($.Object({outcome:K(["completed","interrupted","failed"]),recoveredAt:$.Number()})),result:$.Optional($.Object({success:$.Boolean(),message:$.String(),error:$.Optional($.String()),verificationCommands:$.Optional($.Array($.String())),verificationVerdict:$.Optional(K(["pass","fail","partial"])),modifiedFiles:$.Optional($.Array($.String()))})),stats:$.Optional($.Object({tokens:$.Optional($.Number()),toolCalls:$.Optional($.Number()),duration:$.Optional($.Number())}))})),z0=B($.Object({prompt:$.String({minLength:1,maxLength:32000,pattern:"\\S"})})),x0=B($.Object({source:n,session:n})),O0=B($.Object({sessionId:$.String(),projectPath:$.String()})),P0=B($.Object({path:$.String(),name:$.String(),gitBranch:$.Optional($.String()),available:$.Boolean(),isCurrent:$.Boolean(),boundAt:$.String()})),q0=B($.Union([$.Object({cancelled:$.Literal(!0)}),$.Object({cancelled:$.Literal(!1),path:$.String({minLength:1})})])),v0=B($.Object({type:$.String(),seq:$.Optional($.Number()),properties:$.Record($.String(),$.Unknown())})),r=$.Object({type:K(["file","image","url"]),path:$.Optional($.String()),url:$.Optional($.String()),content:$.Optional($.String({maxLength:i})),mimeType:$.Optional($.String()),name:$.Optional($.String())}),y=$.Record($.String(),$.Unknown()),f0=B($.Object({prompt:$.String({minLength:1,maxLength:32000,pattern:"\\S"}),title:$.Optional($.String({minLength:1,maxLength:200})),taskPriority:X(R,"medium"),taskKind:X(E,"feature"),taskDueAt:$.Optional($.String({minLength:1,maxLength:64})),projectPath:$.Optional($.String()),modelId:$.Optional($.String({minLength:1,maxLength:500})),reasoningEffort:$.Optional(P),serviceTier:$.Optional(q),responseVerbosity:$.Optional(v),communicationStyle:$.Optional(z),isolation:X(N,"worktree"),permissionMode:X(O,"default"),attachments:$.Optional($.Array(r,{maxItems:M})),outputSchema:$.Optional(y)})),I0=B($.Object({title:$.Optional($.String({minLength:1,maxLength:200})),taskPriority:$.Optional(R),taskKind:$.Optional(E),taskDueAt:$.Optional($.Union([$.String({minLength:1,maxLength:64}),$.Null()]))})),N0=B($.Object({session:C,runId:$.String(),messageId:$.String(),status:K(["queued","running"]),queuePosition:$.Optional($.Integer({minimum:1})),queueDepth:$.Optional($.Integer({minimum:0})),maxConcurrentTasks:$.Optional($.Integer({minimum:1}))})),C0=B($.Object({action:K(["apply","discard"])})),_=B($.Object({kind:K(["cron","interval","once"]),cron:$.Optional($.String({minLength:1,maxLength:120})),intervalMs:$.Optional($.Integer({minimum:60000})),runAt:$.Optional($.String({minLength:1,maxLength:40})),timezone:$.Optional($.String({minLength:1,maxLength:80}))})),A1=B($.Object({modelId:$.Optional($.String({minLength:1,maxLength:500})),reasoningEffort:$.Optional(P),serviceTier:$.Optional(q),responseVerbosity:$.Optional(v),communicationStyle:$.Optional(z),isolation:X(N,"worktree"),permissionMode:X(O,"default")})),S=B($.Object({id:$.String(),title:$.Optional($.String({minLength:1,maxLength:200})),prompt:$.String({minLength:1,maxLength:32000,pattern:"\\S"}),projectPath:$.String({minLength:1}),trigger:_,dispatch:A1,enabled:$.Boolean(),createdAt:$.String(),updatedAt:$.String(),nextRunAt:$.Union([$.String(),$.Null()]),expiresAt:$.Union([$.String(),$.Null()]),lastRunAt:$.Optional($.String()),lastRunSessionId:$.Optional($.String()),lastStatus:$.Optional(K(["queued","running","completed","failed","cancelled","interrupted","error"])),lastError:$.Optional($.String()),runCount:$.Integer({minimum:0})})),U0=B($.Object({title:$.Optional($.String({minLength:1,maxLength:200})),prompt:$.String({minLength:1,maxLength:32000,pattern:"\\S"}),projectPath:$.String({minLength:1}),trigger:_,modelId:$.Optional($.String({minLength:1,maxLength:500})),reasoningEffort:$.Optional(P),serviceTier:$.Optional(q),responseVerbosity:$.Optional(v),communicationStyle:$.Optional(z),isolation:X(N,"worktree"),permissionMode:X(O,"default"),enabled:X($.Boolean(),!0)})),F0=B($.Object({title:$.Optional($.String({minLength:1,maxLength:200})),prompt:$.Optional($.String({minLength:1,maxLength:32000,pattern:"\\S"})),trigger:$.Optional(_),modelId:$.Optional($.String({minLength:1,maxLength:500})),reasoningEffort:$.Optional(P),serviceTier:$.Optional(q),responseVerbosity:$.Optional(v),communicationStyle:$.Optional(z),isolation:$.Optional(N),permissionMode:$.Optional(O),enabled:$.Optional($.Boolean())})),L0=B($.Object({schedules:$.Array(S)})),M0=B($.Object({content:$.String({maxLength:o}),projectPath:$.Optional($.String()),modelId:$.Optional($.String({minLength:1,maxLength:500})),reasoningEffort:$.Optional(P),serviceTier:$.Optional(q),responseVerbosity:$.Optional(v),communicationStyle:$.Optional(z),permissionMode:$.Optional(O),attachments:$.Optional($.Array(r,{maxItems:M})),outputSchema:$.Optional(y)})),R1=K(["completed","failed","aborted","timed_out","spawn_error"]),E1=B($.Object({version:$.Literal(1),command:$.String(),status:R1,exitCode:$.Union([$.Integer(),$.Null()]),durationMs:$.Number({minimum:0}),stdout:$.String(),stderr:$.String(),stdoutOmittedBytes:$.Integer({minimum:0}),stderrOmittedBytes:$.Integer({minimum:0}),binaryOutput:$.Boolean(),truncated:$.Boolean()})),A0=B($.Object({command:$.String({minLength:1,maxLength:32768,pattern:"^(?![\\s\\S]*\\u0000)(?=[\\s\\S]*\\S)[\\s\\S]*$"}),projectPath:$.Optional($.String())})),R0=B($.Object({executionId:$.String(),messageId:$.String(),record:E1,auxiliary:$.Boolean(),delivery:$.Optional(K(["current_turn","next_turn"])),queued:$.Optional($.Integer({minimum:0}))})),E0=B($.Object({question:$.String({minLength:1,maxLength:g,pattern:"^(?![\\s\\S]*\\x00)(?=[\\s\\S]*\\S)[\\s\\S]*$"}),projectPath:$.Optional($.String())})),_0=B($.Object({response:$.String({minLength:1}),durationMs:$.Number({minimum:0}),modelId:$.Optional($.String()),usage:$.Optional($.Object({promptTokens:$.Number({minimum:0}),completionTokens:$.Number({minimum:0}),totalTokens:$.Number({minimum:0}),reasoningTokens:$.Optional($.Number({minimum:0})),cacheCreationInputTokens:$.Optional($.Number({minimum:0})),cacheReadInputTokens:$.Optional($.Number({minimum:0})),costUsd:$.Optional($.Number({minimum:0}))}))})),S0=B($.Object({projectPath:$.String(),kind:K(["uncommitted","base","commit"]),ref:$.Optional($.String({maxLength:200})),instructions:$.Optional($.String({maxLength:4000})),modelId:$.Optional($.String({minLength:1,maxLength:200}))})),l0=B($.Object({reviewId:$.String(),status:$.Literal("running")})),u0=B($.Object({messageId:$.String(),role:A,content:$.String(),timestamp:$.String()})),d0=B($.Object({approved:$.Boolean(),remember:$.Optional($.Boolean()),scope:$.Optional(K(["once","session","project"])),targetMode:$.Optional(O),feedback:$.Optional($.String()),answers:$.Optional($.Record($.String(),$.Union([$.String(),$.Array($.String())]))),elicitation:$.Optional($.Object({action:K(["accept","decline","cancel"]),content:$.Optional($.Record($.String(),$.Union([$.String({maxLength:4000}),$.Number(),$.Boolean(),$.Array($.String({maxLength:1000}),{maxItems:100})]),{maxProperties:32}))}))})),_1=B($.Object({id:z,name:$.String({minLength:1,maxLength:80}),description:$.String({minLength:1,maxLength:256}),source:K(["built-in","user","project","plugin"]),contentSha256:$.Optional($.String({pattern:"^[a-f0-9]{64}$"}))})),m0=B($.Object({id:$.String(),displayName:$.Optional($.String()),provider:$.String(),model:$.String(),contextWindow:$.Optional($.Number()),maxTokens:$.Optional($.Number()),reasoning:$.Optional($.Boolean()),supportedReasoningEfforts:$.Optional($.Array(K(["off","minimal","low","medium","high","xhigh","max"]))),supportedServiceTiers:$.Optional($.Array(K(["standard","fast","flex"]))),supportedResponseVerbosities:$.Optional($.Array(K(["low","medium","high"]))),communicationStyles:$.Optional($.Array(_1,{maxItems:36})),input:$.Optional($.Array(K(["text","image"]))),overrides:$.Optional($.Object({baseUrl:$.Optional($.String()),temperature:$.Optional($.Number()),maxOutputTokens:$.Optional($.Number()),timeout:$.Optional($.Number()),streamIdleTimeout:$.Optional($.Number({minimum:1000}))}))})),h0=B(K(["vs-dark","vs-light","hc-black"])),S1=B(K(["light","dark","system"])),l1=B($.Object({language:$.String(),codeTheme:$.String(),uiTheme:S1,autoSaveSessions:$.Boolean(),notifyBuild:$.Boolean(),notifyErrors:$.Boolean(),notifySounds:$.Boolean(),privacyTelemetry:$.Boolean(),privacyCrash:$.Boolean(),agentTeamsEnabled:$.Boolean(),communicationStyle:$.Optional(z)})),c0=B($.Partial(l1));var T=e("Service"),c1=1;function g1(){return $1.join(p(),"schedules.json")}class f{filePath;static instance;static getInstance(){if(!f.instance)f.instance=new f;return f.instance}writeChain=Promise.resolve();constructor(J=g1()){this.filePath=J}async readFile(){try{let J=await d1(this.filePath,"utf-8"),Z=JSON.parse(J);if(!Z||!Array.isArray(Z.schedules))return[];let j=[],Y=0;for(let H of Z.schedules){let k=S.safeParse(H);if(k.success)j.push(k.data);else Y+=1}if(Y>0)T.warn(`[ScheduleStore] Ignored ${Y} invalid persisted schedule(s)`);return j}catch(J){let Z=J;if(Z.code!=="ENOENT")T.warn("[ScheduleStore] Failed to read schedules; treating as empty:",Z);return[]}}async writeFile(J){await u1($1.dirname(this.filePath),{recursive:!0,mode:493});let Z={version:c1,schedules:J};await h1(this.filePath,JSON.stringify(Z,null,2),{mode:384})}serializeWrite(J){let Z=this.writeChain.then(J,J);return this.writeChain=Z.then(()=>{return},()=>{return}),Z}async list(){return this.readFile()}async get(J){return(await this.readFile()).find((j)=>j.id===J)}async create(J){return this.serializeWrite(async()=>{let Z=J.trigger.kind==="cron"&&!J.trigger.timezone?{...J.trigger,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}:J.trigger,j=F(Z);if(j)throw Error(j);let Y=new Date;if(Z.kind==="once"&&new Date(Z.runAt).getTime()<=Y.getTime())throw Error("once trigger runAt must be in the future");let H=Y.toISOString(),k=U(Z,Y),G={id:m1(10),title:J.title,prompt:J.prompt,projectPath:J.projectPath,trigger:Z,dispatch:{modelId:J.modelId,reasoningEffort:J.reasoningEffort,serviceTier:J.serviceTier,responseVerbosity:J.responseVerbosity,communicationStyle:J.communicationStyle,isolation:J.isolation??"worktree",permissionMode:J.permissionMode??"default"},enabled:J.enabled??!0,createdAt:H,updatedAt:H,nextRunAt:k?k.toISOString():null,expiresAt:null,runCount:0},V=await this.readFile();return V.push(G),await this.writeFile(V),G})}async update(J,Z){return this.serializeWrite(async()=>{let j=await this.readFile(),Y=j.findIndex((Q)=>Q.id===J);if(Y===-1)return;let H=j[Y];if(Z.trigger){let Q=Z.trigger.kind==="cron"&&!Z.trigger.timezone?{...Z.trigger,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}:Z.trigger,b=F(Q);if(b)throw Error(b);if(Q.kind==="once"&&new Date(Q.runAt).getTime()<=Date.now())throw Error("once trigger runAt must be in the future");Z={...Z,trigger:Q}}let k={...H,...Z,dispatch:Z.dispatch?{...H.dispatch,...Z.dispatch}:H.dispatch,updatedAt:new Date().toISOString()},G=!H.enabled,V=k.enabled,W=Z.trigger!==void 0;if((W||G&&V)&&Z.nextRunAt===void 0){let Q=new Date,b=U(k.trigger,Q);if(k.nextRunAt=b?b.toISOString():null,W)k.expiresAt=null}return j[Y]=k,await this.writeFile(j),k})}async remove(J){return this.serializeWrite(async()=>{let Z=await this.readFile(),j=Z.filter((Y)=>Y.id!==J);if(j.length===Z.length)return!1;return await this.writeFile(j),!0})}async setEnabled(J,Z){return this.update(J,{enabled:Z})}}var K2=f.getInstance();
2
+ export{g as Ra,J0 as Sa,x as Ta,H1 as Ua,m as Va,h as Wa,Q1 as Xa,b1 as Ya,p1 as Za,e1 as _a,n1 as $a,U as ab,F as bb,i1 as cb,k0 as db,C as eb,w0 as fb,z0 as gb,f0 as hb,I0 as ib,N0 as jb,C0 as kb,S as lb,U0 as mb,F0 as nb,L0 as ob,M0 as pb,A0 as qb,E0 as rb,S0 as sb,f as tb,K2 as ub};
@@ -1,2 +1,2 @@
1
1
  var t=["auto","low","medium","high"],s=new Set(["openai-completions","openai-responses","openai-codex-responses","azure-openai-responses"]);function n(e){return/(?:^|[/.:_-])gpt-5(?:$|[/.:_-])/i.test(e.id)}function f(e){return typeof e==="string"&&t.includes(e)}function p(e){if(e.api==="openai-codex-responses"||s.has(e.api)&&n(e))return["low","medium","high"];return[]}function u(e,r){let i=p(e);if(r!=="auto"&&!i.includes(r))throw Error(`Response verbosity ${r} is not supported by ${e.name}`);if(r==="auto")return{selection:r,effective:"provider-default",supported:i};return{selection:r,effective:r,supported:i,providerValue:r}}var a=["auto","standard","fast","flex"],o=new Set(["openai-completions","openai-responses","openai-codex-responses","azure-openai-responses"]);function S(e){return typeof e==="string"&&a.includes(e)}function c(e){if(o.has(e.api))return["standard","fast","flex"];if(e.api==="anthropic-messages"&&/(?:^|-)claude-opus-4-6(?:-|$)/i.test(e.id))return["standard","fast"];return["standard"]}function l(e,r){let i=c(e);if(r!=="auto"&&!i.includes(r))throw Error(`Service tier ${r} is not supported by ${e.name}`);if(r==="auto")return{selection:r,effective:"provider-default",supported:i};if(r==="standard")return{selection:r,effective:"standard",supported:i,...o.has(e.api)?{providerValue:"default"}:{}};if(r==="fast")return{selection:r,effective:"fast",supported:i,providerValue:e.api==="anthropic-messages"?"fast":"priority"};return{selection:r,effective:"flex",supported:i,providerValue:"flex"}}
2
- export{f as Fj,p as Gj,u as Hj,S as Ij,c as Jj,l as Kj};
2
+ export{f as Ij,p as Jj,u as Kj,S as Lj,c as Mj,l as Nj};
@@ -1 +1 @@
1
- import{Ea as h,Ga as f,Ha as k}from"./chunk-h74p51hg.js";import"./chunk-6e3mh79j.js";var p={command:"status",describe:"Check the pinned Playwright Chromium installation",handler:async()=>{let c=await f();if(console.log(`Playwright: ${c.playwrightVersion}`),console.log(`Chromium executable: ${c.executablePath}`),!c.installed){console.error(`Chromium: unavailable (${c.error??"unknown error"})`),console.error(`Install with: ${h}`),process.exitCode=1;return}console.log(`Chromium: ${c.browserVersion}`),console.log("Status: ready")}},q={command:"install",describe:"Install Chromium for the pinned Playwright runtime",handler:async()=>{try{await k();let c=await f();if(!c.installed)throw Error(c.error??"Chromium is not runnable after installation");console.log(`Chromium installed: Playwright ${c.playwrightVersion}, ${c.browserVersion}`)}catch(c){console.error(`Browser installation failed: ${c instanceof Error?c.message:String(c)}`),process.exitCode=1}}},x={command:"browser",describe:"Manage the native Browser Tool runtime",builder:(c)=>c.command(p).command(q).demandCommand(1).strict(),handler:()=>{return}};export{p as browserStatusCommand,q as browserInstallCommand,x as browserCommands};
1
+ import{Ea as h,Ga as f,Ha as k}from"./chunk-16648v5c.js";import"./chunk-516adpx6.js";var p={command:"status",describe:"Check the pinned Playwright Chromium installation",handler:async()=>{let c=await f();if(console.log(`Playwright: ${c.playwrightVersion}`),console.log(`Chromium executable: ${c.executablePath}`),!c.installed){console.error(`Chromium: unavailable (${c.error??"unknown error"})`),console.error(`Install with: ${h}`),process.exitCode=1;return}console.log(`Chromium: ${c.browserVersion}`),console.log("Status: ready")}},q={command:"install",describe:"Install Chromium for the pinned Playwright runtime",handler:async()=>{try{await k();let c=await f();if(!c.installed)throw Error(c.error??"Chromium is not runnable after installation");console.log(`Chromium installed: Playwright ${c.playwrightVersion}, ${c.browserVersion}`)}catch(c){console.error(`Browser installation failed: ${c instanceof Error?c.message:String(c)}`),process.exitCode=1}}},x={command:"browser",describe:"Manage the native Browser Tool runtime",builder:(c)=>c.command(p).command(q).demandCommand(1).strict(),handler:()=>{return}};export{p as browserStatusCommand,q as browserInstallCommand,x as browserCommands};
@@ -1,4 +1,4 @@
1
- import{Pi as L,Si as _}from"./chunk-g799czsy.js";import{execSync as F}from"child_process";import{existsSync as Q,readFileSync as O,realpathSync as b}from"fs";import*as V from"os";import*as H from"path";import{basename as J,isAbsolute as j,resolve as R}from"path";function G(z=_()){let q=z,M=f(q);return{workingDirectory:q,projectRoot:M,platform:`${V.platform()} (${V.arch()})`,nodeVersion:process.version,currentDate:new Date().toISOString().split("T")[0],homeDirectory:V.homedir()}}function Y(z,q){try{return F(q,{cwd:z,encoding:"utf8",stdio:["pipe","pipe","ignore"]}).trim()}catch{return null}}function v(z={}){let{includeGitSnapshot:q=!0,includeDirectoryListing:M=!0,workingDirectory:W}=z,B=G(W),$=Q(H.join(B.projectRoot,".git")),T=J(process.env.SHELL||"unknown"),A=["package.json","tsconfig.json","BLADE.md",".env.example"].filter((K)=>Q(H.join(B.projectRoot,K))).map((K)=>`- \`${H.join(B.projectRoot,K)}\``),N=`# Environment
1
+ import{Si as L,Vi as _}from"./chunk-dv2m2xe5.js";import{execSync as F}from"child_process";import{existsSync as Q,readFileSync as O,realpathSync as b}from"fs";import*as V from"os";import*as H from"path";import{basename as J,isAbsolute as j,resolve as R}from"path";function G(z=_()){let q=z,M=f(q);return{workingDirectory:q,projectRoot:M,platform:`${V.platform()} (${V.arch()})`,nodeVersion:process.version,currentDate:new Date().toISOString().split("T")[0],homeDirectory:V.homedir()}}function Y(z,q){try{return F(q,{cwd:z,encoding:"utf8",stdio:["pipe","pipe","ignore"]}).trim()}catch{return null}}function v(z={}){let{includeGitSnapshot:q=!0,includeDirectoryListing:M=!0,workingDirectory:W}=z,B=G(W),$=Q(H.join(B.projectRoot,".git")),T=J(process.env.SHELL||"unknown"),A=["package.json","tsconfig.json","BLADE.md",".env.example"].filter((K)=>Q(H.join(B.projectRoot,K))).map((K)=>`- \`${H.join(B.projectRoot,K)}\``),N=`# Environment
2
2
  You have been invoked in the following environment:
3
3
  - Primary working directory: ${B.workingDirectory}
4
4
  - Is a git repository: ${$?"true":"false"}
@@ -25,4 +25,4 @@ ${I.join(`
25
25
 
26
26
  Project root directory listing:
27
27
  ${K}`}return N}function f(z){let q=z,M=null;while(q!==H.dirname(q)){if(Q(H.join(q,".git")))return q;if(Q(H.join(q,".blade")))return q;if(Q(H.join(q,".claude")))return q;if(!M&&Q(H.join(q,"package.json")))M=q;q=H.dirname(q)}return M??z}function x(z,q){let M=j(z)?z:R(q||process.cwd(),z),W;try{W=b(M)}catch{W=M}L(W)}
28
- export{v as sf,f as tf,x as uf};
28
+ export{v as vf,f as wf,x as xf};
@@ -1,3 +1,3 @@
1
- import{j as i}from"./chunk-0c82q1sz.js";import{Si as s}from"./chunk-g799czsy.js";import"./chunk-0k2x2ae6.js";import"./chunk-6e3mh79j.js";import m from"node:path";var r={registry:i,currentWorkspace:s,inputCwd:()=>process.cwd(),write:console.log};function c(t,e){return m.resolve(e.inputCwd(),t)}function p(t){return t.map((e)=>{let o=e.isCurrent?"*":" ",n=e.gitBranch?` · ${e.gitBranch}`:"",d=e.available?"":" · unavailable";return`${o} ${e.name}${n}${d}
1
+ import{j as i}from"./chunk-9m7d3ajv.js";import{Vi as s}from"./chunk-dv2m2xe5.js";import"./chunk-t88sfhjj.js";import"./chunk-516adpx6.js";import m from"node:path";var r={registry:i,currentWorkspace:s,inputCwd:()=>process.cwd(),write:console.log};function c(t,e){return m.resolve(e.inputCwd(),t)}function p(t){return t.map((e)=>{let o=e.isCurrent?"*":" ",n=e.gitBranch?` · ${e.gitBranch}`:"",d=e.available?"":" · unavailable";return`${o} ${e.name}${n}${d}
2
2
  ${e.path}`}).join(`
3
3
  `)}async function l(t,e=r){let o=await e.registry.list(e.currentWorkspace());return e.write(t.json?JSON.stringify(o,null,2):p(o)),o}async function u(t,e=r){let o=await e.registry.bind(c(t.path,e),e.currentWorkspace());return e.write(t.json?JSON.stringify(o,null,2):`Bound project: ${o.path}`),o}async function j(t,e=r){let o=c(t.path,e),n=await e.registry.unbind(o);return e.write(t.json?JSON.stringify({path:o,removed:n},null,2):n?`Unbound project: ${o}`:`Project was not bound: ${o}`),n}var a={type:"boolean",default:!1,describe:"Print machine-readable JSON"},P={command:"list",aliases:["ls"],describe:"List bound projects",builder:(t)=>t.option("json",a),handler:async(t)=>{await l(t)}},b={command:"add <path>",aliases:["bind"],describe:"Bind a project folder",builder:(t)=>t.positional("path",{type:"string",demandOption:!0,describe:"Absolute or relative project folder"}).option("json",a),handler:async(t)=>{await u(t)}},h={command:"remove <path>",aliases:["rm","unbind"],describe:"Unbind a project folder",builder:(t)=>t.positional("path",{type:"string",demandOption:!0,describe:"Absolute or relative project folder"}).option("json",a),handler:async(t)=>{await j(t)}},y={command:"projects",aliases:["project"],describe:"Manage project bindings shared with Blade Web",builder:(t)=>t.command(P).command(b).command(h).demandCommand(1,"Choose list, add, or remove"),handler:()=>{return}};export{j as runProjectsRemove,l as runProjectsList,u as runProjectsAdd,y as projectsCommands,p as formatProjectList};