@opencode/core 2.2.0 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account/sql.js +1 -1
- package/dist/agent.js +91 -87
- package/dist/aisdk-native.js +101 -97
- package/dist/aisdk.js +107 -103
- package/dist/app.js +7 -7
- package/dist/bus.js +83 -79
- package/dist/chunks/{tool-vmx0pqdh.js → session-014m13nx.js} +16 -16
- package/dist/chunks/{tool-034tev2y.js → session-034tev2y.js} +2 -2
- package/dist/chunks/{tool-nyw2x12k.js → session-04e5fydp.js} +1 -1
- package/dist/chunks/{tool-b7286km2.js → session-0b3avwgb.js} +6 -6
- package/dist/chunks/{tool-st7p3hwb.js → session-0h3385jp.js} +3 -2
- package/dist/chunks/{tool-7467kx48.js → session-0jkhv5fd.js} +34 -34
- package/dist/chunks/{tool-xhrs65th.js → session-0k31egm0.js} +6 -6
- package/dist/chunks/{tool-r2z94j39.js → session-0n8a0ffz.js} +6 -6
- package/dist/chunks/{tool-wz464gjx.js → session-0rn5673z.js} +8 -8
- package/dist/chunks/session-0s6ncdyq.js +26 -0
- package/dist/chunks/{tool-r850md5t.js → session-0xedkqrk.js} +17 -17
- package/dist/chunks/{tool-jhz9911s.js → session-0yyf9pa6.js} +12 -12
- package/dist/chunks/{tool-nvxqht09.js → session-107zh63q.js} +3 -3
- package/dist/chunks/{tool-s6jj6eh0.js → session-1347qshx.js} +14 -17
- package/dist/chunks/{tool-sbj9xhv5.js → session-14bt511q.js} +66 -27
- package/dist/chunks/{tool-nh9ma6fe.js → session-1a21k8vn.js} +11 -11
- package/dist/chunks/{tool-y420wvgt.js → session-1c1q46gq.js} +41 -41
- package/dist/chunks/{tool-1ep2p91f.js → session-1ep2p91f.js} +2 -2
- package/dist/chunks/session-1g08w5qk.js +565 -0
- package/dist/chunks/{tool-p56gnsnx.js → session-1ga2wj5n.js} +17 -17
- package/dist/chunks/session-1kah00gy.js +13 -0
- package/dist/chunks/{tool-xt0z8zst.js → session-1kn6jdkn.js} +4 -4
- package/dist/chunks/{tool-xqxzn5yn.js → session-1m6jkbyv.js} +14 -14
- package/dist/chunks/{tool-5dme8x4x.js → session-1p2sk048.js} +11 -11
- package/dist/chunks/{tool-1x2knyw4.js → session-1x2knyw4.js} +1 -1
- package/dist/chunks/{tool-204s3925.js → session-204s3925.js} +1 -1
- package/dist/chunks/{tool-4jw80zew.js → session-214k5kca.js} +80 -80
- package/dist/chunks/session-25h84942.js +17 -0
- package/dist/chunks/{tool-kh9rt25c.js → session-29e51n1b.js} +9 -9
- package/dist/chunks/{tool-vvqzd10p.js → session-2bg8s655.js} +40 -40
- package/dist/chunks/{tool-rzh929cz.js → session-2ekes0ek.js} +10 -10
- package/dist/chunks/{tool-5fgj30xe.js → session-2fxvvp3e.js} +30 -30
- package/dist/chunks/{tool-9q8g9sv8.js → session-2kg89srt.js} +4 -4
- package/dist/chunks/session-2tfsq0e5.js +222 -0
- package/dist/chunks/{tool-rr19gkj4.js → session-2vpr0s80.js} +7 -7
- package/dist/chunks/{tool-vb80j1wh.js → session-2zp5a6yg.js} +3 -3
- package/dist/chunks/{tool-twcztz12.js → session-306wmwj5.js} +45 -80
- package/dist/chunks/{tool-mvzrjhep.js → session-3d1dxbz0.js} +12 -6
- package/dist/chunks/{tool-zdkwz0rs.js → session-3fm477c7.js} +3 -3
- package/dist/chunks/{tool-3hepkmqq.js → session-3hepkmqq.js} +1 -1
- package/dist/chunks/{tool-3nnrz6f6.js → session-3nnrz6f6.js} +1 -1
- package/dist/chunks/{tool-ewr5k9wg.js → session-3ntfh06s.js} +8 -8
- package/dist/chunks/{tool-qcsk8x8g.js → session-3z1690bs.js} +48 -51
- package/dist/chunks/{tool-w2eysc6j.js → session-40za9wsf.js} +9 -9
- package/dist/chunks/{tool-d3qmtx3n.js → session-42qtrm15.js} +22 -22
- package/dist/chunks/{tool-8feq5yxx.js → session-4bev3xhy.js} +18 -18
- package/dist/chunks/{tool-hs9cwcgs.js → session-4cyw8nx1.js} +30 -30
- package/dist/chunks/{tool-gtqjgkpw.js → session-4p4bzch3.js} +3 -3
- package/dist/chunks/{tool-4pyp9zr9.js → session-4pyp9zr9.js} +1 -1
- package/dist/chunks/{tool-4v008n1t.js → session-4v008n1t.js} +1 -1
- package/dist/chunks/{tool-w08h028t.js → session-4w3brme9.js} +9 -9
- package/dist/chunks/{tool-78kz22ny.js → session-4x23c0v6.js} +23 -23
- package/dist/chunks/{tool-h8wtbm19.js → session-511h5e8a.js} +46 -46
- package/dist/chunks/{tool-rgmk1r1t.js → session-5ac4cxmk.js} +10 -10
- package/dist/chunks/{tool-1qb2fn2e.js → session-5aytyrt3.js} +11 -11
- package/dist/chunks/{tool-5m9w47nd.js → session-5m9w47nd.js} +1 -1
- package/dist/chunks/{tool-kzvqqj4g.js → session-5q32avkb.js} +21 -21
- package/dist/chunks/{tool-6h9hqrxp.js → session-5sh8dy76.js} +21 -21
- package/dist/chunks/{tool-752zwhsj.js → session-5svmm7fm.js} +16 -5
- package/dist/chunks/{tool-d893c1qn.js → session-5v99ekdb.js} +19 -19
- package/dist/chunks/{tool-sc5azq8x.js → session-5w1z1d8q.js} +47 -47
- package/dist/chunks/{tool-bk7xq8bh.js → session-6cahmqzr.js} +8 -8
- package/dist/chunks/{tool-6esdw8yj.js → session-6esdw8yj.js} +1 -1
- package/dist/chunks/{tool-n0w6tq5t.js → session-6hy9r9dj.js} +8 -8
- package/dist/chunks/{tool-f449218g.js → session-6hybw9g3.js} +5 -5
- package/dist/chunks/{tool-tt79p4vp.js → session-6k3pn0ym.js} +21 -21
- package/dist/chunks/{tool-ge4qdnbb.js → session-6kff7ze5.js} +19 -19
- package/dist/chunks/{tool-8jkecmvj.js → session-6kj7g8xp.js} +27 -27
- package/dist/chunks/{tool-7tjh76vn.js → session-6kxp06hb.js} +7 -7
- package/dist/chunks/{tool-6mmkz41v.js → session-6zwd6715.js} +16 -16
- package/dist/chunks/{tool-67cvb3ht.js → session-74sxx59s.js} +9 -9
- package/dist/chunks/{tool-76cb1hcw.js → session-76cb1hcw.js} +1 -1
- package/dist/chunks/{tool-7bmhse3q.js → session-7bmhse3q.js} +1 -1
- package/dist/chunks/{tool-2jrrfqe1.js → session-7sdtxe0n.js} +4 -4
- package/dist/chunks/{tool-1jakw16s.js → session-7stb81gk.js} +2 -1
- package/dist/chunks/{tool-4t7jqkaw.js → session-7svxnz6h.js} +12 -12
- package/dist/chunks/{tool-cwq9059v.js → session-7tt92bnf.js} +23 -23
- package/dist/chunks/{tool-7w2ypzdf.js → session-7w2ypzdf.js} +1 -1
- package/dist/chunks/{tool-agmw1zcy.js → session-83bdf6kd.js} +60 -60
- package/dist/chunks/{tool-780q7vq9.js → session-83y1ztr9.js} +5 -5
- package/dist/chunks/{tool-nfk1y8jw.js → session-84041qcw.js} +28 -28
- package/dist/chunks/{tool-7hsh0za6.js → session-8gej5d5g.js} +44 -49
- package/dist/chunks/{tool-11hfp36g.js → session-8jztxfpf.js} +4 -4
- package/dist/chunks/{tool-3f13jy3s.js → session-8p2jpvs0.js} +37 -25
- package/dist/chunks/{tool-gjasn01h.js → session-8wqqaqzt.js} +4 -4
- package/dist/chunks/{tool-8wtp7s3z.js → session-8wtp7s3z.js} +1 -1
- package/dist/chunks/{tool-90zstvax.js → session-90zstvax.js} +1 -1
- package/dist/chunks/{tool-bgs9y14h.js → session-994b2pxg.js} +5 -5
- package/dist/chunks/{tool-1vpe07px.js → session-99awmhkb.js} +84 -27
- package/dist/chunks/{tool-9f3sjfep.js → session-9f3sjfep.js} +2 -2
- package/dist/chunks/{tool-pfnzsr07.js → session-9y9v7zvr.js} +34 -34
- package/dist/chunks/{tool-3nr2yc9a.js → session-a1vq38jw.js} +5 -5
- package/dist/chunks/{tool-zyqv3h6k.js → session-a3r0se63.js} +5 -5
- package/dist/chunks/{tool-f68rfrfr.js → session-a4zme8rz.js} +30 -29
- package/dist/chunks/{tool-1px95g66.js → session-afm1mqfd.js} +11 -11
- package/dist/chunks/{tool-rbhebfmq.js → session-ajs99hkw.js} +12 -12
- package/dist/chunks/{tool-39j6yt37.js → session-apc99ahs.js} +29 -21
- package/dist/chunks/{tool-v6njdshh.js → session-aq8fvkrh.js} +18 -18
- package/dist/chunks/{tool-8wc2fpae.js → session-avgzkss2.js} +5 -5
- package/dist/chunks/{tool-ayjs7tqn.js → session-ayjs7tqn.js} +2 -2
- package/dist/chunks/{tool-jszqqvxf.js → session-b3vf0bc4.js} +9 -9
- package/dist/chunks/{tool-r023m38x.js → session-b5z3fqjc.js} +18 -12
- package/dist/chunks/{tool-b6vsg801.js → session-b6vsg801.js} +2 -2
- package/dist/chunks/{tool-8d9gtfa7.js → session-ba56jx13.js} +47 -47
- package/dist/chunks/session-btnkw9ag.js +410 -0
- package/dist/chunks/{tool-j3xa31ke.js → session-c0j43jcq.js} +17 -17
- package/dist/chunks/{tool-0ahs07zn.js → session-c6x7d2ts.js} +4 -4
- package/dist/chunks/{tool-j04c4e1z.js → session-cbvv2732.js} +57 -28
- package/dist/chunks/{tool-9taxa3wa.js → session-cf4j1xxh.js} +11 -11
- package/dist/chunks/{tool-spqj5yby.js → session-cp0d67wz.js} +23 -23
- package/dist/chunks/{tool-nq0efya9.js → session-csjqfz54.js} +7 -7
- package/dist/chunks/{tool-cwrgdav8.js → session-cwrgdav8.js} +2 -2
- package/dist/chunks/{tool-ayv543vf.js → session-cxzp2bsp.js} +16 -16
- package/dist/chunks/{tool-k66e5v3s.js → session-d0zcdp69.js} +10 -10
- package/dist/chunks/{tool-ssfehs1z.js → session-d2887f8n.js} +4 -4
- package/dist/chunks/{tool-d4v9tmah.js → session-d4v9tmah.js} +2 -2
- package/dist/chunks/session-d77dj7jw.js +18 -0
- package/dist/chunks/{tool-5887ft1y.js → session-d7htzk6m.js} +9 -9
- package/dist/chunks/{tool-bavxd7np.js → session-ddp1c6wr.js} +18 -18
- package/dist/chunks/{tool-7mwfr1ya.js → session-dh8t6pa0.js} +12 -12
- package/dist/chunks/{tool-edkh5za3.js → session-dp6am7n6.js} +2 -2
- package/dist/chunks/{tool-dt77769w.js → session-dt77769w.js} +1 -1
- package/dist/chunks/{tool-0t332zg2.js → session-dwpz7zn0.js} +6 -6
- package/dist/chunks/{tool-ycd18cxa.js → session-e2e8g6me.js} +11 -11
- package/dist/chunks/{tool-6jehphsq.js → session-e3me9f8n.js} +38 -38
- package/dist/chunks/{tool-e834z07m.js → session-e834z07m.js} +1 -1
- package/dist/chunks/{tool-dajrwvna.js → session-ean2d8b5.js} +1 -1
- package/dist/chunks/{tool-8e0gbf5j.js → session-epet3xcy.js} +33 -33
- package/dist/chunks/{tool-d9hg8633.js → session-eq0bj8vr.js} +12 -12
- package/dist/chunks/{tool-6adqbtbr.js → session-et8sht6e.js} +33 -33
- package/dist/chunks/{tool-2xw2f3vf.js → session-evmcva0v.js} +11 -11
- package/dist/chunks/{tool-xpx0z35b.js → session-ewzp24hx.js} +16 -16
- package/dist/chunks/{tool-9t5cp16p.js → session-f1bbj6f0.js} +26 -15
- package/dist/chunks/{tool-ymky0t0b.js → session-f3t0m2cs.js} +5 -5
- package/dist/chunks/{tool-f8jj8vg7.js → session-f4177rbw.js} +10 -10
- package/dist/chunks/{tool-7gm95e0b.js → session-f52hekk8.js} +6 -6
- package/dist/chunks/{tool-fffv3p7h.js → session-fffv3p7h.js} +1 -1
- package/dist/chunks/{tool-nn3qjkhj.js → session-fg8bmn5r.js} +21 -21
- package/dist/chunks/{tool-prq7xxp2.js → session-fg9p65nk.js} +6 -6
- package/dist/chunks/{tool-9e6q8a6s.js → session-fydb03qw.js} +13 -13
- package/dist/chunks/{tool-wr3re1en.js → session-fznmdakp.js} +4 -4
- package/dist/chunks/{tool-4pw98qd4.js → session-g1e2r5aa.js} +4 -4
- package/dist/chunks/{tool-dwxkhmt2.js → session-g3p0pw3f.js} +25 -25
- package/dist/chunks/{tool-hy05jz59.js → session-g5y8y9ka.js} +4 -4
- package/dist/chunks/session-gc07wgt0.js +196 -0
- package/dist/chunks/{tool-pbbktnbz.js → session-gd8sx287.js} +4 -4
- package/dist/chunks/{tool-6rfxa98r.js → session-gk8m8gwv.js} +33 -33
- package/dist/chunks/{tool-pbwrhxm9.js → session-gvfwbdg5.js} +20 -20
- package/dist/chunks/{tool-yytcp89d.js → session-gvj3fga6.js} +28 -28
- package/dist/chunks/{tool-qakjdagf.js → session-gyka3hze.js} +21 -21
- package/dist/chunks/{tool-dtfj6qhp.js → session-h45rwca9.js} +96 -94
- package/dist/chunks/{tool-rjf5h5f7.js → session-h57hnx26.js} +8 -8
- package/dist/chunks/{tool-nfq3amnp.js → session-h7rsa5h4.js} +29 -29
- package/dist/chunks/{tool-6wz31r82.js → session-hc4wny2n.js} +11 -11
- package/dist/chunks/session-hfmn2zba.js +34 -0
- package/dist/chunks/{tool-r0yr0wbs.js → session-hh7kjqtw.js} +2 -1
- package/dist/chunks/{tool-c1y12bqd.js → session-hht3wrh4.js} +12 -12
- package/dist/chunks/{tool-ks473cwm.js → session-hj48n5g3.js} +21 -21
- package/dist/chunks/{tool-pnwsrq7c.js → session-hjnjc3ts.js} +5 -5
- package/dist/chunks/{tool-dvbyh3pq.js → session-hjpa6ehn.js} +22 -22
- package/dist/chunks/{tool-c065g2ca.js → session-hjvvwd9m.js} +71 -55
- package/dist/chunks/{tool-j56qcejd.js → session-hm2g1pam.js} +335 -317
- package/dist/chunks/{tool-hpg1pkwy.js → session-hpg1pkwy.js} +1 -1
- package/dist/chunks/{tool-xw4ev616.js → session-hqqbfxm4.js} +22 -22
- package/dist/chunks/{tool-vacfhfey.js → session-hvktc1vq.js} +7 -7
- package/dist/chunks/{tool-ra6js1h8.js → session-hy8c1z76.js} +8 -8
- package/dist/chunks/{tool-r8dwygj6.js → session-j3v6xgsf.js} +87 -56
- package/dist/chunks/{tool-7harcha2.js → session-j6pgq882.js} +5 -5
- package/dist/chunks/{tool-pckyv4f2.js → session-jcjsjw6m.js} +28 -28
- package/dist/chunks/{tool-jz5b6eqf.js → session-jcnk5dbh.js} +23 -23
- package/dist/chunks/{tool-jfaecv01.js → session-jfaecv01.js} +1 -1
- package/dist/chunks/{tool-sws77t7f.js → session-jhdr5shj.js} +11 -11
- package/dist/chunks/{tool-yzaa036j.js → session-jrzhkn60.js} +28 -28
- package/dist/chunks/{tool-02nh8ewm.js → session-js3ekr85.js} +13 -13
- package/dist/chunks/{tool-jtnps1zs.js → session-jtnps1zs.js} +2 -2
- package/dist/chunks/{tool-28pnz6dy.js → session-jw3xc4w3.js} +30 -42
- package/dist/chunks/{tool-5858b97a.js → session-k7fyma4a.js} +12 -12
- package/dist/chunks/{tool-k814nvkf.js → session-k814nvkf.js} +1 -1
- package/dist/chunks/{tool-e07q2w5p.js → session-k9zkdd2y.js} +4 -4
- package/dist/chunks/{tool-ds82yrjj.js → session-kb90rkdq.js} +22 -22
- package/dist/chunks/{tool-cnga39w3.js → session-kmshagc5.js} +17 -17
- package/dist/chunks/{tool-47cq5kqw.js → session-kr5yk018.js} +2 -2
- package/dist/chunks/{tool-1dvrssaw.js → session-krdv82ye.js} +4 -4
- package/dist/chunks/{tool-kt3bjfbg.js → session-kt3bjfbg.js} +1 -1
- package/dist/chunks/{tool-q63v4kjv.js → session-kxbt2msb.js} +14 -14
- package/dist/chunks/{tool-yqveydy6.js → session-ky596kc3.js} +4 -4
- package/dist/chunks/{tool-m1714858.js → session-m1714858.js} +1 -1
- package/dist/chunks/{tool-0a2sm9cp.js → session-m6br695y.js} +11 -11
- package/dist/chunks/{tool-m9w0rfyh.js → session-m9w0rfyh.js} +1 -1
- package/dist/chunks/{tool-gg8p9cgs.js → session-mb7mbhnz.js} +17 -4
- package/dist/chunks/{tool-zgkm4kzm.js → session-mg356nz4.js} +9 -5
- package/dist/chunks/{tool-q2z4k2x9.js → session-mjzr7bcb.js} +15 -15
- package/dist/chunks/{tool-xasx590j.js → session-mwqmxszj.js} +9 -9
- package/dist/chunks/{tool-12cx84te.js → session-mz14xksf.js} +33 -33
- package/dist/chunks/session-mzx60t1x.js +336 -0
- package/dist/chunks/{tool-4zsrmah6.js → session-n05pjf0z.js} +44 -44
- package/dist/chunks/{tool-g3b4788n.js → session-n5f56dyg.js} +31 -31
- package/dist/chunks/{tool-3t4066nw.js → session-n5szpsx2.js} +17 -17
- package/dist/chunks/{tool-8cvc109z.js → session-n9f4a7bt.js} +22 -22
- package/dist/chunks/{tool-770pw0s1.js → session-nah043kf.js} +4 -4
- package/dist/chunks/{tool-18s0c7mk.js → session-ng70ej78.js} +10 -10
- package/dist/chunks/session-nh4v3znn.js +36 -0
- package/dist/chunks/{tool-sw5vdw2h.js → session-nma643tt.js} +7 -7
- package/dist/chunks/{tool-e4vy1v26.js → session-nqmf97tx.js} +31 -31
- package/dist/chunks/{tool-5wtqv2es.js → session-ntqvm2fg.js} +5 -5
- package/dist/chunks/{tool-41sh1bbt.js → session-nz2ac0f6.js} +6 -8
- package/dist/chunks/{tool-p015t6z3.js → session-p015t6z3.js} +2 -2
- package/dist/chunks/{tool-nfga29bv.js → session-p58rp8mt.js} +27 -27
- package/dist/chunks/{tool-p7vhpwh8.js → session-p7vhpwh8.js} +1 -1
- package/dist/chunks/{tool-f1kzydc9.js → session-p916h210.js} +25 -25
- package/dist/chunks/{tool-30wtetgq.js → session-pcve4y50.js} +48 -48
- package/dist/chunks/{tool-zw3yjf62.js → session-pfhvw22f.js} +13 -13
- package/dist/chunks/{tool-vvj7j8xf.js → session-pj80she1.js} +3 -3
- package/dist/chunks/{tool-pknna89w.js → session-pknna89w.js} +1 -1
- package/dist/chunks/{tool-g2pxrbdf.js → session-prh1gakp.js} +106 -75
- package/dist/chunks/session-prveawz9.js +257 -0
- package/dist/chunks/{tool-h0ya90rh.js → session-py1kgbbs.js} +9 -9
- package/dist/chunks/{tool-yqsmg75a.js → session-qg5z9cfk.js} +46 -41
- package/dist/chunks/{tool-5n6snyjt.js → session-qn0q7ss9.js} +47 -37
- package/dist/chunks/{tool-qp7r0hxv.js → session-qp7r0hxv.js} +1 -1
- package/dist/chunks/session-qqvy8y24.js +45 -0
- package/dist/chunks/{tool-yxjvbhxs.js → session-qtbtp5y4.js} +4 -4
- package/dist/chunks/{tool-kcw9vyak.js → session-qvfyc67n.js} +14 -14
- package/dist/chunks/{tool-8rk0v0nw.js → session-r0543gnn.js} +50 -47
- package/dist/chunks/{tool-5k0vn9gs.js → session-r4pw3xq2.js} +10 -5
- package/dist/chunks/{tool-r542h3bh.js → session-r542h3bh.js} +1 -1
- package/dist/chunks/{tool-rb9dy4dg.js → session-rb9dy4dg.js} +1 -1
- package/dist/chunks/{tool-mrzap57y.js → session-rbc1s8g1.js} +32 -16
- package/dist/chunks/{tool-39tkfg3g.js → session-rd86k9nx.js} +9 -9
- package/dist/chunks/{tool-6twykydk.js → session-rjnacbrz.js} +9 -9
- package/dist/chunks/{tool-0fhbvqtr.js → session-rkc457kn.js} +9 -9
- package/dist/chunks/{tool-rt5dr6hb.js → session-rt5dr6hb.js} +1 -1
- package/dist/chunks/{tool-9nkjg9qd.js → session-rwvswa9y.js} +6 -6
- package/dist/chunks/{tool-sa3fpqfw.js → session-sa3fpqfw.js} +2 -2
- package/dist/chunks/{tool-pvzzwdfq.js → session-sj8cf4xn.js} +18 -18
- package/dist/chunks/{tool-3k7t0q4z.js → session-skhfmn6d.js} +31 -22
- package/dist/chunks/{tool-sqjzf8x2.js → session-sqjzf8x2.js} +1 -1
- package/dist/chunks/{tool-4m86bj6y.js → session-stkk57rt.js} +45 -0
- package/dist/chunks/{tool-svcy3p9a.js → session-svcy3p9a.js} +1 -1
- package/dist/chunks/session-t03h4f5z.js +16 -0
- package/dist/chunks/{tool-tczq8hjw.js → session-tczq8hjw.js} +1 -1
- package/dist/chunks/{tool-v91xp2c8.js → session-teh5t5jp.js} +11 -11
- package/dist/chunks/{tool-3jy1f5rc.js → session-tf0cgyr6.js} +44 -44
- package/dist/chunks/{tool-qhfm6m5r.js → session-tg9kr0y0.js} +11 -11
- package/dist/chunks/{tool-8t8mrqrh.js → session-tj6nb54t.js} +6 -6
- package/dist/chunks/{tool-pjtyf8t7.js → session-tjand230.js} +9 -9
- package/dist/chunks/{tool-nz89qvcx.js → session-tkfkfkf0.js} +28 -28
- package/dist/chunks/{tool-gn0hevf2.js → session-tkgn6n4e.js} +28 -28
- package/dist/chunks/{tool-pfstxkm2.js → session-tp4q3xqc.js} +14 -6
- package/dist/chunks/{tool-p84syj9g.js → session-ts17rpp3.js} +34 -34
- package/dist/chunks/{tool-twssxy5n.js → session-twssxy5n.js} +2 -2
- package/dist/chunks/session-ty7weeps.js +28 -0
- package/dist/chunks/{tool-cnh9xgcw.js → session-v1mxzh7z.js} +34 -34
- package/dist/chunks/{tool-4czcg6bs.js → session-v27eh5cj.js} +25 -17
- package/dist/chunks/{tool-v2r1d0zg.js → session-v2r1d0zg.js} +1 -1
- package/dist/chunks/{tool-y5kjjy07.js → session-v35fmwg5.js} +30 -30
- package/dist/chunks/{tool-vycsk1c7.js → session-v8vd993n.js} +8 -8
- package/dist/chunks/{tool-vsqvcqta.js → session-vaq1yek0.js} +6 -6
- package/dist/chunks/{tool-88degkwg.js → session-vp9b3xr6.js} +53 -19
- package/dist/chunks/{tool-3ewwa9eq.js → session-vre2328q.js} +26 -26
- package/dist/chunks/{tool-19y1mz66.js → session-vyevn7ez.js} +5 -5
- package/dist/chunks/{tool-012mq190.js → session-w1g6eztn.js} +38 -38
- package/dist/chunks/{tool-w3wsvvr9.js → session-w3wsvvr9.js} +1 -1
- package/dist/chunks/{tool-798y36pp.js → session-w8cbkq7x.js} +14 -16
- package/dist/chunks/{tool-wakvkjy4.js → session-wakvkjy4.js} +1 -1
- package/dist/chunks/{tool-wd87259q.js → session-wd87259q.js} +1 -1
- package/dist/chunks/session-wegkxhrn.js +37 -0
- package/dist/chunks/{tool-s9zns2yk.js → session-wgy4vw39.js} +12 -12
- package/dist/chunks/{tool-wnhgecwx.js → session-wnhgecwx.js} +1 -1
- package/dist/chunks/{tool-r9zrswe1.js → session-wrd39zd3.js} +9 -9
- package/dist/chunks/{tool-6qtsf31h.js → session-wtem00hm.js} +5 -5
- package/dist/chunks/{tool-2nkqvy4a.js → session-wvphax15.js} +31 -31
- package/dist/chunks/{tool-hdfrs5mg.js → session-wwgpyqzb.js} +9 -9
- package/dist/chunks/{tool-a35byqw0.js → session-wzytqp0z.js} +27 -27
- package/dist/chunks/{tool-27c23e33.js → session-x15zq3xe.js} +15 -15
- package/dist/chunks/{tool-r0yvbzfa.js → session-x78h82an.js} +41 -41
- package/dist/chunks/{tool-mpvgefqy.js → session-x7sfbxcq.js} +4 -4
- package/dist/chunks/{tool-w9z9y32t.js → session-x968pprt.js} +19 -19
- package/dist/chunks/{tool-bstexjd6.js → session-xd9cc171.js} +5 -5
- package/dist/chunks/{tool-61ennm6n.js → session-xk2zn0cv.js} +6 -6
- package/dist/chunks/{tool-8y4jps98.js → session-xnh55p1t.js} +7 -7
- package/dist/chunks/{tool-c347jtgq.js → session-xq6kn9sb.js} +25 -25
- package/dist/chunks/{tool-m89ew3ks.js → session-xvk346a2.js} +29 -29
- package/dist/chunks/{tool-jsqg4353.js → session-y5qd0fdx.js} +8 -8
- package/dist/chunks/{tool-yara3q77.js → session-yara3q77.js} +2 -2
- package/dist/chunks/{tool-yb20nhc3.js → session-yb20nhc3.js} +1 -1
- package/dist/chunks/{tool-y7287ygs.js → session-ycbkkxa6.js} +6 -6
- package/dist/chunks/{tool-94as0g8p.js → session-yg4xtd5c.js} +24 -24
- package/dist/chunks/{tool-rvy8xhsv.js → session-yk92hh7b.js} +31 -31
- package/dist/chunks/session-ymz7p2c9.js +31 -0
- package/dist/chunks/{tool-2qgpse07.js → session-yne29hzv.js} +16 -16
- package/dist/chunks/{tool-x75vegnr.js → session-ynx6mseh.js} +11 -11
- package/dist/chunks/{tool-09bv4atg.js → session-yt5wjcy6.js} +5 -5
- package/dist/chunks/{tool-sa46y2cf.js → session-yv82jfb9.js} +20 -20
- package/dist/chunks/{tool-14kcwm24.js → session-yvdwn3rt.js} +16 -16
- package/dist/chunks/{tool-b08y6na7.js → session-yxtp6v20.js} +2 -2
- package/dist/chunks/{tool-1b236rmr.js → session-yy77v243.js} +199 -199
- package/dist/chunks/{tool-maq43m3m.js → session-z1gzwszr.js} +10 -10
- package/dist/chunks/{tool-z38nccrw.js → session-z38nccrw.js} +1 -1
- package/dist/chunks/{tool-ks0qaf84.js → session-z9dbc4cd.js} +23 -23
- package/dist/chunks/{tool-2esqe60t.js → session-zqzhvas5.js} +12 -12
- package/dist/codemode/catalog.js +1 -1
- package/dist/codemode/instructions.js +7 -7
- package/dist/codemode/tool.js +3 -3
- package/dist/codemode/web.js +1 -1
- package/dist/command.js +93 -89
- package/dist/config/discovery.js +94 -90
- package/dist/config/integration.js +3 -3
- package/dist/config/markdown.js +1 -1
- package/dist/config/normalize.js +111 -107
- package/dist/config/plugin/agent.js +127 -123
- package/dist/config/plugin/command.js +225 -221
- package/dist/config/plugin/compaction.js +166 -162
- package/dist/config/plugin/compatibility.js +146 -142
- package/dist/config/plugin/entry-observer.js +1 -1
- package/dist/config/plugin/formatter.js +126 -122
- package/dist/config/plugin/image.js +125 -121
- package/dist/config/plugin/instruction.js +125 -121
- package/dist/config/plugin/location-watcher.js +125 -121
- package/dist/config/plugin/mcp.js +134 -130
- package/dist/config/plugin/policy.js +127 -123
- package/dist/config/plugin/provider.js +126 -122
- package/dist/config/plugin/reference.js +125 -121
- package/dist/config/plugin/shell.js +127 -123
- package/dist/config/plugin/skill-file.js +142 -138
- package/dist/config/plugin/skill-scan.js +3 -3
- package/dist/config/plugin/skill.js +147 -143
- package/dist/config/plugin/snapshot.js +125 -121
- package/dist/config/plugin/source.js +128 -124
- package/dist/config/plugin/tool-output.js +126 -122
- package/dist/config/plugin/websearch.js +126 -122
- package/dist/config/plugin/worktree.js +125 -121
- package/dist/config/variable.js +1 -1
- package/dist/config/watch.js +1 -1
- package/dist/config.js +126 -122
- package/dist/console-access.js +1 -1
- package/dist/credential/sql.js +2 -2
- package/dist/credential.js +93 -89
- package/dist/database/database.js +78 -74
- package/dist/database/drizzle/effect-sqlite/driver.js +14 -14
- package/dist/database/drizzle/effect-sqlite/index.js +14 -14
- package/dist/database/drizzle/effect-sqlite/session.js +11 -11
- package/dist/database/drizzle/index.js +15 -15
- package/dist/database/drizzle/internal/drizzle-utils.js +1 -1
- package/dist/database/drizzle/sqlite-core/effect/count.js +1 -1
- package/dist/database/drizzle/sqlite-core/effect/db.js +9 -9
- package/dist/database/drizzle/sqlite-core/effect/delete.js +2 -2
- package/dist/database/drizzle/sqlite-core/effect/index.js +10 -10
- package/dist/database/drizzle/sqlite-core/effect/insert.js +2 -2
- package/dist/database/drizzle/sqlite-core/effect/query.js +1 -1
- package/dist/database/drizzle/sqlite-core/effect/raw.js +1 -1
- package/dist/database/drizzle/sqlite-core/effect/select.js +2 -2
- package/dist/database/drizzle/sqlite-core/effect/session.js +10 -10
- package/dist/database/drizzle/sqlite-core/effect/update.js +2 -2
- package/dist/database/drizzle.js +16 -16
- package/dist/database/migration/20260127222353_familiar_lady_ursula.js +1 -1
- package/dist/database/migration/20260211171708_add_project_commands.js +1 -1
- package/dist/database/migration/20260213144116_wakeful_the_professor.js +1 -1
- package/dist/database/migration/20260225215848_workspace.js +1 -1
- package/dist/database/migration/20260227213759_add_session_workspace_id.js +1 -1
- package/dist/database/migration/20260228203230_blue_harpoon.js +1 -1
- package/dist/database/migration/20260303231226_add_workspace_fields.js +1 -1
- package/dist/database/migration/20260309230000_move_org_to_state.js +1 -1
- package/dist/database/migration/20260312043431_session_message_cursor.js +1 -1
- package/dist/database/migration/20260323234822_events.js +1 -1
- package/dist/database/migration/20260410174513_workspace-name.js +1 -1
- package/dist/database/migration/20260413175956_chief_energizer.js +1 -1
- package/dist/database/migration/20260423070820_add_icon_url_override.js +1 -1
- package/dist/database/migration/20260427172553_slow_nightmare.js +1 -1
- package/dist/database/migration/20260428004200_add_session_path.js +1 -1
- package/dist/database/migration/20260501142318_next_venus.js +1 -1
- package/dist/database/migration/20260504145000_add_sync_owner.js +1 -1
- package/dist/database/migration/20260507164347_add_workspace_time.js +1 -1
- package/dist/database/migration/20260510033149_session_usage.js +1 -1
- package/dist/database/migration/20260511000411_data_migration_state.js +1 -1
- package/dist/database/migration/20260511173437_session-metadata.js +1 -1
- package/dist/database/migration/20260601010001_normalize_storage_paths.js +1 -1
- package/dist/database/migration/20260601202201_amazing_prowler.js +1 -1
- package/dist/database/migration/20260602002951_lowly_union_jack.js +1 -1
- package/dist/database/migration/20260602182828_add_project_directories.js +1 -1
- package/dist/database/migration/20260603001617_session_message_projection_indexes.js +1 -1
- package/dist/database/migration/20260603040000_session_message_projection_order.js +1 -1
- package/dist/database/migration/20260603141458_session_input_inbox.js +1 -1
- package/dist/database/migration/20260603160727_jittery_ezekiel_stane.js +1 -1
- package/dist/database/migration/20260604172448_event_sourced_session_input.js +1 -1
- package/dist/database/migration/20260605003541_add_session_context_snapshot.js +1 -1
- package/dist/database/migration/20260605042240_add_context_epoch_agent.js +1 -1
- package/dist/database/migration/20260611035744_credential.js +1 -1
- package/dist/database/migration/20260611192811_lush_chimera.js +1 -1
- package/dist/database/migration/20260612174303_project_dir_strategy.js +1 -1
- package/dist/database/migration/20260622142730_simplify_session_context_epoch.js +1 -1
- package/dist/database/migration/20260622170816_reset_v2_session_state.js +1 -1
- package/dist/database/migration/20260622202450_simplify_session_input.js +1 -1
- package/dist/database/migration/20260804233008_loose_psylocke.js +1 -1
- package/dist/database/migration/20260805200742_import_legacy_credentials.js +1 -1
- package/dist/database/migration/20260808023530_workspace_domain.js +1 -1
- package/dist/database/migration/20260811161259_execution_claim_attempts.js +1 -1
- package/dist/database/migration/20260812181746_session_inbox.js +1 -1
- package/dist/database/migration/20260812213948_worktree.js +1 -1
- package/dist/database/migration/20260819222447_session_viewed_state.js +1 -1
- package/dist/database/migration/20260823191254_nullable_workspace_binding.js +1 -1
- package/dist/database/migration/20260910120000_clear_v1_session_permission.js +1 -1
- package/dist/database/migration/20260923013825_project_time_active.js +1 -1
- package/dist/database/migration/20261007190000_azure_cli_external_credential.js +1 -1
- package/dist/database/migration/20261010180456_project_time_archived.js +1 -1
- package/dist/database/migration/20261024002554_session_allowance.js +1 -1
- package/dist/database/migration/20261024175301_drop_session_allowance.js +1 -1
- package/dist/database/migration/20261025123711_blob.js +1 -1
- package/dist/database/migration/20261025154125_drop_session_pending.js +1 -1
- package/dist/database/migration/20261026223005_schedule.js +6 -0
- package/dist/database/migration/20261029002625_session_part.js +6 -0
- package/dist/database/migration/20261029073502_session_time_busy.js +6 -0
- package/dist/database/migration/20261029165540_schedule_checks.js +6 -0
- package/dist/database/migration.gen.js +59 -55
- package/dist/database/migration.js +61 -57
- package/dist/database/path.js +2 -2
- package/dist/database/schema.gen.js +1 -1
- package/dist/database/schema.sql.js +1 -1
- package/dist/database/sqlite.bun.js +1 -1
- package/dist/database/sqlite.js +1 -1
- package/dist/database/sqlite.node.js +1 -1
- package/dist/database/sqlite.workerd.js +2 -1
- package/dist/database/v1-migration.bun.js +104 -100
- package/dist/database/v1-migration.js +1 -1
- package/dist/effect/app-node-builder.js +390 -382
- package/dist/effect/app-node-platform.js +2 -2
- package/dist/effect/keyed-mutex.js +3 -3
- package/dist/effect/websocket-constructor.js +1 -1
- package/dist/environment/driver.js +1 -1
- package/dist/environment/environment.js +101 -97
- package/dist/environment/exec-defaults.js +2 -2
- package/dist/environment/files.js +1 -1
- package/dist/environment/index.js +103 -99
- package/dist/environment/local.js +2 -2
- package/dist/environment/memory.js +2 -2
- package/dist/environment/unavailable.js +3 -3
- package/dist/event/sql.js +1 -1
- package/dist/event-logger.js +84 -80
- package/dist/file-access.js +152 -148
- package/dist/file-mutation.js +106 -102
- package/dist/file-retention.js +1 -1
- package/dist/filesystem/fff.bun.js +2 -2
- package/dist/filesystem/fff.js +1 -1
- package/dist/filesystem/fff.node.js +2 -2
- package/dist/filesystem/fff.workerd.js +2 -2
- package/dist/filesystem/file-watch.js +90 -86
- package/dist/filesystem/location-watcher-policy.js +2 -2
- package/dist/filesystem/location-watcher.js +236 -232
- package/dist/filesystem/protected.js +1 -1
- package/dist/filesystem/search.js +111 -107
- package/dist/filesystem/watcher-binding.js +1 -1
- package/dist/filesystem/watcher.js +9 -9
- package/dist/filesystem.js +114 -110
- package/dist/form.js +94 -90
- package/dist/formatter/builtins.js +4 -4
- package/dist/formatter.js +99 -95
- package/dist/generate.js +119 -115
- package/dist/git.js +11 -11
- package/dist/github-copilot/chat/convert-to-openai-compatible-chat-messages.js +1 -1
- package/dist/github-copilot/chat/get-response-metadata.js +1 -1
- package/dist/github-copilot/chat/map-openai-compatible-finish-reason.js +1 -1
- package/dist/github-copilot/chat/openai-compatible-chat-language-model.js +7 -7
- package/dist/github-copilot/chat/openai-compatible-chat-options.js +1 -1
- package/dist/github-copilot/chat/openai-compatible-prepare-tools.js +1 -1
- package/dist/github-copilot/copilot-provider.js +17 -17
- package/dist/github-copilot/models.js +103 -99
- package/dist/github-copilot/openai-compatible-error.js +1 -1
- package/dist/github-copilot/responses/convert-to-openai-responses-input.js +1 -1
- package/dist/github-copilot/responses/map-openai-responses-finish-reason.js +1 -1
- package/dist/github-copilot/responses/openai-error.js +1 -1
- package/dist/github-copilot/responses/openai-responses-language-model.js +10 -10
- package/dist/github-copilot/responses/openai-responses-prepare-tools.js +6 -6
- package/dist/github-copilot/responses/tool/code-interpreter.js +1 -1
- package/dist/github-copilot/responses/tool/file-search.js +1 -1
- package/dist/github-copilot/responses/tool/image-generation.js +1 -1
- package/dist/github-copilot/responses/tool/web-search-preview.js +1 -1
- package/dist/github-copilot/responses/tool/web-search.js +1 -1
- package/dist/image/notice.js +8 -0
- package/dist/image/photon-normalize.js +1 -1
- package/dist/image/photon-worker.js +1 -1
- package/dist/image/photon.js +4 -4
- package/dist/image.js +6 -6
- package/dist/instance/service.js +5 -5
- package/dist/instance.js +381 -373
- package/dist/instruction-discovery.js +92 -88
- package/dist/instructions/builtins.js +99 -95
- package/dist/instructions/index.js +3 -3
- package/dist/integration/connection.js +5 -5
- package/dist/integration.js +99 -95
- package/dist/job.js +84 -80
- package/dist/kv/sql.js +2 -2
- package/dist/kv.js +83 -79
- package/dist/location-activity.js +168 -164
- package/dist/location-lifecycle.js +146 -142
- package/dist/location-service-map.js +98 -94
- package/dist/location-services.js +378 -370
- package/dist/location.js +101 -97
- package/dist/managed-policy.js +5 -11
- package/dist/mcp/client.js +103 -99
- package/dist/mcp/index.js +119 -115
- package/dist/mcp/instructions.js +172 -168
- package/dist/mcp/oauth.js +88 -84
- package/dist/mcp/socket-client.js +1 -1
- package/dist/mcp/stdio.js +102 -98
- package/dist/mime.js +1 -1
- package/dist/modal/models.js +103 -99
- package/dist/model-resolver.js +111 -107
- package/dist/model-retry.js +1 -1
- package/dist/model.js +112 -108
- package/dist/models-dev/v1.js +1 -1
- package/dist/models-dev.js +114 -110
- package/dist/oauth/page.js +1 -1
- package/dist/permission/saved.js +92 -88
- package/dist/permission/sql.js +5 -5
- package/dist/permission.js +157 -151
- package/dist/persistent-pty/binary.bun.js +1 -1
- package/dist/persistent-pty/daemon.js +1 -1
- package/dist/persistent-pty/index.js +94 -88
- package/dist/persistent-pty/pty-binding.js +1 -1
- package/dist/persistent-pty.js +85 -81
- package/dist/plugin/agent.js +86 -82
- package/dist/plugin/command.js +114 -110
- package/dist/plugin/goal.js +16 -0
- package/dist/plugin/hooks.js +5 -5
- package/dist/plugin/host.js +231 -227
- package/dist/plugin/identity.js +5 -5
- package/dist/plugin/instance.js +5 -5
- package/dist/plugin/internal.js +357 -343
- package/dist/plugin/mcp-codemode-defaults.js +3 -3
- package/dist/plugin/models-dev.js +109 -105
- package/dist/plugin/module.js +127 -123
- package/dist/plugin/optimize.js +2 -2
- package/dist/plugin/plan.js +142 -138
- package/dist/plugin/promise.js +1 -1
- package/dist/plugin/provider/amazon-bedrock.js +103 -98
- package/dist/plugin/provider/azure.js +125 -121
- package/dist/plugin/provider/cerebras.js +1 -1
- package/dist/plugin/provider/chatgpt.js +125 -121
- package/dist/plugin/provider/cloudflare-ai-gateway.js +123 -118
- package/dist/plugin/provider/cloudflare-workers-ai.js +123 -118
- package/dist/plugin/provider/configured.js +121 -117
- package/dist/plugin/provider/credential-settings.js +91 -0
- package/dist/plugin/provider/databricks.js +1 -1
- package/dist/plugin/provider/digitalocean.js +105 -101
- package/dist/plugin/provider/dynamic.js +2 -2
- package/dist/plugin/provider/github-copilot.js +107 -103
- package/dist/plugin/provider/gitlab.js +106 -101
- package/dist/plugin/provider/google-vertex.js +122 -118
- package/dist/plugin/provider/kilo.js +1 -1
- package/dist/plugin/provider/llmgateway.js +88 -84
- package/dist/plugin/provider/lmstudio.js +134 -130
- package/dist/plugin/provider/local.js +131 -127
- package/dist/plugin/provider/modal.js +104 -100
- package/dist/plugin/provider/neon.js +1 -1
- package/dist/plugin/provider/nvidia.js +1 -1
- package/dist/plugin/provider/ollama.js +134 -130
- package/dist/plugin/provider/openai-context-caps.js +102 -98
- package/dist/plugin/provider/openai.js +125 -121
- package/dist/plugin/provider/opencode.js +128 -127
- package/dist/plugin/provider/openrouter.js +103 -99
- package/dist/plugin/provider/poe.js +89 -85
- package/dist/plugin/provider/prompt-cache-key.js +1 -1
- package/dist/plugin/provider/sap-ai-core.js +103 -99
- package/dist/plugin/provider/sdk-factory.js +1 -1
- package/dist/plugin/provider/snowflake-cortex.js +124 -120
- package/dist/plugin/provider/vllm.js +134 -130
- package/dist/plugin/provider/xai.js +103 -99
- package/dist/plugin/provider/zenmux.js +1 -1
- package/dist/plugin/provider.js +176 -178
- package/dist/plugin/sdk.js +86 -82
- package/dist/plugin/service.js +3 -3
- package/dist/plugin/skill.js +145 -141
- package/dist/plugin/source-directory.js +1 -1
- package/dist/plugin/supervisor.js +369 -362
- package/dist/plugin/tool-input-repair.js +4 -4
- package/dist/plugin/update.js +6 -6
- package/dist/plugin/vcs/git.js +98 -94
- package/dist/plugin/vcs/hg.js +98 -94
- package/dist/plugin/verbosity.js +105 -101
- package/dist/plugin/warming.js +123 -119
- package/dist/plugin/websearch/exa.js +7 -7
- package/dist/plugin/websearch/firecrawl.js +6 -6
- package/dist/plugin/websearch/index.js +9 -9
- package/dist/plugin/websearch/mcp.js +6 -6
- package/dist/plugin/websearch/parallel.js +8 -8
- package/dist/plugin/websearch/tavily.js +4 -4
- package/dist/plugin/websearch/tinyfish.js +6 -6
- package/dist/plugin.js +236 -232
- package/dist/project/icon.js +5 -5
- package/dist/project/schema.js +8 -8
- package/dist/project/sql.js +4 -4
- package/dist/project.js +100 -96
- package/dist/provider.js +111 -107
- package/dist/pty/protocol.js +1 -1
- package/dist/pty/ticket.js +1 -1
- package/dist/pty.js +100 -96
- package/dist/reference/instructions.js +100 -96
- package/dist/reference.js +102 -98
- package/dist/repository-cache.js +92 -88
- package/dist/repository.js +3 -3
- package/dist/ripgrep/binary.js +2 -2
- package/dist/ripgrep.js +105 -101
- package/dist/rpc.js +98 -94
- package/dist/schedule/check.js +248 -0
- package/dist/schedule/sql.js +11 -0
- package/dist/schedule.js +270 -0
- package/dist/schema.js +1 -1
- package/dist/session/affinity.js +1 -1
- package/dist/session/background.js +8 -0
- package/dist/session/blob.js +136 -122
- package/dist/session/command.js +84 -80
- package/dist/session/compaction.js +166 -162
- package/dist/session/context.js +192 -188
- package/dist/session/diff.js +100 -96
- package/dist/session/environment.js +5 -5
- package/dist/session/error.js +5 -5
- package/dist/session/event.js +1 -1
- package/dist/session/execution/restart.js +261 -229
- package/dist/session/execution.js +158 -154
- package/dist/session/generate.js +192 -188
- package/dist/session/history.js +140 -128
- package/dist/session/inbox.js +144 -140
- package/dist/session/info.js +3 -3
- package/dist/session/instruction-entry.js +87 -83
- package/dist/session/instruction-state.js +8 -8
- package/dist/session/instructions.js +136 -132
- package/dist/session/message-updater.js +2 -2
- package/dist/session/message.js +1 -1
- package/dist/session/model-request.js +157 -153
- package/dist/session/model-transport.js +7 -7
- package/dist/session/move.js +160 -156
- package/dist/session/projector.js +138 -134
- package/dist/session/prompt.js +144 -140
- package/dist/session/recent-text.js +1 -1
- package/dist/session/revert.js +134 -130
- package/dist/session/run-coordinator.js +3 -3
- package/dist/session/runner/index.js +3 -3
- package/dist/session/runner/llm.js +243 -238
- package/dist/session/runner/max-steps.js +1 -1
- package/dist/session/runner/model.js +112 -108
- package/dist/session/runner/publish-llm-event.js +145 -141
- package/dist/session/runner/retry.js +5 -5
- package/dist/session/runner/step.js +158 -154
- package/dist/session/runner/to-llm-message.js +132 -128
- package/dist/session/schema.js +5 -5
- package/dist/session/session.js +176 -172
- package/dist/session/shell.js +139 -135
- package/dist/session/skill.js +143 -139
- package/dist/session/sql.js +7 -5
- package/dist/session/stats.js +116 -80
- package/dist/session/store.js +137 -133
- package/dist/session/stored.js +4 -4
- package/dist/session/subagent-completion.js +1 -1
- package/dist/session/subagent-job.js +223 -219
- package/dist/session/system-prompt.js +5 -5
- package/dist/session/title.js +196 -192
- package/dist/session/to-session-error.js +144 -140
- package/dist/session/transfer.js +256 -229
- package/dist/session/usage.js +1 -1
- package/dist/session.js +229 -225
- package/dist/shell/parse.js +8 -8
- package/dist/shell/result.js +1 -1
- package/dist/shell/scan.js +1 -1
- package/dist/shell/select.js +13 -13
- package/dist/shell.js +141 -137
- package/dist/skill/discovery.js +6 -6
- package/dist/skill/instructions.js +147 -143
- package/dist/skill.js +152 -148
- package/dist/snapshot.js +105 -101
- package/dist/state.js +1 -1
- package/dist/tool/html-markdown.js +1 -1
- package/dist/tool/http-body.js +1 -1
- package/dist/tool/mcp.js +171 -167
- package/dist/tool/plugin/edit.js +160 -156
- package/dist/tool/plugin/file-diff.js +1 -1
- package/dist/tool/plugin/glob.js +164 -160
- package/dist/tool/plugin/grep.js +162 -158
- package/dist/tool/plugin/image-generate.js +242 -0
- package/dist/tool/plugin/mcp-resource.js +158 -154
- package/dist/tool/plugin/opencode.js +157 -153
- package/dist/tool/plugin/patch.js +162 -158
- package/dist/tool/plugin/question.js +150 -146
- package/dist/tool/plugin/read.js +165 -161
- package/dist/tool/plugin/schedule.js +248 -0
- package/dist/tool/plugin/shell.js +228 -224
- package/dist/tool/plugin/skill.js +153 -149
- package/dist/tool/plugin/subagent.js +230 -226
- package/dist/tool/plugin/todo.js +149 -145
- package/dist/tool/plugin/webfetch.js +155 -149
- package/dist/tool/plugin/websearch.js +149 -145
- package/dist/tool/plugin/write.js +162 -158
- package/dist/tool/read-filesystem.js +110 -106
- package/dist/tool/runtime.js +1 -1
- package/dist/tool-output.js +7 -7
- package/dist/tool.js +14 -14
- package/dist/types/codemode/web.d.ts +23 -1
- package/dist/types/config/plugin/command.d.ts +1 -1
- package/dist/types/config/plugin/policy.d.ts +1 -2
- package/dist/types/database/migration/20261026223005_schedule.d.ts +3 -0
- package/dist/types/database/migration/20261029002625_session_part.d.ts +3 -0
- package/dist/types/database/migration/20261029073502_session_time_busy.d.ts +3 -0
- package/dist/types/database/migration/20261029165540_schedule_checks.d.ts +3 -0
- package/dist/types/image/notice.d.ts +7 -0
- package/dist/types/instance.d.ts +1 -1
- package/dist/types/job.d.ts +7 -0
- package/dist/types/location-activity.d.ts +1 -1
- package/dist/types/managed-policy.d.ts +2 -20
- package/dist/types/mcp/index.d.ts +1 -1
- package/dist/types/model.d.ts +3 -13
- package/dist/types/permission.d.ts +12 -0
- package/dist/types/persistent-pty/index.d.ts +7 -1
- package/dist/types/plugin/command.d.ts +1 -1
- package/dist/types/plugin/goal.d.ts +8 -0
- package/dist/types/plugin/host.d.ts +2 -2
- package/dist/types/plugin/internal.d.ts +4 -3
- package/dist/types/plugin/models-dev.d.ts +1 -1
- package/dist/types/plugin/module.d.ts +1 -2
- package/dist/types/plugin/provider/amazon-bedrock.d.ts +1 -1
- package/dist/types/plugin/provider/cloudflare-ai-gateway.d.ts +1 -1
- package/dist/types/plugin/provider/cloudflare-workers-ai.d.ts +1 -1
- package/dist/types/plugin/provider/credential-settings.d.ts +33 -0
- package/dist/types/plugin/provider/gitlab.d.ts +2 -1
- package/dist/types/plugin/provider/opencode.d.ts +1 -2
- package/dist/types/schedule/check.d.ts +46 -0
- package/dist/types/schedule/sql.d.ts +372 -0
- package/dist/types/schedule.d.ts +50 -0
- package/dist/types/session/background.d.ts +40 -0
- package/dist/types/session/blob.d.ts +884 -17
- package/dist/types/session/compaction.d.ts +1 -1
- package/dist/types/session/execution/restart.d.ts +1 -1
- package/dist/types/session/execution.d.ts +1 -1
- package/dist/types/session/history.d.ts +1165 -1
- package/dist/types/session/model-request.d.ts +1 -1
- package/dist/types/session/revert.d.ts +2 -2
- package/dist/types/session/runner/index.d.ts +16 -0
- package/dist/types/session/runner/step.d.ts +1 -1
- package/dist/types/session/schema.d.ts +1 -0
- package/dist/types/session/session.d.ts +1 -1
- package/dist/types/session/sql.d.ts +252 -0
- package/dist/types/session/title.d.ts +1 -1
- package/dist/types/session/transfer.d.ts +1 -0
- package/dist/types/tool/mcp.d.ts +1 -1
- package/dist/types/tool/plugin/image-generate.d.ts +36 -0
- package/dist/types/tool/plugin/opencode.d.ts +1 -0
- package/dist/types/tool/plugin/schedule.d.ts +73 -0
- package/dist/types/tool/plugin/subagent.d.ts +1 -1
- package/dist/types/tool/plugin/webfetch.d.ts +1 -0
- package/dist/usage-limits.js +89 -85
- package/dist/util/error-summary.js +1 -1
- package/dist/util/git-executable.js +3 -3
- package/dist/util/lazy.js +1 -1
- package/dist/util/slug.js +1 -1
- package/dist/util/token.js +1 -1
- package/dist/util/which.js +1 -1
- package/dist/util/wildcard.js +1 -1
- package/dist/v1/config/agent.js +3 -3
- package/dist/v1/config/command.js +3 -3
- package/dist/v1/config/mcp.js +4 -4
- package/dist/v1/config/migrate.js +104 -100
- package/dist/v1/config/permission.js +3 -3
- package/dist/v1/config/plugin.js +1 -1
- package/dist/v1/config/provider-options.js +1 -1
- package/dist/v1/config/provider.js +4 -4
- package/dist/variant.js +103 -99
- package/dist/vcs/patch.js +1 -1
- package/dist/vcs.js +99 -95
- package/dist/voice.js +100 -96
- package/dist/websearch.js +98 -94
- package/dist/wellknown/plugin.js +86 -82
- package/dist/wellknown.js +87 -83
- package/dist/workspace/driver.js +5 -5
- package/dist/workspace/sql.js +1 -1
- package/dist/workspace.js +86 -82
- package/dist/worktree/directory.js +2 -2
- package/dist/worktree/git.js +11 -11
- package/dist/worktree/sql.js +5 -5
- package/dist/worktree/strategies.js +101 -97
- package/dist/worktree.js +110 -106
- package/package.json +15 -18
- package/dist/chunks/tool-6bshxcsx.js +0 -18
- package/dist/chunks/tool-7f02p6s5.js +0 -32
- package/dist/chunks/tool-9kqcsae8.js +0 -59
- package/dist/chunks/tool-asd4mxps.js +0 -26
- package/dist/chunks/tool-j775gmwt.js +0 -171
- package/dist/chunks/tool-veqvce7d.js +0 -15
- package/dist/chunks/tool-ym463w8f.js +0 -17
- package/dist/chunks/tool-z0bkrqjs.js +0 -15
- package/dist/chunks/tool-zfjx7vmh.js +0 -257
- package/dist/plugin/provider/cohere.js +0 -7
- package/dist/plugin/provider/factory.js +0 -6
- package/dist/plugin/provider/opencode-legacy.js +0 -119
- package/dist/plugin/provider/perplexity.js +0 -7
- package/dist/plugin/provider/vercel.js +0 -103
- package/dist/types/plugin/provider/cohere.d.ts +0 -1
- package/dist/types/plugin/provider/factory.d.ts +0 -6
- package/dist/types/plugin/provider/opencode-legacy.d.ts +0 -69
- package/dist/types/plugin/provider/perplexity.d.ts +0 -1
- package/dist/types/plugin/provider/vercel.d.ts +0 -1
- /package/dist/chunks/{tool-0qkdqm5v.js → session-0qkdqm5v.js} +0 -0
- /package/dist/chunks/{tool-0zkw76rk.js → session-0zkw76rk.js} +0 -0
- /package/dist/chunks/{tool-17cy0kzp.js → session-17cy0kzp.js} +0 -0
- /package/dist/chunks/{tool-1cnp2v09.js → session-1cnp2v09.js} +0 -0
- /package/dist/chunks/{tool-24dcb14g.js → session-24dcb14g.js} +0 -0
- /package/dist/chunks/{tool-2710q6r3.js → session-2710q6r3.js} +0 -0
- /package/dist/chunks/{tool-2bv980vf.js → session-2bv980vf.js} +0 -0
- /package/dist/chunks/{tool-2c3vjs8z.js → session-2c3vjs8z.js} +0 -0
- /package/dist/chunks/{tool-359p4xyc.js → session-359p4xyc.js} +0 -0
- /package/dist/chunks/{tool-3asan66x.js → session-3asan66x.js} +0 -0
- /package/dist/chunks/{tool-3v8g72cx.js → session-3v8g72cx.js} +0 -0
- /package/dist/chunks/{tool-3wcehsnq.js → session-3wcehsnq.js} +0 -0
- /package/dist/chunks/{tool-43n2bw4t.js → session-43n2bw4t.js} +0 -0
- /package/dist/chunks/{tool-4knz6hnm.js → session-4knz6hnm.js} +0 -0
- /package/dist/chunks/{tool-4vcrnpx2.js → session-4vcrnpx2.js} +0 -0
- /package/dist/chunks/{tool-4y7fprxs.js → session-4y7fprxs.js} +0 -0
- /package/dist/chunks/{tool-53557ph1.js → session-53557ph1.js} +0 -0
- /package/dist/chunks/{tool-550bvhaj.js → session-550bvhaj.js} +0 -0
- /package/dist/chunks/{tool-5w3e23ze.js → session-5w3e23ze.js} +0 -0
- /package/dist/chunks/{tool-6prwharc.js → session-6prwharc.js} +0 -0
- /package/dist/chunks/{tool-6q2bdcd1.js → session-6q2bdcd1.js} +0 -0
- /package/dist/chunks/{tool-7akdwqpd.js → session-7akdwqpd.js} +0 -0
- /package/dist/chunks/{tool-7m9af43g.js → session-7m9af43g.js} +0 -0
- /package/dist/chunks/{tool-822emrt2.js → session-822emrt2.js} +0 -0
- /package/dist/chunks/{tool-84wd9syh.js → session-84wd9syh.js} +0 -0
- /package/dist/chunks/{tool-88xbtdfr.js → session-88xbtdfr.js} +0 -0
- /package/dist/chunks/{tool-8n3pysct.js → session-8n3pysct.js} +0 -0
- /package/dist/chunks/{tool-8wj87zfr.js → session-8wj87zfr.js} +0 -0
- /package/dist/chunks/{tool-9a4afbnw.js → session-9a4afbnw.js} +0 -0
- /package/dist/chunks/{tool-9rqn6x4v.js → session-9rqn6x4v.js} +0 -0
- /package/dist/chunks/{tool-a058387c.js → session-a058387c.js} +0 -0
- /package/dist/chunks/{tool-a6k6eb26.js → session-a6k6eb26.js} +0 -0
- /package/dist/chunks/{tool-af5trqkr.js → session-af5trqkr.js} +0 -0
- /package/dist/chunks/{tool-afrmfg78.js → session-afrmfg78.js} +0 -0
- /package/dist/chunks/{tool-aqzs7mqg.js → session-aqzs7mqg.js} +0 -0
- /package/dist/chunks/{tool-atq7p7m5.js → session-atq7p7m5.js} +0 -0
- /package/dist/chunks/{tool-beh6qq61.js → session-beh6qq61.js} +0 -0
- /package/dist/chunks/{tool-bkyjaxrp.js → session-bkyjaxrp.js} +0 -0
- /package/dist/chunks/{tool-bmr6ed5q.js → session-bmr6ed5q.js} +0 -0
- /package/dist/chunks/{tool-cf4snx6d.js → session-cf4snx6d.js} +0 -0
- /package/dist/chunks/{tool-cqv5kn06.js → session-cqv5kn06.js} +0 -0
- /package/dist/chunks/{tool-cvy3z8tj.js → session-cvy3z8tj.js} +0 -0
- /package/dist/chunks/{tool-d9fn303g.js → session-d9fn303g.js} +0 -0
- /package/dist/chunks/{tool-d9jj8t3e.js → session-d9jj8t3e.js} +0 -0
- /package/dist/chunks/{tool-dap0rakb.js → session-dap0rakb.js} +0 -0
- /package/dist/chunks/{tool-df08tz66.js → session-df08tz66.js} +0 -0
- /package/dist/chunks/{tool-dy18nga0.js → session-dy18nga0.js} +0 -0
- /package/dist/chunks/{tool-e5kj55wp.js → session-e5kj55wp.js} +0 -0
- /package/dist/chunks/{tool-e73j6tqm.js → session-e73j6tqm.js} +0 -0
- /package/dist/chunks/{tool-ec1grn59.js → session-ec1grn59.js} +0 -0
- /package/dist/chunks/{tool-eh3zwz77.js → session-eh3zwz77.js} +0 -0
- /package/dist/chunks/{tool-emrn6kk6.js → session-emrn6kk6.js} +0 -0
- /package/dist/chunks/{tool-f0mxakyp.js → session-f0mxakyp.js} +0 -0
- /package/dist/chunks/{tool-f6n9ztr4.js → session-f6n9ztr4.js} +0 -0
- /package/dist/chunks/{tool-faypxj3z.js → session-faypxj3z.js} +0 -0
- /package/dist/chunks/{tool-fd410y7t.js → session-fd410y7t.js} +0 -0
- /package/dist/chunks/{tool-fkpq3x5p.js → session-fkpq3x5p.js} +0 -0
- /package/dist/chunks/{tool-g4wezp1m.js → session-g4wezp1m.js} +0 -0
- /package/dist/chunks/{tool-g86h250q.js → session-g86h250q.js} +0 -0
- /package/dist/chunks/{tool-gebd4c9n.js → session-gebd4c9n.js} +0 -0
- /package/dist/chunks/{tool-gftt206x.js → session-gftt206x.js} +0 -0
- /package/dist/chunks/{tool-hcxmzztb.js → session-hcxmzztb.js} +0 -0
- /package/dist/chunks/{tool-hk9envan.js → session-hk9envan.js} +0 -0
- /package/dist/chunks/{tool-j2ntwpah.js → session-j2ntwpah.js} +0 -0
- /package/dist/chunks/{tool-j5zkgpj8.js → session-j5zkgpj8.js} +0 -0
- /package/dist/chunks/{tool-jjkms2e6.js → session-jjkms2e6.js} +0 -0
- /package/dist/chunks/{tool-jr7sbwjy.js → session-jr7sbwjy.js} +0 -0
- /package/dist/chunks/{tool-jwfs4k6c.js → session-jwfs4k6c.js} +0 -0
- /package/dist/chunks/{tool-jwr30sdr.js → session-jwr30sdr.js} +0 -0
- /package/dist/chunks/{tool-jze0r7bz.js → session-jze0r7bz.js} +0 -0
- /package/dist/chunks/{tool-jzg6c2d5.js → session-jzg6c2d5.js} +0 -0
- /package/dist/chunks/{tool-m18g726c.js → session-m18g726c.js} +0 -0
- /package/dist/chunks/{tool-mp448xyj.js → session-mp448xyj.js} +0 -0
- /package/dist/chunks/{tool-msx8hqn2.js → session-msx8hqn2.js} +0 -0
- /package/dist/chunks/{tool-n05xt0ee.js → session-n05xt0ee.js} +0 -0
- /package/dist/chunks/{tool-n3j8tn72.js → session-n3j8tn72.js} +0 -0
- /package/dist/chunks/{tool-ncqqe42p.js → session-ncqqe42p.js} +0 -0
- /package/dist/chunks/{tool-njntx4h6.js → session-njntx4h6.js} +0 -0
- /package/dist/chunks/{tool-p71gwv9c.js → session-p71gwv9c.js} +0 -0
- /package/dist/chunks/{tool-q3sfg36h.js → session-q3sfg36h.js} +0 -0
- /package/dist/chunks/{tool-q74kybfr.js → session-q74kybfr.js} +0 -0
- /package/dist/chunks/{tool-qaymkmh1.js → session-qaymkmh1.js} +0 -0
- /package/dist/chunks/{tool-qb87gjwd.js → session-qb87gjwd.js} +0 -0
- /package/dist/chunks/{tool-qfa1cgps.js → session-qfa1cgps.js} +0 -0
- /package/dist/chunks/{tool-qg3g05ea.js → session-qg3g05ea.js} +0 -0
- /package/dist/chunks/{tool-qrg20bc0.js → session-qrg20bc0.js} +0 -0
- /package/dist/chunks/{tool-rcb2kzg1.js → session-rcb2kzg1.js} +0 -0
- /package/dist/chunks/{tool-sdp7kfr6.js → session-sdp7kfr6.js} +0 -0
- /package/dist/chunks/{tool-ssg3fenm.js → session-ssg3fenm.js} +0 -0
- /package/dist/chunks/{tool-ve7vex1e.js → session-ve7vex1e.js} +0 -0
- /package/dist/chunks/{tool-w803qqfp.js → session-w803qqfp.js} +0 -0
- /package/dist/chunks/{tool-wc3fc9cn.js → session-wc3fc9cn.js} +0 -0
- /package/dist/chunks/{tool-wer8tq1h.js → session-wer8tq1h.js} +0 -0
- /package/dist/chunks/{tool-wtztk69x.js → session-wtztk69x.js} +0 -0
- /package/dist/chunks/{tool-x0ckcb58.js → session-x0ckcb58.js} +0 -0
- /package/dist/chunks/{tool-x61499pn.js → session-x61499pn.js} +0 -0
- /package/dist/chunks/{tool-y44na4kk.js → session-y44na4kk.js} +0 -0
- /package/dist/chunks/{tool-y8f7s663.js → session-y8f7s663.js} +0 -0
- /package/dist/chunks/{tool-ygaqb7jw.js → session-ygaqb7jw.js} +0 -0
- /package/dist/chunks/{tool-z5v4ffb3.js → session-z5v4ffb3.js} +0 -0
- /package/dist/chunks/{tool-z9919s4g.js → session-z9919s4g.js} +0 -0
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Service87,
|
|
3
|
+
node91
|
|
4
|
+
} from "./session-2vpr0s80.js";
|
|
5
|
+
import {
|
|
6
|
+
latest2,
|
|
7
|
+
Service70
|
|
8
|
+
} from "./session-tf0cgyr6.js";
|
|
9
|
+
import {
|
|
10
|
+
DirectoryNotFoundError2
|
|
11
|
+
} from "./session-4cyw8nx1.js";
|
|
12
|
+
import {
|
|
13
|
+
Service54,
|
|
14
|
+
node56
|
|
15
|
+
} from "./session-rwvswa9y.js";
|
|
16
|
+
import {
|
|
17
|
+
SessionMessage2
|
|
18
|
+
} from "./session-gftt206x.js";
|
|
19
|
+
import {
|
|
20
|
+
SessionInboxTable2
|
|
21
|
+
} from "./session-mb7mbhnz.js";
|
|
22
|
+
import {
|
|
23
|
+
Service51,
|
|
24
|
+
node54
|
|
25
|
+
} from "./session-2bg8s655.js";
|
|
26
|
+
import {
|
|
27
|
+
Service25,
|
|
28
|
+
node28
|
|
29
|
+
} from "./session-h45rwca9.js";
|
|
30
|
+
import {
|
|
31
|
+
validate2,
|
|
32
|
+
describe2,
|
|
33
|
+
authorize2,
|
|
34
|
+
evaluate2
|
|
35
|
+
} from "./session-2tfsq0e5.js";
|
|
36
|
+
import {
|
|
37
|
+
ScheduleTable2
|
|
38
|
+
} from "./session-wegkxhrn.js";
|
|
39
|
+
import {
|
|
40
|
+
__export
|
|
41
|
+
} from "./session-9rqn6x4v.js";
|
|
42
|
+
|
|
43
|
+
// src/schedule.ts
|
|
44
|
+
var exports_schedule2 = {};
|
|
45
|
+
__export(exports_schedule2, {
|
|
46
|
+
Condition: () => Condition2,
|
|
47
|
+
ConditionInput: () => ConditionInput2,
|
|
48
|
+
CreateInput: () => CreateInput3,
|
|
49
|
+
DisabledError: () => DisabledError2,
|
|
50
|
+
ID: () => ID3,
|
|
51
|
+
Info: () => Info5,
|
|
52
|
+
InvalidError: () => InvalidError2,
|
|
53
|
+
NotFoundError: () => NotFoundError3,
|
|
54
|
+
Outcome: () => Outcome3,
|
|
55
|
+
Request: () => Request2,
|
|
56
|
+
Schedule: () => exports_schedule2,
|
|
57
|
+
Service: () => Service17,
|
|
58
|
+
Status: () => Status2,
|
|
59
|
+
When: () => When2,
|
|
60
|
+
node: () => node19,
|
|
61
|
+
toCreateInput: () => toCreateInput2
|
|
62
|
+
});
|
|
63
|
+
import { and, asc, eq, gt, isNull, lte, min, or } from "drizzle-orm";
|
|
64
|
+
import { Cause, Clock, Context, Cron, DateTime, Effect, Latch, Layer, Option, Result, Schema } from "effect";
|
|
65
|
+
import { makeGlobalNode } from "@opencode/util/effect/app-node";
|
|
66
|
+
import {
|
|
67
|
+
Condition as Condition2,
|
|
68
|
+
ConditionInput as ConditionInput2,
|
|
69
|
+
CreateInput as CreateInput3,
|
|
70
|
+
durationMillis,
|
|
71
|
+
ID as ID3,
|
|
72
|
+
Info as Info5,
|
|
73
|
+
Outcome as Outcome3,
|
|
74
|
+
Request as Request2,
|
|
75
|
+
Status as Status2,
|
|
76
|
+
toCreateInput as toCreateInput2,
|
|
77
|
+
When as When2
|
|
78
|
+
} from "@opencode/schema/schedule";
|
|
79
|
+
class NotFoundError3 extends Schema.TaggedError()("Schedule.NotFoundError", {
|
|
80
|
+
scheduleID: ID3
|
|
81
|
+
}) {
|
|
82
|
+
get message() {
|
|
83
|
+
return `Schedule not found: ${this.scheduleID}`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
class InvalidError2 extends Schema.TaggedError()("Schedule.InvalidError", {
|
|
88
|
+
reason: Schema.String
|
|
89
|
+
}) {
|
|
90
|
+
get message() {
|
|
91
|
+
return this.reason;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
class DisabledError2 extends Schema.TaggedError()("Schedule.DisabledError", {}) {
|
|
96
|
+
get message() {
|
|
97
|
+
return "Scheduled tasks are disabled; set experimental.schedules in config";
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
class Service17 extends Context.Service()("@opencode/Schedule") {
|
|
102
|
+
}
|
|
103
|
+
var MINUTE = 60000;
|
|
104
|
+
var HOUR = 60 * MINUTE;
|
|
105
|
+
var MIN_INTERVAL = MINUTE;
|
|
106
|
+
var MIN_CHECK_INTERVAL = 15000;
|
|
107
|
+
var DEFAULT_UNTIL_EVERY = { type: "every", every: "30 seconds" };
|
|
108
|
+
var DEFAULT_UNTIL_AFTER = 24 * HOUR;
|
|
109
|
+
var LATE_AFTER = 60000;
|
|
110
|
+
var MAX_SLEEP = 30000;
|
|
111
|
+
var DISABLED_RETRY = HOUR;
|
|
112
|
+
var FAILED_RETRY = 5 * MINUTE;
|
|
113
|
+
var CHECK_FAILED_RETRY = MINUTE;
|
|
114
|
+
var MAX_CHECK_FAILURES = 3;
|
|
115
|
+
var TICK_CONCURRENCY = 4;
|
|
116
|
+
var duration = (value) => Option.match(durationMillis(value), {
|
|
117
|
+
onNone: () => Effect.fail(new InvalidError2({ reason: `Invalid duration: ${value}` })),
|
|
118
|
+
onSome: (millis) => millis > 0 ? Effect.succeed(millis) : Effect.fail(new InvalidError2({ reason: `Duration must be positive: ${value}` }))
|
|
119
|
+
});
|
|
120
|
+
var millis = (value) => Option.getOrThrowWith(durationMillis(value), () => new Error(`Invalid duration: ${value}`));
|
|
121
|
+
var OFFSET = /\d(?:z|[+-]\d{2}:?\d{2})$/i;
|
|
122
|
+
var parseAt = (input, zone) => Option.map(OFFSET.test(input) ? DateTime.make(input) : DateTime.makeZoned(input, { timeZone: zone, adjustForTimeZone: true }), DateTime.toEpochMillis);
|
|
123
|
+
var cronNext = Option.liftThrowable(Cron.next);
|
|
124
|
+
var nextCron = (cron, now, from = now) => {
|
|
125
|
+
const next = cronNext(cron, new Date(from));
|
|
126
|
+
if (Option.isNone(next))
|
|
127
|
+
return;
|
|
128
|
+
const at = next.value.getTime();
|
|
129
|
+
return at > now ? at : nextCron(cron, now, at + HOUR);
|
|
130
|
+
};
|
|
131
|
+
var following = (row, now) => {
|
|
132
|
+
switch (row.when.type) {
|
|
133
|
+
case "in":
|
|
134
|
+
case "at":
|
|
135
|
+
return;
|
|
136
|
+
case "every": {
|
|
137
|
+
const every = millis(row.when.every);
|
|
138
|
+
const due = row.next_due_at ?? now;
|
|
139
|
+
return due + (Math.floor((now - due) / every) + 1) * every;
|
|
140
|
+
}
|
|
141
|
+
case "cron":
|
|
142
|
+
return nextCron(Cron.parseUnsafe(row.when.cron, row.tz), now);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
var finished = (row, next, remaining) => next === undefined || remaining !== null && remaining <= 0 || row.ends_at !== null && next > row.ends_at;
|
|
146
|
+
var optionalTime = (value) => value === null ? undefined : DateTime.makeUnsafe(value);
|
|
147
|
+
var promptText = (prompt, message) => {
|
|
148
|
+
if (!message?.trim())
|
|
149
|
+
return prompt;
|
|
150
|
+
return `${prompt}
|
|
151
|
+
|
|
152
|
+
${message}`;
|
|
153
|
+
};
|
|
154
|
+
var resolveStoredCheck = (input) => {
|
|
155
|
+
if (input.if !== undefined && input.until !== undefined)
|
|
156
|
+
return Effect.fail(new InvalidError2({ reason: "Choose either if or until, not both" }));
|
|
157
|
+
const check = input.if !== undefined ? { mode: "if", condition: input.if } : input.until !== undefined ? { mode: "until", condition: input.until } : undefined;
|
|
158
|
+
if (check === undefined)
|
|
159
|
+
return Effect.succeed(undefined);
|
|
160
|
+
const validated = validate2(check.condition);
|
|
161
|
+
if (Result.isFailure(validated))
|
|
162
|
+
return Effect.fail(new InvalidError2({ reason: validated.failure }));
|
|
163
|
+
return Effect.succeed(check);
|
|
164
|
+
};
|
|
165
|
+
var toInfo = (row, lastOutput) => ({
|
|
166
|
+
id: row.id,
|
|
167
|
+
sessionID: row.session_id ?? undefined,
|
|
168
|
+
name: row.name ?? undefined,
|
|
169
|
+
when: row.when,
|
|
170
|
+
tz: row.tz,
|
|
171
|
+
if: row.check?.mode === "if" ? row.check.condition : undefined,
|
|
172
|
+
until: row.check?.mode === "until" ? row.check.condition : undefined,
|
|
173
|
+
action: row.action,
|
|
174
|
+
status: row.status,
|
|
175
|
+
nextDueAt: optionalTime(row.next_due_at),
|
|
176
|
+
endsAt: optionalTime(row.ends_at),
|
|
177
|
+
remainingRuns: row.remaining_runs ?? undefined,
|
|
178
|
+
runCount: row.run_count,
|
|
179
|
+
lastFiredAt: optionalTime(row.last_fired_at),
|
|
180
|
+
lastOutcome: row.last_outcome ?? undefined,
|
|
181
|
+
...lastOutput === undefined ? {} : { lastOutput },
|
|
182
|
+
time: { created: DateTime.makeUnsafe(row.time_created), updated: DateTime.makeUnsafe(row.time_updated) }
|
|
183
|
+
});
|
|
184
|
+
var layer = Layer.effect(Service17, Effect.gen(function* () {
|
|
185
|
+
const database = yield* Service87;
|
|
186
|
+
const db = database.db;
|
|
187
|
+
const sessions = yield* Service25;
|
|
188
|
+
const instances = yield* Service54;
|
|
189
|
+
const execution = yield* Service51;
|
|
190
|
+
const doorbell = yield* Latch.make();
|
|
191
|
+
const settings = (session) => Effect.gen(function* () {
|
|
192
|
+
const config = yield* Effect.serviceOption(Service70);
|
|
193
|
+
if (Option.isNone(config))
|
|
194
|
+
return { enabled: false, timezone: undefined };
|
|
195
|
+
const entries = yield* config.value.entries();
|
|
196
|
+
return {
|
|
197
|
+
enabled: latest2(entries, "experimental")?.schedules === true,
|
|
198
|
+
timezone: latest2(entries, "timezone")
|
|
199
|
+
};
|
|
200
|
+
}).pipe(instances.provide(session));
|
|
201
|
+
const find = (id) => db.select().from(ScheduleTable2).where(eq(ScheduleTable2.id, id)).get().pipe(Effect.orDie, Effect.flatMap((row) => row ? Effect.succeed(row) : Effect.fail(new NotFoundError3({ scheduleID: id }))));
|
|
202
|
+
const update = (row, values) => db.update(ScheduleTable2).set(values).where(and(eq(ScheduleTable2.id, row.id), eq(ScheduleTable2.status, "active"))).run().pipe(Effect.orDie);
|
|
203
|
+
const pending = (id) => db.select({ id: SessionInboxTable2.id }).from(SessionInboxTable2).where(eq(SessionInboxTable2.id, id)).get().pipe(Effect.orDie, Effect.map((row) => row !== undefined));
|
|
204
|
+
const admitWake = Effect.fnUntraced(function* (row, sessionID, run, due, late, text, checkMeta) {
|
|
205
|
+
const id = SessionMessage2.ID.make(`msg_${row.id}_${run}`);
|
|
206
|
+
yield* sessions.prompt({
|
|
207
|
+
sessionID,
|
|
208
|
+
id,
|
|
209
|
+
text,
|
|
210
|
+
delivery: "steer",
|
|
211
|
+
metadata: {
|
|
212
|
+
schedule: {
|
|
213
|
+
id: row.id,
|
|
214
|
+
name: row.name ?? undefined,
|
|
215
|
+
run,
|
|
216
|
+
dueAt: due,
|
|
217
|
+
late,
|
|
218
|
+
...checkMeta === undefined ? {} : { check: checkMeta }
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
return id;
|
|
223
|
+
});
|
|
224
|
+
const fire = Effect.fnUntraced(function* (row, session, due, now) {
|
|
225
|
+
const late = now - due >= LATE_AFTER;
|
|
226
|
+
const next = following(row, now);
|
|
227
|
+
if (row.check !== null) {
|
|
228
|
+
const check = row.check;
|
|
229
|
+
const outcome = yield* evaluate2(session, check, row.state ?? null).pipe(instances.provide(session));
|
|
230
|
+
if (!outcome.ok) {
|
|
231
|
+
const strikes = row.failures + 1;
|
|
232
|
+
if (strikes < MAX_CHECK_FAILURES) {
|
|
233
|
+
yield* update(row, {
|
|
234
|
+
failures: strikes,
|
|
235
|
+
last_outcome: "failed",
|
|
236
|
+
retry_at: now + CHECK_FAILED_RETRY,
|
|
237
|
+
time_updated: now
|
|
238
|
+
});
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
const run = row.run_count + 1;
|
|
242
|
+
const id = yield* admitWake(row, session.id, run, due, late, `${row.action.prompt}
|
|
243
|
+
|
|
244
|
+
[Schedule paused after ${strikes} failed checks: ${outcome.error}]`, { error: outcome.error, failures: strikes });
|
|
245
|
+
yield* db.update(ScheduleTable2).set({
|
|
246
|
+
status: "paused",
|
|
247
|
+
failures: strikes,
|
|
248
|
+
run_count: run,
|
|
249
|
+
last_message_id: id,
|
|
250
|
+
last_fired_at: now,
|
|
251
|
+
last_outcome: "failed",
|
|
252
|
+
retry_at: null,
|
|
253
|
+
time_updated: now
|
|
254
|
+
}).where(eq(ScheduleTable2.id, row.id)).run().pipe(Effect.orDie);
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
if (!outcome.wake) {
|
|
258
|
+
const checks = row.checks + 1;
|
|
259
|
+
const ended = next === undefined || row.ends_at !== null && next > row.ends_at;
|
|
260
|
+
if (check.mode === "until" && ended) {
|
|
261
|
+
const run = row.run_count + 1;
|
|
262
|
+
const id = yield* admitWake(row, session.id, run, due, late, `${row.action.prompt}
|
|
263
|
+
|
|
264
|
+
[Schedule timed out without matching: ${describe2(check.condition)}]`, { expired: true });
|
|
265
|
+
yield* db.update(ScheduleTable2).set({
|
|
266
|
+
status: "done",
|
|
267
|
+
checks,
|
|
268
|
+
failures: 0,
|
|
269
|
+
state: outcome.state,
|
|
270
|
+
run_count: run,
|
|
271
|
+
last_message_id: id,
|
|
272
|
+
last_fired_at: now,
|
|
273
|
+
last_outcome: "expired",
|
|
274
|
+
next_due_at: null,
|
|
275
|
+
remaining_runs: 0,
|
|
276
|
+
retry_at: null,
|
|
277
|
+
time_updated: now
|
|
278
|
+
}).where(eq(ScheduleTable2.id, row.id)).run().pipe(Effect.orDie);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
yield* update(row, {
|
|
282
|
+
checks,
|
|
283
|
+
failures: 0,
|
|
284
|
+
state: outcome.state,
|
|
285
|
+
last_outcome: "checked",
|
|
286
|
+
retry_at: null,
|
|
287
|
+
...ended ? { status: "done", next_due_at: null } : { next_due_at: next },
|
|
288
|
+
time_updated: now
|
|
289
|
+
});
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
const run = row.run_count + 1;
|
|
293
|
+
const id = yield* admitWake(row, session.id, run, due, late, promptText(row.action.prompt, outcome.message), outcome.message === undefined ? {} : { message: outcome.message });
|
|
294
|
+
const remaining = check.mode === "until" ? 0 : row.remaining_runs === null ? null : row.remaining_runs - 1;
|
|
295
|
+
const done = check.mode === "until" || finished(row, next, remaining);
|
|
296
|
+
yield* db.update(ScheduleTable2).set({
|
|
297
|
+
run_count: run,
|
|
298
|
+
checks: row.checks + 1,
|
|
299
|
+
failures: 0,
|
|
300
|
+
state: outcome.state,
|
|
301
|
+
last_message_id: id,
|
|
302
|
+
last_fired_at: now,
|
|
303
|
+
last_outcome: late ? "late" : "fired",
|
|
304
|
+
retry_at: null,
|
|
305
|
+
remaining_runs: remaining,
|
|
306
|
+
...done ? { status: "done" } : {},
|
|
307
|
+
next_due_at: done ? null : next,
|
|
308
|
+
time_updated: now
|
|
309
|
+
}).where(eq(ScheduleTable2.id, row.id)).run().pipe(Effect.orDie);
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
const run = row.run_count + 1;
|
|
313
|
+
const id = yield* admitWake(row, session.id, run, due, late, row.action.prompt);
|
|
314
|
+
const remaining = row.remaining_runs === null ? null : row.remaining_runs - 1;
|
|
315
|
+
const done = finished(row, next, remaining);
|
|
316
|
+
yield* db.update(ScheduleTable2).set({
|
|
317
|
+
run_count: run,
|
|
318
|
+
last_message_id: id,
|
|
319
|
+
last_fired_at: now,
|
|
320
|
+
last_outcome: late ? "late" : "fired",
|
|
321
|
+
retry_at: null,
|
|
322
|
+
remaining_runs: remaining,
|
|
323
|
+
...done ? { status: "done" } : {},
|
|
324
|
+
next_due_at: done ? null : next,
|
|
325
|
+
time_updated: now
|
|
326
|
+
}).where(eq(ScheduleTable2.id, row.id)).run().pipe(Effect.orDie);
|
|
327
|
+
});
|
|
328
|
+
const step = Effect.fnUntraced(function* (row, now) {
|
|
329
|
+
const due = row.next_due_at;
|
|
330
|
+
if (due === null || row.session_id === null)
|
|
331
|
+
return;
|
|
332
|
+
const session = yield* sessions.get(row.session_id);
|
|
333
|
+
if (!(yield* settings(session)).enabled) {
|
|
334
|
+
yield* update(row, { last_outcome: "disabled", retry_at: now + DISABLED_RETRY, time_updated: now });
|
|
335
|
+
return;
|
|
336
|
+
}
|
|
337
|
+
if (row.last_message_id !== null && (yield* pending(row.last_message_id))) {
|
|
338
|
+
yield* execution.wake(session.id);
|
|
339
|
+
const next = following(row, now);
|
|
340
|
+
const done = finished(row, next, row.remaining_runs);
|
|
341
|
+
yield* update(row, {
|
|
342
|
+
last_outcome: "skipped",
|
|
343
|
+
retry_at: null,
|
|
344
|
+
status: done ? "done" : "active",
|
|
345
|
+
next_due_at: done ? null : next,
|
|
346
|
+
time_updated: now
|
|
347
|
+
});
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
yield* fire(row, session, due, now);
|
|
351
|
+
});
|
|
352
|
+
const tickAt = Effect.fnUntraced(function* (now) {
|
|
353
|
+
const due = yield* db.select().from(ScheduleTable2).where(and(eq(ScheduleTable2.status, "active"), lte(ScheduleTable2.next_due_at, now), or(isNull(ScheduleTable2.retry_at), lte(ScheduleTable2.retry_at, now)))).orderBy(asc(ScheduleTable2.next_due_at)).all().pipe(Effect.orDie);
|
|
354
|
+
yield* Effect.forEach(due, (row) => step(row, now).pipe(Effect.catchCause((cause) => {
|
|
355
|
+
if (Cause.hasInterruptsOnly(cause))
|
|
356
|
+
return Effect.interrupt;
|
|
357
|
+
if (Cause.squash(cause) instanceof DirectoryNotFoundError2) {
|
|
358
|
+
return update(row, {
|
|
359
|
+
status: "paused",
|
|
360
|
+
last_outcome: "failed",
|
|
361
|
+
retry_at: null,
|
|
362
|
+
time_updated: now
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
return Effect.logWarning("schedule failed to fire", { scheduleID: row.id, cause }).pipe(Effect.andThen(update(row, { last_outcome: "failed", retry_at: now + FAILED_RETRY, time_updated: now })));
|
|
366
|
+
})), { discard: true, concurrency: due.length > 1 ? TICK_CONCURRENCY : 1 });
|
|
367
|
+
}, Effect.withSpan("Schedule.tick"));
|
|
368
|
+
const tick = Effect.flatMap(Clock.currentTimeMillis, tickAt);
|
|
369
|
+
const nextWake = Effect.fnUntraced(function* (from) {
|
|
370
|
+
const row = yield* db.select({ at: min(ScheduleTable2.next_due_at) }).from(ScheduleTable2).where(and(eq(ScheduleTable2.status, "active"), gt(ScheduleTable2.next_due_at, from))).get().pipe(Effect.orDie);
|
|
371
|
+
if (row?.at == null)
|
|
372
|
+
return MAX_SLEEP;
|
|
373
|
+
return Math.max(0, Math.min(MAX_SLEEP, row.at - (yield* Clock.currentTimeMillis)));
|
|
374
|
+
});
|
|
375
|
+
const rewake = db.selectDistinct({ sessionID: ScheduleTable2.session_id }).from(ScheduleTable2).innerJoin(SessionInboxTable2, eq(SessionInboxTable2.id, ScheduleTable2.last_message_id)).all().pipe(Effect.orDie, Effect.flatMap((rows) => Effect.forEach(rows, (row) => row.sessionID === null ? Effect.void : execution.wake(row.sessionID), {
|
|
376
|
+
discard: true
|
|
377
|
+
})));
|
|
378
|
+
const loop = Effect.gen(function* () {
|
|
379
|
+
yield* doorbell.close;
|
|
380
|
+
const now = yield* Clock.currentTimeMillis;
|
|
381
|
+
yield* tickAt(now).pipe(Effect.catchCause((cause) => Effect.logError("schedule tick failed", { cause })));
|
|
382
|
+
const wait = yield* nextWake(now);
|
|
383
|
+
if (wait > 0)
|
|
384
|
+
yield* doorbell.await.pipe(Effect.timeoutOption(wait));
|
|
385
|
+
});
|
|
386
|
+
const run = rewake.pipe(Effect.catchCause((cause) => Effect.logError("schedule rewake failed", { cause })), Effect.andThen(Effect.forever(loop)));
|
|
387
|
+
const resolveZone = (tz) => {
|
|
388
|
+
if (tz === undefined)
|
|
389
|
+
return Effect.succeed(DateTime.zoneMakeLocal());
|
|
390
|
+
return Option.match(DateTime.zoneMakeNamed(tz), {
|
|
391
|
+
onNone: () => Effect.fail(new InvalidError2({ reason: `Unknown time zone: ${tz}` })),
|
|
392
|
+
onSome: Effect.succeed
|
|
393
|
+
});
|
|
394
|
+
};
|
|
395
|
+
const firstDue = Effect.fnUntraced(function* (when, hasCheck, zone, now) {
|
|
396
|
+
switch (when.type) {
|
|
397
|
+
case "in":
|
|
398
|
+
return now + (yield* duration(when.in));
|
|
399
|
+
case "at": {
|
|
400
|
+
const at = parseAt(when.at, zone);
|
|
401
|
+
if (Option.isNone(at))
|
|
402
|
+
return yield* new InvalidError2({ reason: `Invalid time: ${when.at}` });
|
|
403
|
+
if (at.value <= now)
|
|
404
|
+
return yield* new InvalidError2({ reason: `Time is in the past: ${when.at}` });
|
|
405
|
+
return at.value;
|
|
406
|
+
}
|
|
407
|
+
case "every": {
|
|
408
|
+
const every = yield* duration(when.every);
|
|
409
|
+
const minInterval = hasCheck ? MIN_CHECK_INTERVAL : MIN_INTERVAL;
|
|
410
|
+
if (every < minInterval) {
|
|
411
|
+
return yield* new InvalidError2({
|
|
412
|
+
reason: hasCheck ? "every must be at least 15 seconds" : "every must be at least 1 minute"
|
|
413
|
+
});
|
|
414
|
+
}
|
|
415
|
+
return now + every;
|
|
416
|
+
}
|
|
417
|
+
case "cron": {
|
|
418
|
+
const cron = Cron.parse(when.cron, zone);
|
|
419
|
+
if (Result.isFailure(cron))
|
|
420
|
+
return yield* new InvalidError2({ reason: cron.failure.message });
|
|
421
|
+
if (cron.success.seconds.size !== 1)
|
|
422
|
+
return yield* new InvalidError2({ reason: "cron must fire at most once a minute" });
|
|
423
|
+
const next = nextCron(cron.success, now);
|
|
424
|
+
if (next === undefined)
|
|
425
|
+
return yield* new InvalidError2({ reason: `cron never fires: ${when.cron}` });
|
|
426
|
+
return next;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
const endsAt = Effect.fnUntraced(function* (ends, isUntil, zone, now) {
|
|
431
|
+
const after = ends?.after === undefined ? undefined : now + (yield* duration(ends.after));
|
|
432
|
+
if (ends?.at === undefined) {
|
|
433
|
+
if (after !== undefined)
|
|
434
|
+
return after;
|
|
435
|
+
return isUntil ? now + DEFAULT_UNTIL_AFTER : null;
|
|
436
|
+
}
|
|
437
|
+
const at = parseAt(ends.at, zone);
|
|
438
|
+
if (Option.isNone(at))
|
|
439
|
+
return yield* new InvalidError2({ reason: `Invalid time: ${ends.at}` });
|
|
440
|
+
return Math.min(at.value, after ?? at.value);
|
|
441
|
+
});
|
|
442
|
+
return Service17.of({
|
|
443
|
+
create: Effect.fn("Schedule.create")(function* (input) {
|
|
444
|
+
const session = yield* sessions.get(input.sessionID);
|
|
445
|
+
const config = yield* settings(session).pipe(Effect.catchTag("FileSystem.DirectoryNotFoundError", () => Effect.fail(new InvalidError2({ reason: `Session directory does not exist: ${session.location.directory}` }))));
|
|
446
|
+
if (!config.enabled)
|
|
447
|
+
return yield* new DisabledError2;
|
|
448
|
+
const check = yield* resolveStoredCheck(input);
|
|
449
|
+
const when = input.when ?? (check?.mode === "until" ? DEFAULT_UNTIL_EVERY : undefined);
|
|
450
|
+
if (when === undefined)
|
|
451
|
+
return yield* new InvalidError2({ reason: "when is required unless until is set" });
|
|
452
|
+
const zone = yield* resolveZone(when.tz ?? config.timezone);
|
|
453
|
+
const now = yield* Clock.currentTimeMillis;
|
|
454
|
+
const due = yield* firstDue(when, check !== undefined, zone, now);
|
|
455
|
+
if (input.ends?.times !== undefined && input.ends.times < 1)
|
|
456
|
+
return yield* new InvalidError2({ reason: "ends.times must be at least 1" });
|
|
457
|
+
const ends = yield* endsAt(input.ends, check?.mode === "until", zone, now);
|
|
458
|
+
if (ends !== null && due > ends)
|
|
459
|
+
return yield* new InvalidError2({ reason: "The schedule ends before it first fires" });
|
|
460
|
+
const seeded = check === undefined ? { matched: false, state: null, checks: 0 } : yield* Effect.gen(function* () {
|
|
461
|
+
yield* authorize2(session, input.name, check).pipe(instances.provide(session), Effect.mapError((error) => typeof error === "string" ? new InvalidError2({ reason: error }) : error), Effect.catchTag("FileSystem.DirectoryNotFoundError", () => Effect.fail(new InvalidError2({ reason: `Session directory does not exist: ${session.location.directory}` }))));
|
|
462
|
+
const shouldSeed = check.mode === "until" || check.condition.type === "shell" && check.condition.changes === true;
|
|
463
|
+
if (!shouldSeed)
|
|
464
|
+
return { matched: false, state: null, checks: 0 };
|
|
465
|
+
const init = yield* evaluate2(session, check, null).pipe(instances.provide(session), Effect.catchTag("FileSystem.DirectoryNotFoundError", () => Effect.fail(new InvalidError2({ reason: `Session directory does not exist: ${session.location.directory}` }))));
|
|
466
|
+
if (!init.ok)
|
|
467
|
+
return { matched: false, state: null, checks: 0 };
|
|
468
|
+
if (check.mode === "until" && init.wake)
|
|
469
|
+
return { matched: true, state: init.state, message: init.message };
|
|
470
|
+
return { matched: false, state: init.state, checks: 1 };
|
|
471
|
+
});
|
|
472
|
+
if (seeded.matched) {
|
|
473
|
+
const row = yield* db.insert(ScheduleTable2).values({
|
|
474
|
+
id: ID3.create(),
|
|
475
|
+
session_id: session.id,
|
|
476
|
+
name: input.name ?? null,
|
|
477
|
+
check: check ?? null,
|
|
478
|
+
state: seeded.state,
|
|
479
|
+
checks: 1,
|
|
480
|
+
action: input.action,
|
|
481
|
+
when,
|
|
482
|
+
tz: DateTime.zoneToString(zone),
|
|
483
|
+
status: "done",
|
|
484
|
+
next_due_at: null,
|
|
485
|
+
ends_at: ends,
|
|
486
|
+
remaining_runs: 0,
|
|
487
|
+
run_count: 1,
|
|
488
|
+
last_fired_at: now,
|
|
489
|
+
last_outcome: "fired",
|
|
490
|
+
time_created: now,
|
|
491
|
+
time_updated: now
|
|
492
|
+
}).returning().get().pipe(Effect.orDie);
|
|
493
|
+
return toInfo(row, seeded.message);
|
|
494
|
+
}
|
|
495
|
+
const remaining = check?.mode === "until" ? 1 : input.ends?.times ?? null;
|
|
496
|
+
const row = yield* db.insert(ScheduleTable2).values({
|
|
497
|
+
id: ID3.create(),
|
|
498
|
+
session_id: session.id,
|
|
499
|
+
name: input.name ?? null,
|
|
500
|
+
check: check ?? null,
|
|
501
|
+
state: seeded.state,
|
|
502
|
+
checks: seeded.checks,
|
|
503
|
+
action: input.action,
|
|
504
|
+
when,
|
|
505
|
+
tz: DateTime.zoneToString(zone),
|
|
506
|
+
next_due_at: due,
|
|
507
|
+
ends_at: ends,
|
|
508
|
+
remaining_runs: remaining,
|
|
509
|
+
time_created: now,
|
|
510
|
+
time_updated: now
|
|
511
|
+
}).returning().get().pipe(Effect.orDie);
|
|
512
|
+
yield* doorbell.open;
|
|
513
|
+
return toInfo(row);
|
|
514
|
+
}),
|
|
515
|
+
list: Effect.fn("Schedule.list")(function* (input) {
|
|
516
|
+
const rows = yield* db.select().from(ScheduleTable2).where(input?.sessionID === undefined ? undefined : eq(ScheduleTable2.session_id, input.sessionID)).orderBy(asc(ScheduleTable2.time_created), asc(ScheduleTable2.id)).all().pipe(Effect.orDie);
|
|
517
|
+
return rows.map((row) => toInfo(row));
|
|
518
|
+
}),
|
|
519
|
+
get: Effect.fn("Schedule.get")(function* (id) {
|
|
520
|
+
return toInfo(yield* find(id));
|
|
521
|
+
}),
|
|
522
|
+
pause: Effect.fn("Schedule.pause")(function* (id) {
|
|
523
|
+
const row = yield* find(id);
|
|
524
|
+
if (row.status !== "active")
|
|
525
|
+
return toInfo(row);
|
|
526
|
+
const now = yield* Clock.currentTimeMillis;
|
|
527
|
+
yield* update(row, { status: "paused", time_updated: now });
|
|
528
|
+
return toInfo(yield* find(id));
|
|
529
|
+
}),
|
|
530
|
+
resume: Effect.fn("Schedule.resume")(function* (id) {
|
|
531
|
+
const row = yield* find(id);
|
|
532
|
+
if (row.status !== "paused")
|
|
533
|
+
return toInfo(row);
|
|
534
|
+
const now = yield* Clock.currentTimeMillis;
|
|
535
|
+
const next = row.next_due_at === null || row.next_due_at > now ? row.next_due_at : following(row, now) ?? row.next_due_at;
|
|
536
|
+
const done = next === null || finished(row, next, row.remaining_runs);
|
|
537
|
+
yield* db.update(ScheduleTable2).set({
|
|
538
|
+
status: done ? "done" : "active",
|
|
539
|
+
next_due_at: done ? null : next,
|
|
540
|
+
failures: 0,
|
|
541
|
+
retry_at: null,
|
|
542
|
+
time_updated: now
|
|
543
|
+
}).where(and(eq(ScheduleTable2.id, id), eq(ScheduleTable2.status, "paused"))).run().pipe(Effect.orDie);
|
|
544
|
+
yield* doorbell.open;
|
|
545
|
+
return toInfo(yield* find(id));
|
|
546
|
+
}),
|
|
547
|
+
remove: Effect.fn("Schedule.remove")(function* (id) {
|
|
548
|
+
yield* find(id);
|
|
549
|
+
yield* db.delete(ScheduleTable2).where(eq(ScheduleTable2.id, id)).run().pipe(Effect.orDie);
|
|
550
|
+
}),
|
|
551
|
+
enabled: Effect.fn("Schedule.enabled")(function* (sessionID) {
|
|
552
|
+
const session = yield* sessions.get(sessionID);
|
|
553
|
+
return yield* settings(session).pipe(Effect.map((value) => value.enabled), Effect.catchTag("FileSystem.DirectoryNotFoundError", () => Effect.succeed(false)));
|
|
554
|
+
}),
|
|
555
|
+
tick,
|
|
556
|
+
run
|
|
557
|
+
});
|
|
558
|
+
}));
|
|
559
|
+
var node19 = makeGlobalNode({
|
|
560
|
+
service: Service17,
|
|
561
|
+
layer,
|
|
562
|
+
deps: [node91, node28, node54, node56]
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
export { Condition2, ConditionInput2, CreateInput3, ID3, Info5, Outcome3, Request2, Status2, toCreateInput2, When2, NotFoundError3, InvalidError2, DisabledError2, Service17, node19, exports_schedule2 };
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Failed2
|
|
3
|
-
} from "./
|
|
3
|
+
} from "./session-svcy3p9a.js";
|
|
4
4
|
import {
|
|
5
5
|
execDefaults2
|
|
6
|
-
} from "./
|
|
6
|
+
} from "./session-jtnps1zs.js";
|
|
7
7
|
import {
|
|
8
8
|
Service87,
|
|
9
9
|
node91
|
|
10
|
-
} from "./
|
|
10
|
+
} from "./session-2vpr0s80.js";
|
|
11
11
|
import {
|
|
12
12
|
makeUnsafe2
|
|
13
|
-
} from "./
|
|
13
|
+
} from "./session-8jztxfpf.js";
|
|
14
14
|
import {
|
|
15
15
|
Binding2,
|
|
16
16
|
RegistryService2,
|
|
17
17
|
node65
|
|
18
|
-
} from "./
|
|
18
|
+
} from "./session-ycbkkxa6.js";
|
|
19
19
|
import {
|
|
20
20
|
WorkspaceTable2
|
|
21
|
-
} from "./
|
|
21
|
+
} from "./session-faypxj3z.js";
|
|
22
22
|
import {
|
|
23
23
|
__export
|
|
24
|
-
} from "./
|
|
24
|
+
} from "./session-9rqn6x4v.js";
|
|
25
25
|
|
|
26
26
|
// src/workspace.ts
|
|
27
27
|
var exports_workspace = {};
|
|
28
28
|
__export(exports_workspace, {
|
|
29
29
|
CreateConflict: () => CreateConflict2,
|
|
30
|
-
ID: () =>
|
|
31
|
-
Info: () =>
|
|
30
|
+
ID: () => ID8,
|
|
31
|
+
Info: () => Info14,
|
|
32
32
|
NotFound: () => NotFound2,
|
|
33
33
|
Service: () => Service62,
|
|
34
34
|
Workspace: () => exports_workspace,
|
|
@@ -41,10 +41,10 @@ import { eq } from "drizzle-orm";
|
|
|
41
41
|
import { Clock, Context, Deferred, Duration, Effect, Exit, FiberSet, Layer, Ref, Schedule, Schema, Scope } from "effect";
|
|
42
42
|
import { systemError } from "effect/PlatformError";
|
|
43
43
|
import { make } from "effect/process/ChildProcessSpawner";
|
|
44
|
-
var
|
|
44
|
+
var ID8 = Workspace.ID;
|
|
45
45
|
|
|
46
|
-
class
|
|
47
|
-
id:
|
|
46
|
+
class Info14 extends Schema.Class("Workspace.Info")({
|
|
47
|
+
id: ID8,
|
|
48
48
|
provider: Schema.String,
|
|
49
49
|
binding: Binding2,
|
|
50
50
|
createdAt: Schema.Number,
|
|
@@ -52,11 +52,11 @@ class Info15 extends Schema.Class("Workspace.Info")({
|
|
|
52
52
|
}) {
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
class NotFound2 extends Schema.TaggedError()("Workspace.NotFound", { workspaceID:
|
|
55
|
+
class NotFound2 extends Schema.TaggedError()("Workspace.NotFound", { workspaceID: ID8 }) {
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
class CreateConflict2 extends Schema.TaggedError()("Workspace.CreateConflict", {
|
|
59
|
-
workspaceID:
|
|
59
|
+
workspaceID: ID8,
|
|
60
60
|
provider: Schema.String,
|
|
61
61
|
existingProvider: Schema.String
|
|
62
62
|
}) {
|
|
@@ -86,7 +86,7 @@ var layer = (options) => Layer.effect(Service62, Effect.gen(function* () {
|
|
|
86
86
|
return row;
|
|
87
87
|
});
|
|
88
88
|
const saveBinding = (workspaceID, binding) => db.update(WorkspaceTable2).set({ binding }).where(eq(WorkspaceTable2.id, workspaceID)).run().pipe(Effect.orDie);
|
|
89
|
-
const info = (row, binding) => new
|
|
89
|
+
const info = (row, binding) => new Info14({
|
|
90
90
|
id: row.id,
|
|
91
91
|
provider: row.provider,
|
|
92
92
|
binding,
|
|
@@ -166,7 +166,7 @@ var layer = (options) => Layer.effect(Service62, Effect.gen(function* () {
|
|
|
166
166
|
}).pipe(Effect.repeat(Schedule.spaced(options.pollInterval ?? Duration.minutes(1))), Effect.forkScoped);
|
|
167
167
|
return Service62.of({
|
|
168
168
|
create: Effect.fn("Workspace.create")(function* (input) {
|
|
169
|
-
const workspaceID = input.id ??
|
|
169
|
+
const workspaceID = input.id ?? ID8.create();
|
|
170
170
|
const existing = yield* db.select({ provider: WorkspaceTable2.provider }).from(WorkspaceTable2).where(eq(WorkspaceTable2.id, workspaceID)).get().pipe(Effect.orDie);
|
|
171
171
|
if (existing) {
|
|
172
172
|
if (existing.provider === input.provider)
|
|
@@ -244,4 +244,4 @@ var layer = (options) => Layer.effect(Service62, Effect.gen(function* () {
|
|
|
244
244
|
}));
|
|
245
245
|
var node64 = configured7();
|
|
246
246
|
|
|
247
|
-
export {
|
|
247
|
+
export { ID8, Info14, NotFound2, CreateConflict2, Service62, configured7, node64, exports_workspace };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// src/database/migration/20261029073502_session_time_busy.ts
|
|
2
|
+
import { Effect } from "effect";
|
|
3
|
+
var migration = {
|
|
4
|
+
id: "20261029073502_session_time_busy",
|
|
5
|
+
up(tx) {
|
|
6
|
+
return Effect.gen(function* () {
|
|
7
|
+
yield* tx.run(`ALTER TABLE \`session_v2\` ADD \`time_busy\` integer;`);
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
var _20261029073502_session_time_busy_default = migration;
|
|
12
|
+
|
|
13
|
+
export { _20261029073502_session_time_busy_default };
|