blade-code 0.10.70 → 0.10.72
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/blade.js +2 -2
- package/dist/{chunk-832va1mp.js → chunk-06y3rada.js} +2 -2
- package/dist/{chunk-k0pa8874.js → chunk-0kat01bw.js} +1 -1
- package/dist/{chunk-th4jjfgm.js → chunk-0qj8jfj1.js} +1 -1
- package/dist/{chunk-w2gr97qt.js → chunk-11gdqmbm.js} +1 -1
- package/dist/chunk-139s7p91.js +1 -0
- package/dist/{chunk-zvz2cnt4.js → chunk-18atvz38.js} +1 -1
- package/dist/{chunk-ypgjqg23.js → chunk-28wsyv32.js} +1 -1
- package/dist/{chunk-b2p4kd07.js → chunk-2d2bcyn1.js} +1 -1
- package/dist/{chunk-31k6x4kn.js → chunk-2fd5trh8.js} +2 -2
- package/dist/{chunk-cdy9efgm.js → chunk-2sdnmxts.js} +1 -1
- package/dist/chunk-2vkzwqv0.js +1 -0
- package/dist/chunk-41smvqs8.js +1 -0
- package/dist/{chunk-hat9v5c5.js → chunk-4wvsg8cc.js} +1 -1
- package/dist/{chunk-6pyktfa4.js → chunk-4xpj0d6y.js} +1 -1
- package/dist/{chunk-d2vrbbvd.js → chunk-5va3hhfp.js} +1 -1
- package/dist/chunk-61arrvhp.js +1 -0
- package/dist/{chunk-yn51162x.js → chunk-6j3k4v08.js} +1 -1
- package/dist/{chunk-s7jsadnc.js → chunk-6j9t1xbh.js} +2 -2
- package/dist/{chunk-wkpacysr.js → chunk-6v7f2cv9.js} +53 -53
- package/dist/{chunk-20vj0npz.js → chunk-7am1z065.js} +1 -1
- package/dist/{chunk-r9n8y8m1.js → chunk-7hf1k2c9.js} +2 -2
- package/dist/chunk-8geywf8q.js +1 -0
- package/dist/{chunk-4md4sd4j.js → chunk-91qsjpm6.js} +2 -2
- package/dist/{chunk-p9vaaayr.js → chunk-a38chc6z.js} +18 -18
- package/dist/{chunk-728anavt.js → chunk-awj9aqjy.js} +2 -2
- package/dist/chunk-bqz8wera.js +1 -0
- package/dist/chunk-brm24s69.js +2 -0
- package/dist/chunk-bs77d8hn.js +2 -0
- package/dist/{chunk-f7yfcw8s.js → chunk-c4j2anbm.js} +2 -2
- package/dist/{chunk-b39p4f5r.js → chunk-ccgq8nrm.js} +2 -2
- package/dist/{chunk-sch01e04.js → chunk-cqeqjtxn.js} +1 -1
- package/dist/{chunk-4aam3qhk.js → chunk-cyjnza5n.js} +4 -4
- package/dist/chunk-d9a0g85f.js +1 -0
- package/dist/{chunk-g28pgqyn.js → chunk-e0hf1317.js} +1 -1
- package/dist/chunk-e4ynb9qf.js +1 -0
- package/dist/chunk-e6ezndyf.js +22 -0
- package/dist/chunk-eh4h7fmr.js +3 -0
- package/dist/chunk-eh9gdzk5.js +160 -0
- package/dist/chunk-emqbb5xh.js +1 -0
- package/dist/{chunk-h0ft81a3.js → chunk-g8425xh4.js} +1 -1
- package/dist/{chunk-d808m826.js → chunk-gv3ed5gw.js} +2 -2
- package/dist/chunk-gzysna9c.js +1 -0
- package/dist/{chunk-wahhwjp9.js → chunk-hhk5ecpv.js} +2 -2
- package/dist/{chunk-z77c18j5.js → chunk-hhvkzn6m.js} +1 -1
- package/dist/{chunk-0kmrvxsz.js → chunk-hryhnmwv.js} +277 -262
- package/dist/{chunk-0p0e70cy.js → chunk-hwjmm2br.js} +2 -2
- package/dist/{chunk-8wea3qty.js → chunk-j0yvwrd7.js} +2 -2
- package/dist/{chunk-m57w4p91.js → chunk-jyds9m8p.js} +1 -1
- package/dist/{chunk-v0rsz1rt.js → chunk-m6qgme8k.js} +1 -1
- package/dist/{chunk-1z9k5dmz.js → chunk-mhyat4mq.js} +2 -2
- package/dist/{chunk-83b4vfjs.js → chunk-mp4bfn57.js} +1 -1
- package/dist/chunk-mrh3vs01.js +2 -0
- package/dist/chunk-ph5rn44j.js +1 -0
- package/dist/chunk-pqhjrdnq.js +10 -0
- package/dist/{chunk-0j22w4wh.js → chunk-q6daf441.js} +1 -1
- package/dist/{chunk-0wxkymqv.js → chunk-s9brgcgs.js} +1 -1
- package/dist/{chunk-1bcp0qc4.js → chunk-ss1znmv0.js} +1 -1
- package/dist/{chunk-bkajr86v.js → chunk-tms0pr01.js} +2 -2
- package/dist/chunk-v7phc78b.js +1 -0
- package/dist/{chunk-t8xmh4w2.js → chunk-wvg81sd9.js} +1 -1
- package/dist/{chunk-sh17gjxv.js → chunk-x4hh8yqg.js} +1 -1
- package/dist/{chunk-pw87f92g.js → chunk-xahapj98.js} +1 -1
- package/dist/{chunk-smjkx71w.js → chunk-xszsveq1.js} +1 -1
- package/dist/{chunk-y9d9nqnn.js → chunk-y858e8pb.js} +2 -2
- package/dist/{chunk-bjqjdw34.js → chunk-yhnr8vdb.js} +2 -2
- package/dist/{chunk-7b5s752s.js → chunk-yjj7q7hy.js} +1 -1
- package/dist/{chunk-q919ypcz.js → chunk-ypwjzw5x.js} +2 -2
- package/dist/{chunk-qm5c9wew.js → chunk-z7vj2xrg.js} +3 -3
- package/dist/{chunk-63121s4r.js → chunk-zac26wwd.js} +1 -1
- package/dist/{chunk-k6shq7rk.js → chunk-zf96d5we.js} +1 -1
- package/dist/chunk-zqxj65xc.js +1 -0
- package/dist/chunk-zssys78z.js +1 -0
- package/dist/web/assets/ChatView-CgUC5rxo.js +18 -0
- package/dist/web/assets/{CodeBlockHighlighter-Dy7QpAmC.js → CodeBlockHighlighter-B5DRAEhB.js} +1 -1
- package/dist/web/assets/{FilePreview-BI3nkxz1.js → FilePreview-DSpvLsjW.js} +1 -1
- package/dist/web/assets/{KanbanBoard-D5dYOyPH.js → KanbanBoard-6K7IeCXi.js} +1 -1
- package/dist/web/assets/{MarkdownRenderer-Da1vB81L.js → MarkdownRenderer-D6LiW9kF.js} +3 -3
- package/dist/web/assets/{SettingsModal-jcCFqLqS.js → SettingsModal-CFHxLfuL.js} +1 -1
- package/dist/web/assets/{TaskSwitcher-CQ--jOLB.js → TaskSwitcher-Bng9nDed.js} +1 -1
- package/dist/web/assets/{TerminalPanel-CWzjEXOb.js → TerminalPanel-BnyQZwkN.js} +1 -1
- package/dist/web/assets/index-CDdYV8kB.css +1 -0
- package/dist/web/assets/index-DId2GJVO.js +11 -0
- package/dist/web/assets/{vendor-icons-B63aW_OM.js → vendor-icons-C927DZlr.js} +41 -36
- package/dist/web/index.html +3 -3
- package/package.json +1 -1
- package/dist/chunk-0p95nha3.js +0 -1
- package/dist/chunk-2z75emht.js +0 -1
- package/dist/chunk-3j413cgh.js +0 -1
- package/dist/chunk-5wnx38ze.js +0 -1
- package/dist/chunk-8bsyhr4v.js +0 -1
- package/dist/chunk-brdxkp0y.js +0 -10
- package/dist/chunk-c0qm0wwk.js +0 -1
- package/dist/chunk-cmpj3a5a.js +0 -22
- package/dist/chunk-cx5s0rf3.js +0 -1
- package/dist/chunk-e3asq942.js +0 -1
- package/dist/chunk-ffym3kf3.js +0 -160
- package/dist/chunk-h94vfh7s.js +0 -1
- package/dist/chunk-jrr361h1.js +0 -2
- package/dist/chunk-nea4rcdf.js +0 -1
- package/dist/chunk-qstf0gpe.js +0 -1
- package/dist/chunk-rpfa4a56.js +0 -1
- package/dist/chunk-v3kkv21n.js +0 -1
- package/dist/chunk-wepvrnmh.js +0 -2
- package/dist/chunk-wj6t3tv2.js +0 -3
- package/dist/chunk-xz6y0w4n.js +0 -2
- package/dist/chunk-ysmqje92.js +0 -1
- package/dist/web/assets/ChatView-BVrhnE2j.js +0 -18
- package/dist/web/assets/index-BOgOL4hG.js +0 -11
- package/dist/web/assets/index-DbWgTuT3.css +0 -1
|
@@ -28,22 +28,22 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const
|
|
31
|
+
*/const u=e("ArchiveRestore",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]]);/**
|
|
32
32
|
* @license lucide-react v0.300.0 - ISC
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const
|
|
36
|
+
*/const f=e("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
|
|
37
37
|
* @license lucide-react v0.300.0 - ISC
|
|
38
38
|
*
|
|
39
39
|
* This source code is licensed under the ISC license.
|
|
40
40
|
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const
|
|
41
|
+
*/const C=e("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
|
|
42
42
|
* @license lucide-react v0.300.0 - ISC
|
|
43
43
|
*
|
|
44
44
|
* This source code is licensed under the ISC license.
|
|
45
45
|
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const
|
|
46
|
+
*/const q=e("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
|
|
47
47
|
* @license lucide-react v0.300.0 - ISC
|
|
48
48
|
*
|
|
49
49
|
* This source code is licensed under the ISC license.
|
|
@@ -63,12 +63,12 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
63
63
|
*
|
|
64
64
|
* This source code is licensed under the ISC license.
|
|
65
65
|
* See the LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/const
|
|
66
|
+
*/const A=e("Braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);/**
|
|
67
67
|
* @license lucide-react v0.300.0 - ISC
|
|
68
68
|
*
|
|
69
69
|
* This source code is licensed under the ISC license.
|
|
70
70
|
* See the LICENSE file in the root directory of this source tree.
|
|
71
|
-
*/const
|
|
71
|
+
*/const H=e("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.25V14",key:"re2vv1"}],["path",{d:"M22 16a6 6 0 1 1-12 0 6 6 0 0 1 12 0Z",key:"ame013"}]]);/**
|
|
72
72
|
* @license lucide-react v0.300.0 - ISC
|
|
73
73
|
*
|
|
74
74
|
* This source code is licensed under the ISC license.
|
|
@@ -168,17 +168,17 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
168
168
|
*
|
|
169
169
|
* This source code is licensed under the ISC license.
|
|
170
170
|
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
-
*/const
|
|
171
|
+
*/const Q=e("FileDiff",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);/**
|
|
172
172
|
* @license lucide-react v0.300.0 - ISC
|
|
173
173
|
*
|
|
174
174
|
* This source code is licensed under the ISC license.
|
|
175
175
|
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
-
*/const
|
|
176
|
+
*/const X=e("FileText",[["path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z",key:"1nnpy2"}],["polyline",{points:"14 2 14 8 20 8",key:"1ew0cm"}],["line",{x1:"16",x2:"8",y1:"13",y2:"13",key:"14keom"}],["line",{x1:"16",x2:"8",y1:"17",y2:"17",key:"17nazh"}],["line",{x1:"10",x2:"8",y1:"9",y2:"9",key:"1a5vjj"}]]);/**
|
|
177
177
|
* @license lucide-react v0.300.0 - ISC
|
|
178
178
|
*
|
|
179
179
|
* This source code is licensed under the ISC license.
|
|
180
180
|
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
-
*/const
|
|
181
|
+
*/const J=e("Files",[["path",{d:"M15.5 2H8.6c-.4 0-.8.2-1.1.5-.3.3-.5.7-.5 1.1v12.8c0 .4.2.8.5 1.1.3.3.7.5 1.1.5h9.8c.4 0 .8-.2 1.1-.5.3-.3.5-.7.5-1.1V6.5L15.5 2z",key:"cennsq"}],["path",{d:"M3 7.6v12.8c0 .4.2.8.5 1.1.3.3.7.5 1.1.5h9.8",key:"ms809a"}],["path",{d:"M15 2v5h5",key:"qq6kwv"}]]);/**
|
|
182
182
|
* @license lucide-react v0.300.0 - ISC
|
|
183
183
|
*
|
|
184
184
|
* This source code is licensed under the ISC license.
|
|
@@ -273,27 +273,32 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
273
273
|
*
|
|
274
274
|
* This source code is licensed under the ISC license.
|
|
275
275
|
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
-
*/const M2=e("
|
|
276
|
+
*/const M2=e("MessageCircleQuestion",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
277
277
|
* @license lucide-react v0.300.0 - ISC
|
|
278
278
|
*
|
|
279
279
|
* This source code is licensed under the ISC license.
|
|
280
280
|
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
-
*/const v2=e("
|
|
281
|
+
*/const v2=e("MessageSquareWarning",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v2",key:"stiyo7"}],["path",{d:"M12 13h.01",key:"y0uutt"}]]);/**
|
|
282
282
|
* @license lucide-react v0.300.0 - ISC
|
|
283
283
|
*
|
|
284
284
|
* This source code is licensed under the ISC license.
|
|
285
285
|
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
-
*/const m2=e("
|
|
286
|
+
*/const m2=e("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
287
287
|
* @license lucide-react v0.300.0 - ISC
|
|
288
288
|
*
|
|
289
289
|
* This source code is licensed under the ISC license.
|
|
290
290
|
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
-
*/const g2=e("
|
|
291
|
+
*/const g2=e("MoreHorizontal",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/**
|
|
292
292
|
* @license lucide-react v0.300.0 - ISC
|
|
293
293
|
*
|
|
294
294
|
* This source code is licensed under the ISC license.
|
|
295
295
|
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
-
*/const w2=e("
|
|
296
|
+
*/const w2=e("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
|
|
297
|
+
* @license lucide-react v0.300.0 - ISC
|
|
298
|
+
*
|
|
299
|
+
* This source code is licensed under the ISC license.
|
|
300
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
+
*/const u2=e("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["line",{x1:"9",x2:"9",y1:"3",y2:"21",key:"13tij5"}]]);/**
|
|
297
302
|
* @license lucide-react v0.300.0 - ISC
|
|
298
303
|
*
|
|
299
304
|
* This source code is licensed under the ISC license.
|
|
@@ -303,7 +308,7 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
303
308
|
*
|
|
304
309
|
* This source code is licensed under the ISC license.
|
|
305
310
|
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
-
*/const
|
|
311
|
+
*/const C2=e("Pause",[["rect",{width:"4",height:"16",x:"6",y:"4",key:"iffhe4"}],["rect",{width:"4",height:"16",x:"14",y:"4",key:"sjin7j"}]]);/**
|
|
307
312
|
* @license lucide-react v0.300.0 - ISC
|
|
308
313
|
*
|
|
309
314
|
* This source code is licensed under the ISC license.
|
|
@@ -313,22 +318,22 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
313
318
|
*
|
|
314
319
|
* This source code is licensed under the ISC license.
|
|
315
320
|
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
-
*/const
|
|
321
|
+
*/const z2=e("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/**
|
|
317
322
|
* @license lucide-react v0.300.0 - ISC
|
|
318
323
|
*
|
|
319
324
|
* This source code is licensed under the ISC license.
|
|
320
325
|
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
-
*/const
|
|
326
|
+
*/const b2=e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
322
327
|
* @license lucide-react v0.300.0 - ISC
|
|
323
328
|
*
|
|
324
329
|
* This source code is licensed under the ISC license.
|
|
325
330
|
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
-
*/const
|
|
331
|
+
*/const j2=e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/**
|
|
327
332
|
* @license lucide-react v0.300.0 - ISC
|
|
328
333
|
*
|
|
329
334
|
* This source code is licensed under the ISC license.
|
|
330
335
|
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
-
*/const
|
|
336
|
+
*/const A2=e("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
|
|
332
337
|
* @license lucide-react v0.300.0 - ISC
|
|
333
338
|
*
|
|
334
339
|
* This source code is licensed under the ISC license.
|
|
@@ -338,84 +343,84 @@ import{r as h}from"./vendor-react-DG5dkZ_t.js";/**
|
|
|
338
343
|
*
|
|
339
344
|
* This source code is licensed under the ISC license.
|
|
340
345
|
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
-
*/const
|
|
346
|
+
*/const L2=e("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
342
347
|
* @license lucide-react v0.300.0 - ISC
|
|
343
348
|
*
|
|
344
349
|
* This source code is licensed under the ISC license.
|
|
345
350
|
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
-
*/const
|
|
351
|
+
*/const V2=e("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
|
|
347
352
|
* @license lucide-react v0.300.0 - ISC
|
|
348
353
|
*
|
|
349
354
|
* This source code is licensed under the ISC license.
|
|
350
355
|
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
-
*/const
|
|
356
|
+
*/const S2=e("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/**
|
|
352
357
|
* @license lucide-react v0.300.0 - ISC
|
|
353
358
|
*
|
|
354
359
|
* This source code is licensed under the ISC license.
|
|
355
360
|
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
-
*/const
|
|
361
|
+
*/const F2=e("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
357
362
|
* @license lucide-react v0.300.0 - ISC
|
|
358
363
|
*
|
|
359
364
|
* This source code is licensed under the ISC license.
|
|
360
365
|
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
-
*/const
|
|
366
|
+
*/const D2=e("ShieldAlert",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
|
|
362
367
|
* @license lucide-react v0.300.0 - ISC
|
|
363
368
|
*
|
|
364
369
|
* This source code is licensed under the ISC license.
|
|
365
370
|
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
-
*/const
|
|
371
|
+
*/const P2=e("ShieldCheck",[["path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10",key:"1irkt0"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
367
372
|
* @license lucide-react v0.300.0 - ISC
|
|
368
373
|
*
|
|
369
374
|
* This source code is licensed under the ISC license.
|
|
370
375
|
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
-
*/const
|
|
376
|
+
*/const T2=e("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
|
|
372
377
|
* @license lucide-react v0.300.0 - ISC
|
|
373
378
|
*
|
|
374
379
|
* This source code is licensed under the ISC license.
|
|
375
380
|
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
-
*/const
|
|
381
|
+
*/const R2=e("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
377
382
|
* @license lucide-react v0.300.0 - ISC
|
|
378
383
|
*
|
|
379
384
|
* This source code is licensed under the ISC license.
|
|
380
385
|
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
-
*/const
|
|
386
|
+
*/const Z2=e("Store",[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2v0a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12v0a2 2 0 0 1-2-2V7",key:"jon5kx"}]]);/**
|
|
382
387
|
* @license lucide-react v0.300.0 - ISC
|
|
383
388
|
*
|
|
384
389
|
* This source code is licensed under the ISC license.
|
|
385
390
|
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
-
*/const
|
|
391
|
+
*/const G2=e("Tag",[["path",{d:"M12 2H2v10l9.29 9.29c.94.94 2.48.94 3.42 0l6.58-6.58c.94-.94.94-2.48 0-3.42L12 2Z",key:"14b2ls"}],["path",{d:"M7 7h.01",key:"7u93v4"}]]);/**
|
|
387
392
|
* @license lucide-react v0.300.0 - ISC
|
|
388
393
|
*
|
|
389
394
|
* This source code is licensed under the ISC license.
|
|
390
395
|
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
-
*/const
|
|
396
|
+
*/const E2=e("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
|
|
392
397
|
* @license lucide-react v0.300.0 - ISC
|
|
393
398
|
*
|
|
394
399
|
* This source code is licensed under the ISC license.
|
|
395
400
|
* See the LICENSE file in the root directory of this source tree.
|
|
396
|
-
*/const
|
|
401
|
+
*/const B2=e("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
397
402
|
* @license lucide-react v0.300.0 - ISC
|
|
398
403
|
*
|
|
399
404
|
* This source code is licensed under the ISC license.
|
|
400
405
|
* See the LICENSE file in the root directory of this source tree.
|
|
401
|
-
*/const
|
|
406
|
+
*/const W2=e("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
|
|
402
407
|
* @license lucide-react v0.300.0 - ISC
|
|
403
408
|
*
|
|
404
409
|
* This source code is licensed under the ISC license.
|
|
405
410
|
* See the LICENSE file in the root directory of this source tree.
|
|
406
|
-
*/const
|
|
411
|
+
*/const O2=e("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
407
412
|
* @license lucide-react v0.300.0 - ISC
|
|
408
413
|
*
|
|
409
414
|
* This source code is licensed under the ISC license.
|
|
410
415
|
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
-
*/const
|
|
416
|
+
*/const U2=e("WifiOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M8.5 16.5a5 5 0 0 1 7 0",key:"sej527"}],["path",{d:"M2 8.82a15 15 0 0 1 4.17-2.65",key:"11utq1"}],["path",{d:"M10.66 5c4.01-.36 8.14.9 11.34 3.76",key:"hxefdu"}],["path",{d:"M16.85 11.25a10 10 0 0 1 2.22 1.68",key:"q734kn"}],["path",{d:"M5 13a10 10 0 0 1 5.24-2.76",key:"piq4yl"}],["line",{x1:"12",x2:"12.01",y1:"20",y2:"20",key:"of4bc4"}]]);/**
|
|
412
417
|
* @license lucide-react v0.300.0 - ISC
|
|
413
418
|
*
|
|
414
419
|
* This source code is licensed under the ISC license.
|
|
415
420
|
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
-
*/const
|
|
421
|
+
*/const $2=e("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
417
422
|
* @license lucide-react v0.300.0 - ISC
|
|
418
423
|
*
|
|
419
424
|
* This source code is licensed under the ISC license.
|
|
420
425
|
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
-
*/const
|
|
426
|
+
*/const I2=e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);export{U as $,f as A,A as B,V as C,O as D,V2 as E,K as F,y2 as G,p2 as H,i2 as I,b as J,k2 as K,o2 as L,g2 as M,H2 as N,$2 as O,q2 as P,w2 as Q,A2 as R,R2 as S,O2 as T,s2 as U,L as V,U2 as W,I2 as X,j as Y,J as Z,w as _,j2 as a,B as a0,C as a1,E2 as a2,C2 as a3,z2 as a4,T as a5,t2 as a6,W2 as a7,M2 as a8,G as a9,d2 as aa,H as ab,v2 as ac,Q as ad,G2 as ae,$ as af,I as ag,Z2 as ah,q as ai,m as aj,z as ak,W as al,l2 as am,S2 as an,u2 as ao,R as ap,a2 as aq,P as ar,m2 as as,u as b,e2 as c,_ as d,Y as e,g as f,h2 as g,F2 as h,b2 as i,n2 as j,B2 as k,L2 as l,c2 as m,D as n,F as o,T2 as p,x2 as q,N as r,E as s,X as t,r2 as u,P2 as v,D2 as w,Z as x,f2 as y,S as z};
|
package/dist/web/index.html
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>BladeCode</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DId2GJVO.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/vendor-react-DG5dkZ_t.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/vendor-radix-DXRuAJHH.js">
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/vendor-icons-
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/vendor-icons-C927DZlr.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/session-events-BvtUOaNG.js">
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CDdYV8kB.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
16
16
|
<div id="root"></div>
|
package/package.json
CHANGED
package/dist/chunk-0p95nha3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ee as a,Fe as b,Ge as c,He as d,Ie as e,Je as f,Ke as g,Le as h,Me as i,Ne as j}from"./chunk-wahhwjp9.js";import"./chunk-hat9v5c5.js";import"./chunk-cdy9efgm.js";import"./chunk-zvz2cnt4.js";import"./chunk-qm5c9wew.js";import"./chunk-m57w4p91.js";import"./chunk-b39p4f5r.js";import"./chunk-h0ft81a3.js";import"./chunk-v0rsz1rt.js";import"./chunk-xz6y0w4n.js";import"./chunk-k0pa8874.js";import"./chunk-6pyktfa4.js";import"./chunk-d808m826.js";import"./chunk-0p0e70cy.js";import"./chunk-t8xmh4w2.js";import"./chunk-y9d9nqnn.js";import"./chunk-wj6t3tv2.js";import"./chunk-jrr361h1.js";import"./chunk-8wea3qty.js";import"./chunk-k6shq7rk.js";export{g as withWorkspaceAgentResources,i as snapshotWorkspaceAgentResources,f as resolveWorkspaceAgentResources,j as resetWorkspaceAgentResources,d as refreshWorkspaceCommunicationStyles,h as getWorkspaceAgentResourceCacheStats,e as configureInvocationPluginDirs,c as WorkspaceAgentResourceCapacityError,a as MAX_RESIDENT_WORKSPACE_AGENT_RESOURCES,b as MAX_ACTIVE_WORKSPACE_AGENT_RESOURCES};
|
package/dist/chunk-2z75emht.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ee as a}from"./chunk-q919ypcz.js";import"./chunk-6pyktfa4.js";import"./chunk-d808m826.js";import"./chunk-0p0e70cy.js";import"./chunk-t8xmh4w2.js";import"./chunk-8wea3qty.js";import"./chunk-k6shq7rk.js";export{a as createChatServiceAsync};
|
package/dist/chunk-3j413cgh.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{fe as a,ge as b,he as c}from"./chunk-4md4sd4j.js";import"./chunk-yn51162x.js";import"./chunk-0p0e70cy.js";import"./chunk-t8xmh4w2.js";import"./chunk-8wea3qty.js";import"./chunk-k6shq7rk.js";export{b as resolveModelConfig,c as getModelDisplayName,a as getModelApiKeyEnvironmentVariable};
|
package/dist/chunk-5wnx38ze.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ab as m,Bb as n,Cb as o,Eb as p,Fb as q,Gb as r,gb as a,hb as b,jb as c,nb as d,ob as e,pb as f,qb as g,rb as h,sb as i,tb as j,ub as k,zb as l}from"./chunk-wkpacysr.js";import"./chunk-th4jjfgm.js";import"./chunk-1z9k5dmz.js";import"./chunk-0wxkymqv.js";import"./chunk-f7yfcw8s.js";import"./chunk-0j22w4wh.js";import"./chunk-q919ypcz.js";import"./chunk-yn51162x.js";import"./chunk-hat9v5c5.js";import"./chunk-cdy9efgm.js";import"./chunk-qm5c9wew.js";import"./chunk-m57w4p91.js";import"./chunk-h0ft81a3.js";import"./chunk-v0rsz1rt.js";import"./chunk-xz6y0w4n.js";import"./chunk-k0pa8874.js";import"./chunk-6pyktfa4.js";import"./chunk-d808m826.js";import"./chunk-0p0e70cy.js";import"./chunk-t8xmh4w2.js";import"./chunk-y9d9nqnn.js";import"./chunk-jrr361h1.js";import"./chunk-8wea3qty.js";import"./chunk-k6shq7rk.js";export{g as saveUserMessage,i as saveToolUse,j as saveToolResult,k as saveCompaction,h as saveAssistantMessage,d as isRootSystemPrompt,m as handleTaskListUpdate,n as handleSkillActivation,o as extractModelSwitch,r as executeLoopGenerator,f as drainLoop,c as checkStopHook,a as checkOutputRecovery,b as checkIncompleteIntent,q as checkAndCompactInLoop,p as applyToolDomainEffects,l as StreamingToolExecutor,e as ConversationState};
|
package/dist/chunk-8bsyhr4v.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jd as a,kd as b}from"./chunk-bkajr86v.js";import"./chunk-y9d9nqnn.js";import"./chunk-k6shq7rk.js";export{a as globalOptions,b as cliConfig};
|
package/dist/chunk-brdxkp0y.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{f as T,g as W,h as X,i as Y}from"./chunk-4aam3qhk.js";import"./chunk-ypgjqg23.js";import"./chunk-b2p4kd07.js";import"./chunk-smjkx71w.js";import"./chunk-w2gr97qt.js";import"./chunk-d2vrbbvd.js";import"./chunk-0kmrvxsz.js";import"./chunk-83b4vfjs.js";import"./chunk-wepvrnmh.js";import"./chunk-wkpacysr.js";import"./chunk-th4jjfgm.js";import"./chunk-1z9k5dmz.js";import"./chunk-0wxkymqv.js";import"./chunk-f7yfcw8s.js";import{qd as R}from"./chunk-728anavt.js";import"./chunk-bjqjdw34.js";import{Md as Q}from"./chunk-p9vaaayr.js";import"./chunk-v508x7cg.js";import"./chunk-0j22w4wh.js";import"./chunk-q919ypcz.js";import"./chunk-4md4sd4j.js";import"./chunk-yn51162x.js";import"./chunk-832va1mp.js";import"./chunk-wahhwjp9.js";import"./chunk-hat9v5c5.js";import"./chunk-cdy9efgm.js";import"./chunk-zvz2cnt4.js";import"./chunk-qm5c9wew.js";import"./chunk-m57w4p91.js";import"./chunk-b39p4f5r.js";import"./chunk-h0ft81a3.js";import"./chunk-v0rsz1rt.js";import"./chunk-xz6y0w4n.js";import"./chunk-k0pa8874.js";import"./chunk-6pyktfa4.js";import"./chunk-d808m826.js";import"./chunk-0p0e70cy.js";import"./chunk-t8xmh4w2.js";import{jh as M}from"./chunk-y9d9nqnn.js";import"./chunk-wj6t3tv2.js";import"./chunk-jrr361h1.js";import"./chunk-8wea3qty.js";import"./chunk-k6shq7rk.js";import m from"chalk";import K from"open";var A=`
|
|
2
|
-
____ _ _
|
|
3
|
-
| __ )| | __ _ __| | ___
|
|
4
|
-
| _ \\| |/ _\` |/ _\` |/ _ \\
|
|
5
|
-
| |_) | | (_| | (_| | __/
|
|
6
|
-
|____/|_|\\__,_|\\__,_|\\___|
|
|
7
|
-
`,C={command:"web",describe:"Start Blade server and open web interface",builder:T,handler:async(Z)=>{let H=W(Z);if(await Q(),!process.env.BLADE_SERVER_PASSWORD)console.log(m.yellow("[WARN] BLADE_SERVER_PASSWORD is not set; server is unsecured.")),console.log(m.gray(` Set this environment variable to enable Basic Auth.
|
|
8
|
-
`));let F=await Y.listenAsync(H);if(console.log(m.cyan(A)),console.log(m.gray(` v${M()}
|
|
9
|
-
`)),H.hostname==="0.0.0.0"){let q=`http://localhost:${F.port}`;console.log(m.blue.bold(" Local access: "),m.white(q));let x=X();for(let z of x)console.log(m.blue.bold(" Network access: "),m.white(`http://${z}:${F.port}`));K(q).catch(()=>{})}else{let q=F.url.toString();console.log(m.blue.bold(" Web interface: "),m.white(q)),K(q).catch(()=>{})}console.log(""),console.log(m.gray(` Press Ctrl+C to stop the server.
|
|
10
|
-
`));let J,$=new Promise((q)=>{J=q}),b=R(async()=>{await F.stop(),J()});try{await $}finally{b(),await F.stop()}}};export{C as webCommand};
|
package/dist/chunk-c0qm0wwk.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a,b,c,d,e}from"./chunk-sch01e04.js";import"./chunk-y9d9nqnn.js";import"./chunk-k6shq7rk.js";export{b as setSkipUntilVersion,d as performUpgrade,c as getUpgradeCommand,e as checkVersionOnStartup,a as checkVersion};
|
package/dist/chunk-cmpj3a5a.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{s as Pz,t as xz}from"./chunk-smjkx71w.js";import{u as E}from"./chunk-w2gr97qt.js";import{A as Hz,v as Nz,w as $z,x as Qz,y as Wz,z as Yz}from"./chunk-d2vrbbvd.js";import{E as N,N as e,Q as zz,R as Jz,V as Zz,ja as jz,ka as Xz,la as Dz,ma as Lz}from"./chunk-0kmrvxsz.js";import{wa as qz}from"./chunk-83b4vfjs.js";import"./chunk-wepvrnmh.js";import{db as n,pb as t,yb as s}from"./chunk-wkpacysr.js";import{Hb as M}from"./chunk-th4jjfgm.js";import{Ac as a,Cc as x,Fc as o,Kc as R,Nc as F,_b as m,ic as d,jc as v,oc as l,rc as i,tc as r,zc as k}from"./chunk-1z9k5dmz.js";import"./chunk-0wxkymqv.js";import"./chunk-f7yfcw8s.js";import{qd as Ez}from"./chunk-728anavt.js";import"./chunk-bjqjdw34.js";import{Ld as _z,Md as Oz}from"./chunk-p9vaaayr.js";import"./chunk-v508x7cg.js";import{Xd as I}from"./chunk-0j22w4wh.js";import{$d as p}from"./chunk-q919ypcz.js";import"./chunk-4md4sd4j.js";import{ie as Az}from"./chunk-yn51162x.js";import"./chunk-832va1mp.js";import"./chunk-wahhwjp9.js";import"./chunk-hat9v5c5.js";import{Te as Rz}from"./chunk-cdy9efgm.js";import"./chunk-zvz2cnt4.js";import"./chunk-qm5c9wew.js";import"./chunk-m57w4p91.js";import{Lf as wz,Of as Kz}from"./chunk-b39p4f5r.js";import"./chunk-h0ft81a3.js";import"./chunk-v0rsz1rt.js";import{qg as h,rg as c,sg as S}from"./chunk-xz6y0w4n.js";import{wg as Fz}from"./chunk-k0pa8874.js";import"./chunk-6pyktfa4.js";import{Xg as T}from"./chunk-d808m826.js";import"./chunk-0p0e70cy.js";import{ch as Uz,fh as Vz}from"./chunk-t8xmh4w2.js";import"./chunk-y9d9nqnn.js";import"./chunk-wj6t3tv2.js";import"./chunk-jrr361h1.js";import"./chunk-8wea3qty.js";import"./chunk-k6shq7rk.js";import{Readable as uz,Writable as gz}from"node:stream";import*as b from"@agentclientprotocol/sdk";import Gz from"node:path";import{PROTOCOL_VERSION as Cz,RequestError as fz}from"@agentclientprotocol/sdk";import{RequestError as yz}from"@agentclientprotocol/sdk";import{nanoid as y}from"nanoid";var B=T("Agent");function g(z){if(!z)return{};return Object.fromEntries(z.map((Z)=>[Z.name,Z.value]))}function hz(z){if("command"in z)return{type:"stdio",command:z.command,args:z.args,env:g(z.env)};if("url"in z)return{type:z.type,url:z.url,headers:g("headers"in z?z.headers:void 0)};return null}function Sz(z){let Z={};for(let J of z){let Y=hz(J);if(Y)Z[J.name]=Y}return Z}function Bz(z){if(typeof z==="string")return z?[{type:"text",text:z}]:[];return z.flatMap((Z)=>{if(Z.type==="text")return Z.text?[{type:"text",text:Z.text}]:[];let J=Z.image_url.url,Y=/^data:([^;,]+);base64,(.+)$/s.exec(J);if(!Y)return[{type:"text",text:"[Image]"}];return[{type:"image",mimeType:Y[1]??"image/png",data:Y[2]??""}]})}function Mz(z){let Z=a(z.metadata);return Z?[{type:"text",text:k(Z)}]:Bz(z.content)}function kz(z){return[`Status: ${z.status}`,`Exit code: ${z.exitCode??"null"}`,`Duration: ${(z.durationMs/1000).toFixed(3)} seconds`].join(`
|
|
2
|
-
`)}function Iz(z){if(!p(z)||z.reason!=="queue_full"||z.resource!=="pending_count"&&z.resource!=="pending_bytes")return;return{...d("capacity"),resource:z.resource}}class P{id;cwd;connection;clientCapabilities;options;agent=null;runtime=null;pendingPrompt=null;pendingPromptCompletion=null;pendingUserShell=null;pendingUserShellCompletion=null;pendingResumeRequested=!1;availableCommandsTimer=null;taskStatusUnsubscribe;destroyed=!1;destroyFinished=!1;destroyPromise;messages;contextMessages;mode;updateEgress;constructor(z,Z,J,Y,H={}){this.id=z;this.cwd=Z;this.connection=J;this.clientCapabilities=Y;this.options=H;this.messages=[...H.initialMessages??[]],this.contextMessages=[...this.messages],this.mode=this.mapPermissionModeToMode(H.permissionMode),this.updateEgress=new Hz({maxPendingItems:$z,maxPendingBytes:Qz,writeTimeoutMs:Wz,signal:J.signal,sizeOf:(W)=>Buffer.byteLength(JSON.stringify(W)),write:async(W)=>{await J.sessionUpdate(W)},onFailure:(W)=>this.handleUpdateEgressFailure(W)})}async refreshPersistedMessages(){let[z,Z]=await Promise.all([F.loadSession(this.id,this.cwd),F.loadSessionModelContext(this.id,this.cwd)]);if(z.length>0)this.messages=z;if(Z.length>0)this.contextMessages=Z}async loadModelContextOr(z){let Z=await F.loadSessionModelContext(this.id,this.cwd);return Z.length>0?Z:[...z]}mapPermissionModeToMode(z){switch(z){case"yolo":return"yolo";case"autoEdit":return"auto-edit";case"plan":return"plan";case"default":default:return"default"}}createAgent(){if(!this.runtime)throw Error("Session runtime is unavailable");return Zz.createWithRuntime(this.runtime,{sessionId:this.id,...this.options.taskWorktree?{toolBlacklist:["EnterWorktree","ExitWorktree"]}:{}})}async initialize(){if(B.debug(`[AcpSession ${this.id}] Initializing...`),await F.setSessionPermissionMode(this.id,this.cwd,this.mapModeToPermissionMode()??"default"),N.initializeSession(this.connection,this.id,this.clientCapabilities,this.cwd,async(W)=>{await this.sendUpdateAndWait(W)}),B.debug(`[AcpSession ${this.id}] ACP service context initialized`),await s.resolvePendingWithHandler(this.cwd,this.id,{requestConfirmation:(W)=>this.requestPermission(W)}))await this.refreshPersistedMessages();else if((this.options.initialMessages?.length??0)>0)this.contextMessages=await this.loadModelContextOr(this.options.initialMessages??[]);let Z=this.options.mcpServers?Sz(this.options.mcpServers):void 0,J=N.getInstance().getTerminalService(this.id);if(this.runtime=await e.create({sessionId:this.id,workspaceRoot:this.cwd,permissionMode:this.mapModeToPermissionMode(),...Z?{mcpServers:Z}:{},...this.options.taskWorktree?{taskWorktree:this.options.taskWorktree}:{},...this.options.taskIsolation?{taskIsolation:this.options.taskIsolation}:{},userShellExecutor:{execute:async(W,Q)=>{let j=await J.execute(W,{cwd:Q.cwd,env:Q.env,timeout:Q.timeoutMs,signal:Q.signal,allowLocalFallback:!1,onOutput:(X)=>Q.onOutput?.("stdout",X)});return{exitCode:j.exitCode,stdout:j.stdout,stderr:j.stderr,...j.error?{error:j.error}:{},timedOut:j.failureKind==="timeout",aborted:j.failureKind==="aborted"}}},...(this.options.initialMessages?.length??0)>0?{sessionStart:{isResume:!0,resumeSessionId:this.id}}:{}}),await E.recoverInterrupted(this.cwd,this.id,this.runtime))await this.refreshPersistedMessages();this.agent=await this.createAgent(),await Xz(this.cwd),B.debug(`[AcpSession ${this.id}] Agent created successfully`),this.taskStatusUnsubscribe?.(),this.taskStatusUnsubscribe=n.subscribe((W)=>{if(W.sessionId!==this.id||W.projectPath!==this.cwd)return;if(W.type==="subagent.completion.queued"){this.sendUpdate({sessionUpdate:"session_info_update",updatedAt:new Date().toISOString(),_meta:{"blade/backgroundSubagentCompletion":W.properties}}),this.schedulePendingResume();return}if(W.type==="task.delivery"){if(!W.properties.taskDelivery||typeof W.properties.taskDelivery!=="object")return;this.sendUpdate({sessionUpdate:"session_info_update",updatedAt:typeof W.properties.updatedAt==="string"?W.properties.updatedAt:new Date().toISOString(),_meta:{"blade/taskDelivery":W.properties.taskDelivery,...W.properties.taskWorktreeRemoved===!0?{"blade/taskWorktreeRemoved":!0}:{}}});return}if(W.type!=="task.status")return;this.sendUpdate({sessionUpdate:"session_info_update",updatedAt:typeof W.properties.updatedAt==="string"?W.properties.updatedAt:new Date().toISOString(),_meta:{"blade/taskStatus":W.properties.taskStatus,...typeof W.properties.taskStatusReason==="string"?{"blade/taskStatusReason":W.properties.taskStatusReason}:{},...W.properties.taskFailure&&typeof W.properties.taskFailure==="object"?{"blade/taskFailure":W.properties.taskFailure}:{},...typeof W.properties.taskStartedAt==="string"?{"blade/taskStartedAt":W.properties.taskStartedAt}:{},...typeof W.properties.taskCompletedAt==="string"?{"blade/taskCompletedAt":W.properties.taskCompletedAt}:{},...W.properties.taskDiffStat&&typeof W.properties.taskDiffStat==="object"?{"blade/taskDiffStat":W.properties.taskDiffStat}:{},...typeof W.properties.taskQueuePosition==="number"?{"blade/taskQueuePosition":W.properties.taskQueuePosition}:{},...typeof W.properties.taskQueueDepth==="number"?{"blade/taskQueueDepth":W.properties.taskQueueDepth}:{},...typeof W.properties.taskConcurrencyLimit==="number"?{"blade/taskConcurrencyLimit":W.properties.taskConcurrencyLimit}:{},...typeof W.properties.taskInFlight==="number"?{"blade/taskInFlight":W.properties.taskInFlight}:{}}})});let H=await this.runtime.getGoal();if(this.runtime.getPendingSteeringCount()>0||H?.status==="active"||H?.status==="verifying")if(this.options.initialMessages===void 0)this.schedulePendingResume();else this.pendingResumeRequested=!0}async replayHistory(){for(let Z of this.messages){if(!this.canSendUpdates())return;if(!r(Z))continue;let J=Z.role==="user"?"user_message_chunk":Z.role==="assistant"?"agent_message_chunk":void 0;if(!J)continue;for(let Y of Mz(Z)){if(!this.canSendUpdates())return;if(!await this.sendUpdateAndWait({sessionUpdate:J,content:Y}))return}}let z=await this.runtime?.getGoal();if(z&&!await this.sendUpdateAndWait(this.goalSessionUpdate(z)))return;if(this.pendingResumeRequested)this.schedulePendingResume()}sendAvailableCommandsDelayed(){if(this.destroyed||this.connection.signal.aborted)return;if(this.availableCommandsTimer!==null)clearTimeout(this.availableCommandsTimer);B.debug(`[AcpSession ${this.id}] Scheduling available commands update (500ms delay)`),this.availableCommandsTimer=setTimeout(()=>{if(this.availableCommandsTimer=null,this.destroyed||this.connection.signal.aborted)return;this.sendAvailableCommands()},500)}async handleSlashCommand(z,Z){try{B.debug(`[AcpSession ${this.id}] Executing slash command: ${z}`);let J={cwd:this.cwd,surface:"acp",workspaceRoot:this.cwd,sessionId:this.id,messages:[...this.contextMessages],rewind:{listCheckpoints:async()=>{if(!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.listRewindCheckpoints()},execute:async(Q)=>{if(!this.runtime)throw Error("Session runtime is unavailable");let j=await this.runtime.rewindSession(Q);return this.messages=[...j.messages],this.contextMessages=await this.loadModelContextOr(j.messages),await this.agent?.destroy(),this.agent=await this.createAgent(),j}},reasoning:{get:async()=>{if(!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.getReasoningConfiguration()},set:async(Q)=>{if(await this.setReasoningEffort(Q),!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.getReasoningConfiguration()}},serviceTier:{get:async()=>{if(!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.getServiceTierConfiguration()},set:async(Q)=>{if(await this.setServiceTier(Q),!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.getServiceTierConfiguration()}},responseVerbosity:{get:async()=>{if(!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.getResponseVerbosityConfiguration()},set:async(Q)=>{if(await this.setResponseVerbosity(Q),!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.getResponseVerbosityConfiguration()}},communicationStyle:{get:async()=>{if(!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.getCommunicationStyleConfiguration()},set:async(Q)=>{if(await this.setCommunicationStyle(Q),!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.getCommunicationStyleConfiguration()}},subagents:{list:async()=>{if(!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.listSubagents()},resume:async(Q,j)=>{if(!this.runtime)throw Error("Session runtime is unavailable");let X=!1,D,G=(U)=>{this.sendUpdate({sessionUpdate:"tool_call_update",toolCallId:U.id,status:U.status==="completed"?"completed":"failed",content:[{type:"content",content:{type:"text",text:U.result?.message||U.result?.error||`Subagent ${U.status}`}}]})},L=this.runtime.resumeSubagent({agentId:Q,prompt:j,onCompleted:(U)=>{if(X)G(U);else D=U}});if(this.sendUpdate({sessionUpdate:"tool_call",toolCallId:L.session.id,status:"in_progress",title:`Resuming ${L.session.subagentType} subagent`,content:[{type:"content",content:{type:"text",text:`Resumed from ${L.source.id} at depth ${L.session.resumeDepth}`}}],kind:this.mapToolKind("readonly")}),X=!0,D)G(D);return L}},mcp:{getCatalog:async()=>{if(!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.getMcpContentCatalog()},refresh:async(Q)=>{if(!this.runtime)throw Error("Session runtime is unavailable");await this.runtime.refreshMcpContentCatalogs(Q)},getPrompt:async(Q,j,X)=>{if(!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.getMcpPrompt(Q,j,X)},complete:async(Q,j,X)=>{if(!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.completeMcpArgument(Q,j,X)},listTasks:async(Q)=>{if(!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.listMcpTasks(Q)},getTask:async(Q)=>{if(!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.getMcpTask(Q)},cancelTask:async(Q,j)=>{if(!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.cancelMcpTask(Q,j)},getLogs:async(Q,j)=>{if(!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.getMcpLogs(Q,j)},setLoggingLevel:async(Q,j)=>{if(!this.runtime)throw Error("Session runtime is unavailable");await this.runtime.setMcpLoggingLevel(Q,j)},getInstructions:async()=>{if(!this.runtime)throw Error("Session runtime is unavailable");return this.runtime.getMcpInstructions()}},codeReview:{run:async(Q,j)=>{if(!this.runtime)throw Error("Session runtime is unavailable");let X=await E.start({sessionId:this.id,projectPath:this.cwd,runtime:this.runtime,request:Q,signal:j,onEvent:(L)=>{if(L.kind==="tool_start")this.sendUpdate({sessionUpdate:"tool_call",toolCallId:L.toolCall.id,status:"in_progress",title:`Review: ${L.toolCall.function.name}`,content:[],kind:this.mapToolKind(L.toolKind)});else if(L.kind==="tool_result")this.sendUpdate({sessionUpdate:"tool_call_update",toolCallId:L.toolCall.id,status:L.result.success?"completed":"failed",content:[]})}}),D=await X.completion,G=(await E.list(this.cwd,this.id)).find((L)=>L.start.reviewId===X.reviewId);if(!G)throw Error(`Review not found: ${X.reviewId}`);return await this.refreshPersistedMessages(),{reviewId:X.reviewId,status:D.status,findings:D.findings.length,content:m(G.start,D)}}},signal:Z,acp:{sendMessage:(Q)=>{this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:Q}})},sendToolStart:(Q,j,X)=>{let D=`tool_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,G=this.mapToolKind(X);this.sendUpdate({sessionUpdate:"tool_call",toolCallId:D,status:"in_progress",title:`${Q}`,content:[{type:"content",content:{type:"text",text:JSON.stringify(j,null,2)}}],kind:G})},sendToolResult:(Q,j)=>{if(j.summary)this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:j.summary}})}}},Y=await Dz(z,J),H=Y.data?.action;if(H==="start_goal"||H==="resume_goal")this.schedulePendingResume();if(H==="rewind_session"&&Array.isArray(Y.data?.messages))this.messages=[...Y.data.messages],this.contextMessages=await this.loadModelContextOr(Y.data.messages);if((Y.message==="compact_completed"||Y.message==="compact_fallback")&&Y.data?.compactedMessages){this.contextMessages=[...Y.data.compactedMessages];let Q=await F.loadSession(this.id,this.cwd);if(Q.length>0)this.messages=Q}let W=Y.content||Y.message;if(W)this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:W}});if(Y.error)this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:`[FAIL] ${Y.error}`}});return await this.flushUpdates(),{stopReason:Y.success?"end_turn":"cancelled"}}catch(J){return B.error(`[AcpSession ${this.id}] Slash command error:`,J),this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:`[FAIL] 命令执行失败: ${J instanceof Error?J.message:"未知错误"}`}}),{stopReason:"cancelled"}}}async sendAvailableCommands(){try{let z=Lz(this.cwd,this.runtime?.getAgentResources()),Z=["model","permissions","theme","config","exit","ide"],Y=z.filter((H)=>!Z.includes(H.name)).map((H)=>{let W;if(H.usage){let Q=H.usage.replace(/^\/\w+\s*/,"").trim();if(Q)W=Q}if(H.aliases?.length){let Q=`Aliases: ${H.aliases.join(", ")}`;W=W?`${W} | ${Q}`:Q}return{name:H.name,description:H.description,input:W?{hint:W}:void 0}});B.info(`[AcpSession ${this.id}] Sending available commands: ${JSON.stringify(Y.map((H)=>H.name))}`),this.sendUpdate({sessionUpdate:"available_commands_update",availableCommands:Y}),B.info(`[AcpSession ${this.id}] Sent ${Y.length} available commands`)}catch(z){B.error(`[AcpSession ${this.id}] Failed to send available commands:`,z)}}async prompt(z,Z={}){if(N.setCurrentSession(this.id),!this.agent||!this.runtime)throw Error("Session not initialized");let J=this.resolvePrompt(z.prompt),Y=J.content,H=J.displayText,W=z._meta?.outputSchema??(Z.pendingInputOnly?this.runtime.getPendingSteeringMessages().find((L)=>L.outputSchema)?.outputSchema:void 0),Q;if(W!==void 0)Q=o(W).schema;if(H.trimStart().startsWith("!")){if(Q)throw Error("Output schemas cannot be combined with user shell commands");return this.handleUserShellCommand(H)}if(this.pendingPrompt){if(Q)throw Error("Wait for the active turn to finish before setting an output schema");if(/^\/goal(?:\s|$)/i.test(H.trim()))return this.handleSlashCommand(H,this.pendingPrompt.signal);let L=await this.runtime.enqueueSteering(Y,{allowBeforeTurn:!0});if(!L.accepted)throw Error(L.reason==="queue_full"?"Active turn steering queue is full":"Active turn is no longer steerable");if(B.debug(`[AcpSession ${this.id}] Queued steering for active turn (${L.queued})`),L.delivery==="next_turn")this.schedulePendingResume();return{stopReason:"end_turn"}}let j=new AbortController,X=!1,D,G=new Promise((L)=>{D=L});this.pendingPrompt=j,this.pendingPromptCompletion=G;try{if(B.debug(`[AcpSession ${this.id}] Received prompt: ${H.slice(0,100)}...`),jz(H)){if(Q)throw Error("Output schemas cannot be combined with slash commands");return await this.handleSlashCommand(H,j.signal)}let L={sessionId:this.id,userId:"acp-user",workspaceRoot:this.cwd,messages:[...this.contextMessages],signal:j.signal,permissionMode:this.mapModeToPermissionMode(),onPermissionModeChange:async($)=>{this.mode=this.mapPermissionModeToMode($),this.sendUpdate({sessionUpdate:"current_mode_update",currentModeId:this.mode})},...this.options.taskWorktree?{worktreeActive:!0}:{},confirmationHandler:{requestConfirmation:async($)=>{return this.requestPermission($)}}},U=await t(this.agent.chatStream(Y,L,{pendingInputOnly:Z.pendingInputOnly,goalContinuationOnly:Z.goalContinuationOnly,outputSchema:Q}),async($)=>{switch($.kind){case"content_delta":if(Q)break;this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:$.delta}});break;case"thinking_delta":this.sendUpdate({sessionUpdate:"agent_thought_chunk",content:{type:"text",text:$.delta}});break;case"tool_start":{let V=$.toolCall,O=V.function.name;if(O===x)break;let A=this.mapToolKind($.toolKind),w=`Executing ${O}`;if(O==="Task"&&"function"in V)try{let q=JSON.parse(V.function.arguments),K=q.resume_from??q.resume;if(typeof K==="string")w=`Resuming ${String(q.subagent_type||"subagent")} from ${K}`}catch{}this.sendUpdate({sessionUpdate:"tool_call",toolCallId:V.id,status:"in_progress",title:w,content:[],kind:A});break}case"tool_progress":{let V=$.toolCall;if(V.function.name===x)break;this.sendUpdate({sessionUpdate:"tool_call_update",toolCallId:V.id,status:"in_progress",content:[{type:"content",content:{type:"text",text:$.update.message}}]});break}case"tool_result":{let V=$.toolCall;if(V.function.name===x)break;let O=$.result,A=[],w=O.metadata;if(w?.kind==="patch"&&Array.isArray(w.changes))for(let K of w.changes){if(!K||typeof K!=="object"||!("path"in K)||typeof K.path!=="string")continue;A.push({type:"diff",path:K.path,oldText:"oldContent"in K&&typeof K.oldContent==="string"?K.oldContent:null,newText:"newContent"in K&&typeof K.newContent==="string"?K.newContent:null})}else if(w?.kind==="edit"&&typeof w.file_path==="string"&&typeof w.oldContent==="string"&&(typeof w.newContent==="string"||w.newContent===void 0))A.push({type:"diff",path:w.file_path,oldText:w.oldContent,newText:w.newContent??null});else{let K=V.function.name,Tz=Jz(i(zz(K,O),l));A.push({type:"content",content:{type:"text",text:Tz}})}if(V.function.name==="Task"&&(w?.verificationVerdict==="pass"||w?.verificationVerdict==="fail"||w?.verificationVerdict==="partial"))A.unshift({type:"content",content:{type:"text",text:`Verification result: ${w.verificationVerdict.toUpperCase()}`}});let q=O.success?"completed":"failed";this.sendUpdate({sessionUpdate:"tool_call_update",toolCallId:V.id,status:q,content:A});break}case"structured_output":this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:JSON.stringify($.output)}});break;case"mcp_catalog_changed":this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:`MCP catalog r${$.revision} (${$.serverName}): +${$.added.length} -${$.removed.length} ~${$.updated.length}
|
|
3
|
-
`}});break;case"mcp_content_changed":this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:`MCP ${$.contentKind} r${$.revision} (${$.serverName}): +${$.added.length} -${$.removed.length} ~${$.updated.length}
|
|
4
|
-
`}});break;case"mcp_resource_updated":this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:`MCP resource updated r${$.revision} (${$.serverName}): ${$.uri}
|
|
5
|
-
`}});break;case"mcp_connection_changed":this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:`MCP connection r${$.revision} (${$.serverName}): ${$.phase} ${$.attempt}/${$.maxAttempts}
|
|
6
|
-
`}});break;case"mcp_log":this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:`MCP log r${$.revision} (${$.serverName}) ${$.level}${$.logger?` logger=${$.logger}`:""}: ${$.message}
|
|
7
|
-
`}});break;case"mcp_instructions_changed":this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:`MCP instructions r${$.revision} (${$.serverName}): ${$.action}${$.detailsOmitted?" details-omitted":""}
|
|
8
|
-
`}});break;case"mcp_task_changed":this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:`MCP task r${$.revision} ${$.taskId} (${$.serverName}/${$.toolName}): ${$.status}${$.hasResult?" result-available":""}
|
|
9
|
-
`}});break;case"project_rules_loaded":this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:`Project rules loaded: ${$.files.length}${$.blockedWrite?" (write retry required)":""}
|
|
10
|
-
`}});break;case"provider_admission":X=$.phase!=="admitted",this.sendUpdate({sessionUpdate:"session_info_update",updatedAt:new Date().toISOString(),_meta:{"blade/providerAdmission":$.phase!=="admitted"?{phase:$.phase,requestClass:$.requestClass,resource:$.resource,scope:$.scope,...$.reason!==void 0?{reason:$.reason}:{},queuePosition:$.queuePosition,queueDepth:$.queueDepth,inFlight:$.inFlight,limit:$.limit,waitMs:$.waitMs,maxWaitMs:$.maxWaitMs,...$.recoveryRemainingMs!==void 0?{recoveryRemainingMs:$.recoveryRemainingMs}:{}}:null}});break;case"provider_circuit":this.sendUpdate({sessionUpdate:"session_info_update",updatedAt:new Date().toISOString(),_meta:{"blade/providerCircuit":{phase:$.phase,reason:$.reason,...$.statusCode!==void 0?{statusCode:$.statusCode}:{},...$.retryAfterMs!==void 0?{retryAfterMs:$.retryAfterMs}:{},...$.nextProbeAt!==void 0?{nextProbeAt:$.nextProbeAt}:{},openDurationMs:$.openDurationMs,...$.sampleCount!==void 0?{sampleCount:$.sampleCount}:{},...$.failureCount!==void 0?{failureCount:$.failureCount}:{},...$.recoveryRemainingMs!==void 0?{recoveryRemainingMs:$.recoveryRemainingMs}:{}}}});break;case"provider_retry":this.sendUpdate({sessionUpdate:"session_info_update",updatedAt:new Date().toISOString(),_meta:{"blade/providerRetry":{phase:$.phase,attempt:$.attempt,maxRetries:$.maxRetries,reason:$.reason,...$.statusCode!==void 0?{statusCode:$.statusCode}:{},...$.delayMs!==void 0?{delayMs:$.delayMs}:{},...$.nextRetryAt!==void 0?{nextRetryAt:$.nextRetryAt}:{},...$.mode!==void 0?{mode:$.mode}:{},...$.recoveryBudgetMs!==void 0?{recoveryBudgetMs:$.recoveryBudgetMs}:{},...$.recoveryElapsedMs!==void 0?{recoveryElapsedMs:$.recoveryElapsedMs}:{},...$.recoveryRemainingMs!==void 0?{recoveryRemainingMs:$.recoveryRemainingMs}:{},...$.exhaustedBy!==void 0?{exhaustedBy:$.exhaustedBy}:{}}}});break;case"provider_stall":this.sendUpdate({sessionUpdate:"session_info_update",updatedAt:new Date().toISOString(),_meta:{"blade/providerStall":{phase:$.phase,stallCount:$.stallCount,durationMs:$.durationMs,warningAfterMs:$.warningAfterMs,timeoutMs:$.timeoutMs,outputStarted:$.outputStarted}}});break;case"action_stationarity":this.sendUpdate({sessionUpdate:"session_info_update",updatedAt:new Date().toISOString(),_meta:{"blade/actionStationarity":{phase:$.phase,toolName:$.toolName,runLength:$.runLength,nudgeThreshold:$.nudgeThreshold,haltThreshold:$.haltThreshold,progressAware:$.progressAware}}});break;case"task_update":this.sendPlanUpdate($.tasks);break;case"steering_applied":break;case"follow_up_started":for(let V of $.messages){if(!V.recovered||V.persisted)continue;for(let O of Bz(V.content))this.sendUpdate({sessionUpdate:"user_message_chunk",content:O})}if($.recovered>0)this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:`[Resuming ${$.recovered} queued instruction${$.recovered===1?"":"s"} recovered after restart]
|
|
11
|
-
`}});break;case"goal_updated":if($.goal)this.sendUpdate(this.goalSessionUpdate($.goal));if($.goal&&$.goal.status!=="active")this.sendUpdate({sessionUpdate:"agent_message_chunk",content:{type:"text",text:`[Goal ${$.goal.status}: ${$.goal.objective}]
|
|
12
|
-
`}});break;case"goal_continuation_started":break;case"compaction":this.sendUpdate({sessionUpdate:"session_info_update",updatedAt:new Date().toISOString(),_meta:{"blade/compaction":{phase:$.phase,...$.reason?{reason:$.reason}:{},...$.strategy?{strategy:$.strategy}:{},...$.outcome?{outcome:$.outcome}:{},...$.preTokens!==void 0?{preTokens:$.preTokens}:{},...$.postTokens!==void 0?{postTokens:$.postTokens}:{}}}});break;default:break}if(!await this.flushUpdates())j.abort("acp-egress-failed")});if(!await this.flushUpdates())j.abort("acp-egress-failed");this.contextMessages=[...L.messages];let f=await F.loadSession(this.id,this.cwd);if(this.messages=f.length>0?f:[...L.messages],!U.success){let $=U.error?.type??"unknown",V=U.error?.details??U.error?.message??"Agent execution failed",O=Iz(V)??v(V);throw yz.internalError({failureType:$,taskFailure:{code:O.code,retryable:O.retryable,...O.resource?{resource:O.resource}:{}}},`Agent turn failed (${$})`)}if(j.signal.aborted)return{stopReason:"cancelled"};let u={...U.metadata?.structuredOutput?{structuredOutput:U.metadata.structuredOutput,outputSchemaDigest:U.metadata.structuredOutputSchemaDigest}:{},...U.metadata?.goalCompletionVerified?{goalCompletion:{verified:!0,verdict:U.metadata.goalVerificationVerdict,...U.metadata.goalVerifierSessionId?{verifierSessionId:U.metadata.goalVerifierSessionId}:{},...U.metadata.goalVerificationEvidenceSha256?{evidenceSha256:U.metadata.goalVerificationEvidenceSha256}:{}}}:{}};return{stopReason:"end_turn",...Object.keys(u).length>0?{_meta:u}:{}}}catch(L){if(j.signal.aborted||L instanceof Error&&L.name==="AbortError")return{stopReason:"cancelled"};throw B.error(`[AcpSession ${this.id}] Prompt error:`,L),L}finally{if(X&&!this.destroyed)this.sendUpdate({sessionUpdate:"session_info_update",updatedAt:new Date().toISOString(),_meta:{"blade/providerAdmission":null}}),await this.flushUpdates();if(D(),this.pendingPromptCompletion===G)this.pendingPromptCompletion=null;if(this.pendingPrompt===j){if(this.pendingPrompt=null,!this.destroyed&&this.pendingResumeRequested)this.schedulePendingResume()}}}async handleUserShellCommand(z){if(!this.runtime)throw Error("Session runtime is unavailable");if(this.pendingUserShell)throw Error("A user shell command is already running");let Z=z.trimStart().slice(1).trim();if(!Z)throw Error("User shell command cannot be empty");let J=new AbortController,Y,H=new Promise((j)=>{Y=j});this.pendingUserShell=J,this.pendingUserShellCompletion=H;let W,Q="";try{let j=await this.runtime.executeUserShellCommand(Z,{signal:J.signal,onEvent:async(D)=>{if(W=D.executionId,D.type==="started"){this.sendUpdate({sessionUpdate:"tool_call",toolCallId:D.executionId,status:"in_progress",title:`! ${D.command}`,content:[],kind:"execute"});return}if(D.type==="output"){Q+=D.chunk,this.sendUpdate({sessionUpdate:"tool_call_update",toolCallId:D.executionId,status:"in_progress",content:[{type:"content",content:{type:"text",text:D.chunk}}]});return}let G=k(D.record);this.sendUpdate({sessionUpdate:"tool_call_update",toolCallId:D.executionId,status:D.record.status==="completed"?"completed":"failed",content:[{type:"content",content:{type:"text",text:Q?kz(D.record):G}}]})}}),X={role:"user",content:j.modelContent,metadata:{userShellCommand:JSON.parse(JSON.stringify(j.record))}};if(this.messages.push(X),this.contextMessages.push(X),j.delivery==="next_turn")this.schedulePendingResume();if(!await this.flushUpdates())return J.abort("acp-egress-failed"),{stopReason:"cancelled"};return{stopReason:j.record.status==="aborted"?"cancelled":"end_turn"}}catch(j){if(W)this.sendUpdate({sessionUpdate:"tool_call_update",toolCallId:W,status:"failed",content:[{type:"content",content:{type:"text",text:j instanceof Error?j.message:String(j)}}]});if(J.signal.aborted)return{stopReason:"cancelled"};throw j}finally{if(Y(),this.pendingUserShellCompletion===H)this.pendingUserShellCompletion=null;if(this.pendingUserShell===J)this.pendingUserShell=null}}schedulePendingResume(){if(this.destroyed||this.connection.signal.aborted)return;this.pendingResumeRequested=!0,queueMicrotask(()=>{this.resumePendingIfIdle()})}async resumePendingIfIdle(){if(this.destroyed||this.connection.signal.aborted)return;if(this.pendingPrompt||this.pendingUserShell||!this.runtime||!this.agent)return;let z=this.runtime.getPendingSteeringCount()>0,Z=z?null:await this.runtime.getGoal(),J=Z?.status==="active"||Z?.status==="verifying";if(!z&&!J){this.pendingResumeRequested=!1;return}this.pendingResumeRequested=!1,await this.prompt({sessionId:this.id,prompt:[]},{pendingInputOnly:z,goalContinuationOnly:J}).catch((Y)=>{B.error(`[AcpSession ${this.id}] Failed to resume pending input:`,Y)})}cancel(){B.info(`[AcpSession ${this.id}] Cancel requested`),this.pendingResumeRequested=!1;let z=!1;if(this.pendingPrompt)this.pendingPrompt.abort(),this.pendingPrompt=null,z=!0;if(this.pendingUserShell)this.pendingUserShell.abort(),this.pendingUserShell=null,z=!0;if(!z)B.warn(`[AcpSession ${this.id}] No pending prompt to cancel`)}async setMode(z){let J=["default","auto-edit","yolo","plan"].includes(z)?z:"default",Y=this.mapModeIdToPermissionMode(J);await F.setSessionPermissionMode(this.id,this.cwd,Y),this.mode=J,B.info(`[AcpSession ${this.id}] Mode set to: ${this.mode}`),this.sendUpdate({sessionUpdate:"current_mode_update",currentModeId:this.mode})}mapModeToPermissionMode(){return this.mapModeIdToPermissionMode(this.mode)}mapModeIdToPermissionMode(z){switch(z){case"yolo":return"yolo";case"auto-edit":return"autoEdit";case"plan":return"plan";case"default":default:return"default"}}shouldAutoApprove(z){switch(this.mode){case"yolo":return!0;case"auto-edit":return z==="readonly"||z==="write";case"plan":return z==="readonly";case"default":default:return!1}}async setModel(z){if(B.info(`[AcpSession ${this.id}] Model set to: ${z}`),this.pendingPrompt)throw Error("Cannot switch models while a prompt is active");if(!this.agent)throw Error("Session not initialized");if(!this.runtime)throw Error("Session runtime is unavailable");let Z=this.runtime.getCurrentModelId();await this.agent.switchModel(z);try{try{await F.updateSessionMetadata(this.id,this.cwd,{selectedModelId:z})}catch(J){if(!(J instanceof R)&&J.code!=="ENOENT")throw J;await F.createSessionMetadata(this.id,this.cwd,{taskStatus:"completed",selectedModelId:z})}}catch(J){if(Z&&Z!==z)await this.agent.switchModel(Z).catch((Y)=>{B.error(`[AcpSession ${this.id}] Failed to roll back a non-durable model switch:`,Y)});throw J}}getCurrentModelId(){return this.runtime?.getCurrentModelId()}async setReasoningEffort(z){if(this.pendingPrompt)throw Error("Cannot switch reasoning effort while a prompt is active");if(!this.runtime)throw Error("Session runtime is unavailable");let Z=this.runtime.getReasoningConfiguration();try{this.runtime.resolveReasoningConfiguration(z)}catch(J){throw Error(J instanceof Error?J.message:"Invalid reasoning effort")}if(Z.selection===z)return;await this.runtime.refresh({reasoningEffort:z});try{try{await F.updateSessionMetadata(this.id,this.cwd,{reasoningEffort:z})}catch(J){if(!(J instanceof R)&&J.code!=="ENOENT")throw J;await F.createSessionMetadata(this.id,this.cwd,{taskStatus:"completed",selectedModelId:this.runtime.getCurrentModelId(),reasoningEffort:z})}}catch(J){throw await this.runtime.refresh({reasoningEffort:Z.selection}),J}}async setServiceTier(z){if(this.pendingPrompt)throw Error("Cannot switch service tier while a prompt is active");if(!this.runtime)throw Error("Session runtime is unavailable");let Z=this.runtime.getServiceTierConfiguration();try{this.runtime.resolveServiceTierConfiguration(z)}catch(J){throw Error(J instanceof Error?J.message:"Invalid service tier")}if(Z.selection===z)return;await this.runtime.refresh({serviceTier:z});try{try{await F.updateSessionMetadata(this.id,this.cwd,{serviceTier:z})}catch(J){if(!(J instanceof R)&&J.code!=="ENOENT")throw J;await F.createSessionMetadata(this.id,this.cwd,{taskStatus:"completed",selectedModelId:this.runtime.getCurrentModelId(),serviceTier:z})}}catch(J){throw await this.runtime.refresh({serviceTier:Z.selection}),J}}async setResponseVerbosity(z){if(this.pendingPrompt)throw Error("Cannot switch response verbosity while a prompt is active");if(!this.runtime)throw Error("Session runtime is unavailable");let Z=this.runtime.getResponseVerbosityConfiguration();try{this.runtime.resolveResponseVerbosityConfiguration(z)}catch(J){throw Error(J instanceof Error?J.message:"Invalid response verbosity")}if(Z.selection===z)return;await this.runtime.refresh({responseVerbosity:z});try{try{await F.updateSessionMetadata(this.id,this.cwd,{responseVerbosity:z})}catch(J){if(!(J instanceof R)&&J.code!=="ENOENT")throw J;await F.createSessionMetadata(this.id,this.cwd,{taskStatus:"completed",selectedModelId:this.runtime.getCurrentModelId(),responseVerbosity:z})}}catch(J){throw await this.runtime.refresh({responseVerbosity:Z.selection}),J}}async setCommunicationStyle(z){if(this.pendingPrompt)throw Error("Cannot switch communication style while a prompt is active");if(!this.runtime)throw Error("Session runtime is unavailable");let Z=this.runtime.getCommunicationStyleConfiguration(),J=this.runtime.resolveCommunicationStyleConfiguration(z);if(J.source!=="built-in"&&!J.contentSha256)throw Error("Custom communication style has no provenance");if(Z.selection===z)return;await this.runtime.refresh({communicationStyle:z});try{try{await F.updateSessionMetadata(this.id,this.cwd,{communicationStyle:z,communicationStyleDigest:J.source==="built-in"?null:J.contentSha256})}catch(Y){if(!(Y instanceof R)&&Y.code!=="ENOENT")throw Y;await F.createSessionMetadata(this.id,this.cwd,{taskStatus:"completed",selectedModelId:this.runtime.getCurrentModelId(),communicationStyle:z,...J.source!=="built-in"&&J.contentSha256?{communicationStyleDigest:J.contentSha256}:{}})}}catch(Y){throw await this.runtime.refresh({communicationStyle:Z.selection}),Y}}getModelConfiguration(){if(!this.runtime)return;let z=this.runtime.getConfig();return{currentModelId:this.runtime.getCurrentModelId()??z.currentModelId,models:z.models.map((Z)=>structuredClone(Z)),modelProviders:structuredClone(z.modelProviders),reasoning:this.runtime.getReasoningConfiguration(),serviceTier:this.runtime.getServiceTierConfiguration(),responseVerbosity:this.runtime.getResponseVerbosityConfiguration(),communicationStyle:this.runtime.getCommunicationStyleConfiguration()}}getMode(){return this.mode}isIdleForResidency(){return!this.destroyed&&this.pendingPrompt===null&&this.pendingUserShell===null&&(this.runtime?.isIdleForResidency()??!1)}destroy(z={}){if(this.destroyPromise)return this.destroyFinished?Promise.resolve():this.destroyPromise;return this.destroyPromise=this.destroyOwnedResources(z.discardPendingInput===!0).finally(()=>{this.destroyFinished=!0}),this.destroyPromise}async destroyOwnedResources(z){if(this.destroyed=!0,this.updateEgress.close(new Yz("closed","ACP Session was destroyed")),this.availableCommandsTimer!==null)clearTimeout(this.availableCommandsTimer),this.availableCommandsTimer=null;this.taskStatusUnsubscribe?.(),this.taskStatusUnsubscribe=void 0;let Z=this.agent,J=this.runtime,Y=this.pendingPromptCompletion,H=this.pendingUserShellCompletion;this.agent=null,this.runtime=null;let W,Q=async(j)=>{try{await j()}catch(X){W??=X}};if(await Q(()=>this.cancel()),Y)await Q(()=>Y);if(H)await Q(()=>H);if(z&&Y&&J)await Q(()=>J.discardPendingInput());if(Z)await Q(()=>Z.destroy());if(J)await Q(()=>J.dispose());if(await Q(()=>N.destroySession(this.id)),B.debug(`[AcpSession ${this.id}] Destroyed`),W!==void 0)throw W}resolvePrompt(z){let Z=[],J=[],Y=0,H=0,W=0,Q=(X)=>{if(J.length>0)J.push({type:"text",text:`
|
|
13
|
-
`}),W+=1;if(J.push(X),X.type==="text")W+=X.text.length};for(let X of z)if(X.type==="text")Z.push(X.text),Q({type:"text",text:X.text});else if(X.type==="image"){let D=`data:${X.mimeType};base64,${X.data}`;Y+=1,H+=D.length,Z.push(`[Image: ${X.mimeType}]`),Q({type:"image_url",image_url:{url:D}})}else if(X.type==="resource"){let D=X.resource;if("text"in D){let G=`<file path="${D.uri}">
|
|
14
|
-
${D.text}
|
|
15
|
-
</file>`;Z.push(G),Q({type:"text",text:G})}}else if(X.type==="resource_link"){let D=`[Resource: ${X.uri}]`;Z.push(D),Q({type:"text",text:D})}if(Y>h)throw Error(`ACP prompt contains more than ${h} images`);if(H>c)throw Error("ACP prompt images exceed the 5 MiB limit");if(W>S)throw Error(`ACP prompt text exceeds ${S} characters`);let j=Z.join(`
|
|
16
|
-
`);return{content:Y>0?J:j,displayText:j}}canSendUpdates(){return!this.destroyed&&!this.connection.signal.aborted&&!this.updateEgress.stats().closed}async sendUpdateAndWait(z){if(!this.canSendUpdates())return!1;let Z=this.updateEgress.offer({sessionId:this.id,update:z});if(!Z.accepted)return!1;try{return await Z.completion,this.canSendUpdates()}catch{return!1}}goalSessionUpdate(z){return{sessionUpdate:"session_info_update",updatedAt:z.updatedAt,_meta:{"blade/goal":{goalId:z.goalId,status:z.status,verificationAttempt:z.completionVerification?.attempt,verificationStatus:z.completionVerification?.status,verifierSessionId:z.completionVerification?.verifierSessionId,verificationEvidenceSha256:z.completionVerification?.evidenceSha256}}}}sendUpdate(z){if(!this.canSendUpdates())return;this.updateEgress.offer({sessionId:this.id,update:z})}async flushUpdates(){if(!this.canSendUpdates())return!1;try{return await this.updateEgress.flush(),this.canSendUpdates()}catch{return!1}}handleUpdateEgressFailure(z){if(this.destroyed)return;B.warn(`[AcpSession ${this.id}] Update egress closed: kind=${z.kind}`),this.pendingPrompt?.abort("acp-egress-failed"),this.pendingUserShell?.abort("acp-egress-failed")}sendPlanUpdate(z){let Z=z.map((J)=>({content:J.subject,priority:J.priority,status:J.status}));B.debug(`[AcpSession ${this.id}] Sending plan update with ${Z.length} entries`),this.sendUpdate({sessionUpdate:"plan",entries:Z})}async requestPermission(z){let Z=this.pendingPrompt?.signal;if(z.type==="askUserQuestion")return this.requestUserQuestions(z,Z);if(z.type==="mcpElicitation")return this.requestMcpElicitation(z,Z);let J=z.kind?.toLowerCase()||"execute";if(z.type!=="mcpSampling"&&this.shouldAutoApprove(J))return B.debug(`[AcpSession ${this.id}] Auto-approving ${J} in mode: ${this.mode}`),{approved:!0};if(this.mode==="plan"&&(J==="write"||J==="execute"))return B.debug(`[AcpSession ${this.id}] Rejecting ${J} in plan mode`),{approved:!1,reason:"Write and execute operations are not allowed in Plan mode"};try{let Y=y(),H=[];if(z.message)H.push({type:"content",content:{type:"text",text:z.message}});if(z.details)H.push({type:"content",content:{type:"text",text:z.details}});if(z.risks&&z.risks.length>0)H.push({type:"content",content:{type:"text",text:`Risks:
|
|
17
|
-
- ${z.risks.join(`
|
|
18
|
-
- `)}`}});let W=this.mapToolKind(J),Q={sessionId:this.id,options:z.type==="mcpSampling"?[{optionId:"allow_once",name:"Allow this sampling request",kind:"allow_once"},{optionId:"reject_once",name:"Deny",kind:"reject_once"}]:[{optionId:"allow_once",name:"Allow once",kind:"allow_once"},{optionId:"allow_always",name:"Always allow",kind:"allow_always"},{optionId:"reject_once",name:"Deny once",kind:"reject_once"},{optionId:"reject_always",name:"Always deny",kind:"reject_always"}],toolCall:{toolCallId:Y,status:"pending",title:z.title||"Permission Required",content:H,kind:W}},j=await this.waitForClientInteraction(this.connection.requestPermission(Q),Z);if(!j)return{approved:!1,reason:M};let X=j.outcome;if(X.outcome==="cancelled")return{approved:!1,reason:"User cancelled the permission request"};let D=X.optionId;if(D==="allow_always")return{approved:!0,scope:"project"};if(D==="reject_always")return{approved:!1,scope:"project",reason:"User permanently denied the permission request"};let G=D==="allow_once";return{approved:G,scope:"once",reason:G?void 0:"User denied the operation"}}catch(Y){return B.warn(`[AcpSession ${this.id}] Permission request failed:`,Y),{approved:!1,reason:"Permission request failed"}}}async requestUserQuestions(z,Z){let J=z.questions??[];if(J.length===0)return{approved:!1,reason:"No structured questions were provided"};if(J.some((H)=>H.multiSelect))return{approved:!1,reason:"ACP does not support multi-select question responses"};let Y={};try{for(let[H,W]of J.entries()){let Q=W.options.map((G,L)=>`answer:${H}:${L}`),j=`answer:${H}:cancel`,X=await this.waitForClientInteraction(this.connection.requestPermission({sessionId:this.id,options:[...W.options.map((G,L)=>({optionId:Q[L],name:G.label,kind:"allow_once"})),{optionId:j,name:"Cancel",kind:"reject_once"}],toolCall:{toolCallId:y(),status:"pending",title:W.header,kind:"think",content:[{type:"content",content:{type:"text",text:[W.question,...W.options.map((G)=>`${G.label}: ${G.description}`)].join(`
|
|
19
|
-
`)}}]}}),Z);if(!X)return{approved:!1,reason:M};if(X.outcome.outcome!=="selected")return{approved:!1,reason:"User cancelled the question prompt"};let D=Q.indexOf(X.outcome.optionId);if(D<0)return{approved:!1,reason:"User cancelled the question prompt"};Y[W.header]=W.options[D].label}return{approved:!0,answers:Y}}catch(H){return B.warn(`[AcpSession ${this.id}] Question request failed:`,H),{approved:!1,reason:"Question request failed"}}}async requestMcpElicitation(z,Z){let J=z.mcpElicitation;if(!J)return{approved:!1,reason:"MCP elicitation details are missing",elicitation:{action:"cancel"}};try{if(J.mode==="url"){let H=await this.requestElicitationChoice("MCP external authorization",[J.message,`Server: ${J.serverName}`,`Domain: ${J.domain??"unknown"}`,`URL: ${J.url??""}`,"Open this URL yourself only if you trust the MCP server."].join(`
|
|
20
|
-
`),[{id:"accept",label:"I will open this URL"},{id:"decline",label:"Decline"}],Z);if(H==="accept")return{approved:!0,elicitation:{action:"accept"}};return{approved:!1,reason:H==="decline"?"User declined URL":"User cancelled",elicitation:{action:H==="decline"?"decline":"cancel"}}}let Y=Object.create(null);for(let H of J.fields??[]){let W=await this.collectAcpElicitationField(H,Z);if(W.cancelled)return{approved:!1,reason:W.reason,elicitation:{action:"cancel"}};if(W.value!==void 0)Y[H.name]=W.value}return{approved:!0,elicitation:{action:"accept",content:Y}}}catch(Y){return B.warn(`[AcpSession ${this.id}] MCP elicitation failed:`,Y),{approved:!1,reason:"MCP elicitation failed",elicitation:{action:"cancel"}}}}async collectAcpElicitationField(z,Z){if(z.type==="select"||z.type==="boolean"){let J=z.type==="boolean"?[{id:"true",label:"Yes",value:!0},{id:"false",label:"No",value:!1}]:(z.options??[]).map((W,Q)=>({id:`option:${Q}`,label:W.label,value:W.value})),Y=await this.requestElicitationChoice(z.title,[z.description,z.required?"Required":"Optional"].filter(Boolean).join(`
|
|
21
|
-
`),[...J.map((W)=>({id:W.id,label:W.label})),...!z.required?[{id:"skip",label:"Skip"}]:[]],Z);if(Y==="skip")return{cancelled:!1};let H=J.find((W)=>W.id===Y);if(!H)return{cancelled:!0,reason:"User cancelled MCP elicitation"};return{cancelled:!1,value:H.value}}if(z.defaultValue!==void 0){let J=await this.requestElicitationChoice(z.title,[z.description,`ACP cannot collect ${z.type} input. Use the server default: ${String(z.defaultValue)}?`].filter(Boolean).join(`
|
|
22
|
-
`),[{id:"default",label:"Use default"},...!z.required?[{id:"skip",label:"Skip"}]:[]],Z);if(J==="default")return{cancelled:!1,value:z.defaultValue};if(J==="skip")return{cancelled:!1};return{cancelled:!0,reason:"User cancelled MCP elicitation"}}if(!z.required)return{cancelled:!1};return{cancelled:!0,reason:`ACP cannot collect required ${z.type} field "${z.name}"`}}async requestElicitationChoice(z,Z,J,Y){let H=await this.waitForClientInteraction(this.connection.requestPermission({sessionId:this.id,options:[...J.map((W)=>({optionId:W.id,name:W.label,kind:"allow_once"})),{optionId:"cancel",name:"Cancel",kind:"reject_once"}],toolCall:{toolCallId:y(),status:"pending",title:z,kind:"think",content:[{type:"content",content:{type:"text",text:Z}}]}}),Y);return H?.outcome.outcome==="selected"?H.outcome.optionId:void 0}async waitForClientInteraction(z,Z){if(!Z)return z;if(Z.aborted)return;return new Promise((J,Y)=>{let H=!1,W=(j)=>{if(H)return;H=!0,Z.removeEventListener("abort",Q),j()},Q=()=>W(()=>J(void 0));if(Z.addEventListener("abort",Q,{once:!0}),Z.aborted)Q();z.then((j)=>W(()=>J(j)),(j)=>W(()=>Y(j)))})}mapToolKind(z){return{readonly:"read",write:"edit",execute:"execute",read:"read",edit:"edit",delete:"delete",move:"move",search:"search",think:"think",fetch:"fetch"}[z||""]||"other"}}var _=T("Agent");class C{connection;sessions=new Map;sessionLoadQueues=new Map;runtimeResidencyValue;clientCapabilities;destroyed=!1;destroyPromise;constructor(z){this.connection=z}get runtimeResidency(){if(!this.runtimeResidencyValue){let z=_z();this.runtimeResidencyValue=new xz({maxResident:z?.maxResidentSessionRuntimes??wz,idleMs:z?.sessionRuntimeIdleMs??Kz})}return this.runtimeResidencyValue}async reserveSessionRuntime(z){try{return await this.runtimeResidency.reserve(z,{surface:"acp",allowEviction:!1})}catch(Z){if(Z instanceof Pz)throw fz.internalError({resource:Z.resource,limit:Z.limit,retryable:Z.retryable},Z.message);throw Z}}async initialize(z){return _.info("[BladeAgent] Initializing ACP connection"),_.debug(`[BladeAgent] Client capabilities: ${JSON.stringify(z.clientCapabilities)}`),this.clientCapabilities=z.clientCapabilities,await Oz(),{protocolVersion:Cz,agentCapabilities:{loadSession:!0,sessionCapabilities:{list:{},fork:{},close:{}},promptCapabilities:{image:!0,audio:!1,embeddedContext:!0},mcpCapabilities:{http:!0,sse:!0}}}}async authenticate(z){return}async newSession(z){this.assertNotDestroyed();let Z=I("acp"),J=await this.reserveSessionRuntime(Z),Y=z.cwd||Fz(),H=z._meta?.["blade/taskIsolation"],W=H==="local"||H==="worktree"?H:void 0,Q=z._meta?.["blade/taskPrompt"],j;try{let X=W?await Nz.createSessionTask({sessionId:Z,prompt:typeof Q==="string"&&Q.trim()?Q:"ACP task session",sourceProjectPath:Y,isolation:W}):void 0,D=X?.metadata.projectPath??Y;return _.info(`[BladeAgent] Creating new session: ${Z}`),_.debug(`[BladeAgent] Session cwd: ${D}`),j=new P(Z,D,this.connection,this.clientCapabilities,{mcpServers:z.mcpServers,...X?.taskWorktree?{taskWorktree:X.taskWorktree}:{},...X?.metadata.taskIsolation?{taskIsolation:X.metadata.taskIsolation}:{}}),await j.initialize(),this.assertNotDestroyed(),this.commitSession(Z,j,J),_.info(`[BladeAgent] Session ${Z} created, scheduling available commands update`),j.sendAvailableCommandsDelayed(),this.buildChildSessionResponse(Z,X?.metadata,j.getModelConfiguration())}catch(X){throw J.cancel(),await j?.destroy().catch(()=>{return}),X}}async listSessions(z){if(z.cwd!=null&&!Gz.isAbsolute(z.cwd))throw Error("ACP session list cwd must be absolute");let Z=await F.listSessionPage({cwd:z.cwd??void 0,cursor:z.cursor??void 0,limit:50,includeSubagents:!1});return{sessions:Z.sessions.map((J)=>({sessionId:J.sessionId,cwd:J.projectPath,title:J.title??null,updatedAt:J.lastMessageTime,_meta:{"blade/taskStatus":J.taskStatus,...J.taskStatusReason?{"blade/taskStatusReason":J.taskStatusReason}:{},...J.taskFailure?{"blade/taskFailure":J.taskFailure}:{},...J.taskStartedAt?{"blade/taskStartedAt":J.taskStartedAt}:{},...J.taskCompletedAt?{"blade/taskCompletedAt":J.taskCompletedAt}:{},...J.taskModelId?{"blade/taskModelId":J.taskModelId}:{},...J.taskRetryAvailable?{"blade/taskRetryAvailable":!0}:{},...J.taskRetriedFrom?{"blade/taskRetriedFrom":J.taskRetriedFrom}:{},...J.taskDelivery?{"blade/taskDelivery":J.taskDelivery}:{},...J.taskIsolation?{"blade/taskIsolation":J.taskIsolation}:{},...J.taskSourceProjectPath?{"blade/taskSourceProjectPath":J.taskSourceProjectPath}:{},...J.taskWorktreeBranch?{"blade/taskWorktreeBranch":J.taskWorktreeBranch}:{},...J.taskBaseCommit?{"blade/taskBaseCommit":J.taskBaseCommit}:{},...J.taskDiffStat?{"blade/taskDiffStat":J.taskDiffStat}:{},...J.taskQueuePosition?{"blade/taskQueuePosition":J.taskQueuePosition}:{},...J.taskQueueDepth!==void 0?{"blade/taskQueueDepth":J.taskQueueDepth}:{},...J.taskConcurrencyLimit!==void 0?{"blade/taskConcurrencyLimit":J.taskConcurrencyLimit}:{}}})),nextCursor:Z.nextCursor}}async unstable_forkSession(z){if(this.assertNotDestroyed(),!Gz.isAbsolute(z.cwd))throw Error("ACP session fork cwd must be absolute");let Z=I("fork"),J=await this.reserveSessionRuntime(Z),Y;try{let H=await F.forkSession(z.sessionId,{sourceProjectPath:z.cwd,targetProjectPath:z.cwd,newSessionId:Z});return this.assertNotDestroyed(),Y=new P(H.sessionId,z.cwd,this.connection,this.clientCapabilities,{initialMessages:H.messages,permissionMode:H.metadata.permissionMode,mcpServers:z.mcpServers}),await Y.initialize(),this.assertNotDestroyed(),this.commitSession(H.sessionId,Y,J),Y.sendAvailableCommandsDelayed(),this.buildChildSessionResponse(H.sessionId,H.metadata,Y.getModelConfiguration())}catch(H){throw J.cancel(),await Y?.destroy().catch(()=>{return}),H}}async loadSession(z){this.assertNotDestroyed(),_.info(`[BladeAgent] Loading session: ${z.sessionId}`);let J=(this.sessionLoadQueues.get(z.sessionId)??Promise.resolve()).then(()=>this.replaceSession(z)),Y=J.then(()=>{return},()=>{return});this.sessionLoadQueues.set(z.sessionId,Y);try{return await J}finally{if(this.sessionLoadQueues.get(z.sessionId)===Y)this.sessionLoadQueues.delete(z.sessionId)}}async replaceSession(z){this.assertNotDestroyed(),await F.assertSessionWritable(z.sessionId,z.cwd),await this.closeResidentSession(z.sessionId);let Z=await this.reserveSessionRuntime(z.sessionId),J;try{let[Y,H]=await Promise.all([F.loadSession(z.sessionId,z.cwd),F.findSessionMetadata(z.sessionId,z.cwd)]);if(!H)throw Error(`Session not found: ${z.sessionId}`);return J=new P(z.sessionId,z.cwd,this.connection,this.clientCapabilities,{initialMessages:Y,permissionMode:H.permissionMode,mcpServers:z.mcpServers}),await J.initialize(),await J.replayHistory(),this.assertNotDestroyed(),this.commitSession(z.sessionId,J,Z),J.sendAvailableCommandsDelayed(),this.buildSessionSetup(J.getModelConfiguration(),J.getMode())}catch(Y){throw Z.cancel(),await J?.destroy().catch(()=>{return}),Y}}commitSession(z,Z,J){let Y=J.commit({key:z,surface:"acp",value:Z,canEvict:()=>Z.isIdleForResidency(),dispose:async()=>{if(this.sessions.get(z)===Z)this.sessions.delete(z);await Z.destroy()}});this.sessions.set(z,Z),Y.release()}async closeResidentSession(z,Z={}){let J=this.sessions.get(z);if(!J)return;let Y=this.runtimeResidency.owns(z,J),H;try{await J.destroy(Z)}catch(Q){H=Q}let W=await this.runtimeResidency.forget(z,J);if(this.sessions.get(z)===J)this.sessions.delete(z);if(Y&&!W&&H===void 0)throw Error(`ACP Session is still active: ${z}`);if(H!==void 0)throw H}buildChildSessionResponse(z,Z,J){return{sessionId:z,...this.buildSessionSetup(J,Z?.permissionMode==="autoEdit"?"auto-edit":Z?.permissionMode),...Z?{_meta:{"blade/taskIsolation":Z.taskIsolation,"blade/taskSourceProjectPath":Z.taskSourceProjectPath,"blade/taskProjectPath":Z.projectPath,...Z.taskModelId?{"blade/taskModelId":Z.taskModelId}:{},...Z.taskRetryAvailable?{"blade/taskRetryAvailable":!0}:{},...Z.taskRetriedFrom?{"blade/taskRetriedFrom":Z.taskRetriedFrom}:{},...Z.taskDelivery?{"blade/taskDelivery":Z.taskDelivery}:{},...Z.taskWorktreeBranch?{"blade/taskWorktreeBranch":Z.taskWorktreeBranch}:{},...Z.taskBaseCommit?{"blade/taskBaseCommit":Z.taskBaseCommit}:{}}}:{}}}assertNotDestroyed(){if(this.destroyed)throw Error("BladeAgent is destroyed")}getRuntimeResidencyStats(){return this.runtimeResidency.getStats()}buildSessionSetup(z,Z="default"){let J=z?.models??[],Y=(z?.currentModelId&&J.some((Q)=>Q.id===z.currentModelId)?z.currentModelId:void 0)??J[0]?.id,H=[{id:"default",name:"Default",description:"Ask for confirmation before all file edits and commands"},{id:"auto-edit",name:"Auto Edit",description:"Auto-approve file edits, ask for shell commands"},{id:"yolo",name:"Full Auto",description:"Auto-approve everything without confirmation"},{id:"plan",name:"Plan Only",description:"Read-only mode, no file changes or commands"}],W=[];if(J.length>0)W.push({type:"select",id:"model",name:"Model",description:"Active language model",category:"model",currentValue:Y,options:J.map((Q)=>({value:Q.id,name:Q.displayName??Q.model,description:`${z?.modelProviders[Q.provider]?.name??Q.provider} · ${Q.model}`}))});if(z?.reasoning)W.push({type:"select",id:"reasoning_effort",name:"Reasoning effort",description:"Session-owned model reasoning intensity",category:"model",currentValue:z.reasoning.selection,options:[{value:"auto",name:"Auto",description:`Resolve near high for this model (currently ${z.reasoning.effective})`},...z.reasoning.supported.map((Q)=>({value:Q,name:Q[0].toUpperCase()+Q.slice(1),description:Q==="off"?"Disable model reasoning":`Use ${Q} reasoning effort`}))]});if(z?.serviceTier)W.push({type:"select",id:"service_tier",name:"Service tier",description:"Session-owned provider latency and pricing tier",category:"model",currentValue:z.serviceTier.selection,options:[{value:"auto",name:"Auto",description:"Use the provider or model default tier"},...z.serviceTier.supported.map((Q)=>({value:Q,name:Q[0].toUpperCase()+Q.slice(1),description:Q==="fast"?"Use the provider priority tier":Q==="flex"?"Use the lower-cost flexible tier":"Use the standard provider tier"}))]});if(z?.responseVerbosity)W.push({type:"select",id:"response_verbosity",name:"Response verbosity",description:"Session-owned model response detail",category:"model",currentValue:z.responseVerbosity.selection,options:[{value:"auto",name:"Auto",description:"Use the provider or model default verbosity"},...z.responseVerbosity.supported.map((Q)=>({value:Q,name:Q[0].toUpperCase()+Q.slice(1),description:`Use ${Q} response verbosity`}))]});if(z?.communicationStyle)W.push({type:"select",id:"communication_style",name:"Communication style",description:"Session-owned tone and explanatory framing",category:"model",currentValue:z.communicationStyle.selection,options:z.communicationStyle.supported.map((Q)=>({value:Q.id,name:Q.name,description:`${Q.description} · ${Q.source}`}))});return{modes:{availableModes:H,currentModeId:Z},configOptions:W.length>0?W:void 0}}async closeSession(z){this.assertNotDestroyed();let J=(this.sessionLoadQueues.get(z.sessionId)??Promise.resolve()).then(()=>this.closeResidentSession(z.sessionId,{discardPendingInput:!0})),Y=J.then(()=>{return},()=>{return});this.sessionLoadQueues.set(z.sessionId,Y);try{await J}finally{if(this.sessionLoadQueues.get(z.sessionId)===Y)this.sessionLoadQueues.delete(z.sessionId)}}async prompt(z){let Z=this.runtimeResidency.acquire(z.sessionId);if(!Z)throw Error(`Session not found: ${z.sessionId}`);try{return await Z.value.prompt(z)}finally{Z.release()}}async cancel(z){_.info(`[BladeAgent] Cancel notification received for session: ${z.sessionId}`);let Z=this.runtimeResidency.acquire(z.sessionId);if(Z){_.info("[BladeAgent] Found session, calling session.cancel()");try{Z.value.cancel()}finally{Z.release()}}else _.warn(`[BladeAgent] Session not found for cancel: ${z.sessionId}`)}async setSessionMode(z){_.info(`[BladeAgent] Setting session mode: ${z.modeId}`);let Z=this.runtimeResidency.acquire(z.sessionId);if(Z)try{await Z.value.setMode(z.modeId)}finally{Z.release()}return{}}async setSessionConfigOption(z){let Z=this.runtimeResidency.acquire(z.sessionId);if(!Z)throw Error(`Session not found: ${z.sessionId}`);try{let J=Z.value;if(z.configId==="model"&&"value"in z&&typeof z.value==="string")_.info(`[BladeAgent] Setting session model: ${z.value}`),await J.setModel(z.value);else if(z.configId==="reasoning_effort"&&"value"in z&&Az(z.value))_.info(`[BladeAgent] Setting reasoning effort: ${z.value}`),await J.setReasoningEffort(z.value);else if(z.configId==="service_tier"&&"value"in z&&Vz(z.value))_.info(`[BladeAgent] Setting service tier: ${z.value}`),await J.setServiceTier(z.value);else if(z.configId==="response_verbosity"&&"value"in z&&Uz(z.value))_.info(`[BladeAgent] Setting response verbosity: ${z.value}`),await J.setResponseVerbosity(z.value);else if(z.configId==="communication_style"&&"value"in z&&Rz(z.value))_.info(`[BladeAgent] Setting communication style: ${z.value}`),await J.setCommunicationStyle(z.value);else throw Error(`Invalid session config option: ${z.configId}`);return{configOptions:this.buildSessionSetup(J.getModelConfiguration(),J.getMode()).configOptions??[]}}finally{Z.release()}}destroy(){if(this.destroyPromise)return this.destroyPromise;return this.destroyPromise=this.destroyOwnedResources(),this.destroyPromise}async destroyOwnedResources(){this.destroyed=!0,await Promise.all([...this.sessionLoadQueues.values()]),this.sessionLoadQueues.clear();let z;for(let Z of[...this.sessions.keys()])try{await this.closeResidentSession(Z)}catch(J){z??=J}try{await this.runtimeResidency.disposeAll()}catch(Z){z??=Z}this.sessions.clear();try{await qz.getInstance().disconnectAll()}catch(Z){z??=Z}if(z!==void 0)throw z}}async function hJ(){let z=gz.toWeb(process.stdout),Z=uz.toWeb(process.stdin),J=b.ndJsonStream(z,Z),Y,H=new b.AgentSideConnection((Q)=>{return Y=new C(Q),Y},J),W=Ez(async()=>{await Y?.destroy()});try{await H.closed}finally{W(),await Y?.destroy()}}export{hJ as runAcpIntegration};
|
package/dist/chunk-cx5s0rf3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{f as a,g as i,h as l,i as m}from"./chunk-4aam3qhk.js";import"./chunk-ypgjqg23.js";import"./chunk-b2p4kd07.js";import"./chunk-smjkx71w.js";import"./chunk-w2gr97qt.js";import"./chunk-d2vrbbvd.js";import"./chunk-0kmrvxsz.js";import"./chunk-83b4vfjs.js";import"./chunk-wepvrnmh.js";import"./chunk-wkpacysr.js";import"./chunk-th4jjfgm.js";import"./chunk-1z9k5dmz.js";import"./chunk-0wxkymqv.js";import"./chunk-f7yfcw8s.js";import{qd as n}from"./chunk-728anavt.js";import"./chunk-bjqjdw34.js";import{Md as s}from"./chunk-p9vaaayr.js";import"./chunk-v508x7cg.js";import"./chunk-0j22w4wh.js";import"./chunk-q919ypcz.js";import"./chunk-4md4sd4j.js";import"./chunk-yn51162x.js";import"./chunk-832va1mp.js";import"./chunk-wahhwjp9.js";import"./chunk-hat9v5c5.js";import"./chunk-cdy9efgm.js";import"./chunk-zvz2cnt4.js";import"./chunk-qm5c9wew.js";import"./chunk-m57w4p91.js";import"./chunk-b39p4f5r.js";import"./chunk-h0ft81a3.js";import"./chunk-v0rsz1rt.js";import"./chunk-xz6y0w4n.js";import"./chunk-k0pa8874.js";import"./chunk-6pyktfa4.js";import"./chunk-d808m826.js";import"./chunk-0p0e70cy.js";import"./chunk-t8xmh4w2.js";import"./chunk-y9d9nqnn.js";import"./chunk-wj6t3tv2.js";import"./chunk-jrr361h1.js";import"./chunk-8wea3qty.js";import"./chunk-k6shq7rk.js";import v from"chalk";var C={command:"serve",describe:"Start a headless Blade server (no browser)",builder:a,handler:async(p)=>{let r=i(p);if(await s(),!process.env.BLADE_SERVER_PASSWORD)console.log(v.yellow("Warning: BLADE_SERVER_PASSWORD is not set; server is unsecured."));let e=await m.listenAsync(r);if(console.log(`Blade server listening on http://${e.hostname}:${e.port}`),r.hostname==="0.0.0.0"){let o=l();for(let g of o)console.log(` Network: http://${g}:${e.port}`)}let t,c=new Promise((o)=>{t=o}),d=n(async()=>{await e.stop(),t()});try{await c}finally{d(),await e.stop()}}};export{C as serveCommand};
|
package/dist/chunk-e3asq942.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ke as a,le as b,me as c}from"./chunk-832va1mp.js";import"./chunk-b39p4f5r.js";import"./chunk-h0ft81a3.js";import"./chunk-v0rsz1rt.js";import"./chunk-xz6y0w4n.js";import"./chunk-k0pa8874.js";import"./chunk-6pyktfa4.js";import"./chunk-d808m826.js";import"./chunk-0p0e70cy.js";import"./chunk-t8xmh4w2.js";import"./chunk-y9d9nqnn.js";import"./chunk-wj6t3tv2.js";import"./chunk-jrr361h1.js";import"./chunk-8wea3qty.js";import"./chunk-k6shq7rk.js";export{c as snapshotWorkspaceModelResources,b as resolveWorkspaceModelResources,a as cloneWorkspaceModelConfig};
|