@dylanpiercey/work 0.0.72 → 0.0.74
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/{_BfXE8Kjn.js → _BDyG-m5v.js} +1225 -317
- package/dist/{_DXDmuFjC.js → _C4T3WOc-.js} +327 -293
- package/dist/{_Dq5wZ9y2.js → _JZKScK_6.js} +2 -2
- package/dist/_wbad_ZHd.js +2 -0
- package/dist/index.mjs +152 -939
- package/dist/public/assets/{_BLZtgkbJ2.js → _0_BxD6tA2.js} +1 -1
- package/dist/public/assets/_0_BxD6tA2.js.br +0 -0
- package/dist/public/assets/{_sUX0JPgf2.js → _B-ZLatX02.js} +1 -1
- package/dist/public/assets/_B-ZLatX02.js.br +0 -0
- package/dist/public/assets/{_CivjiEX92.js → _B-vJ063K2.js} +1 -1
- package/dist/public/assets/_B-vJ063K2.js.br +0 -0
- package/dist/public/assets/{_Drt_09zp.js → _B3-kV650.js} +1 -1
- package/dist/public/assets/_B3-kV650.js.br +0 -0
- package/dist/public/assets/{_-G0Dx3t52.js → _B6cp2Tnt2.js} +1 -1
- package/dist/public/assets/_B6cp2Tnt2.js.br +0 -0
- package/dist/public/assets/{_CTQouXRe.js → _B7qLfWk7.js} +1 -1
- package/dist/public/assets/_B7qLfWk7.js.br +0 -0
- package/dist/public/assets/{_DmLXUxIk.js → _B8yL5yfH.js} +1 -1
- package/dist/public/assets/_B8yL5yfH.js.br +0 -0
- package/dist/public/assets/{_DHelzj06.js → _BAM8hQx8.js} +1 -1
- package/dist/public/assets/_BAM8hQx8.js.br +0 -0
- package/dist/public/assets/{_ChkNS16f.js → _BCELU8uk.js} +1 -1
- package/dist/public/assets/_BCELU8uk.js.br +0 -0
- package/dist/public/assets/{_ckRann09.js → _BEsGJwj1.js} +1 -1
- package/dist/public/assets/_BEsGJwj1.js.br +0 -0
- package/dist/public/assets/{_C5VLAw4k2.js → _BIlkaSXj2.js} +1 -1
- package/dist/public/assets/_BIlkaSXj2.js.br +0 -0
- package/dist/public/assets/{_B7vYPsWj.js → _BRKdH0Xv.js} +1 -1
- package/dist/public/assets/_BRKdH0Xv.js.br +0 -0
- package/dist/public/assets/{_CuFX3MHy2.js → _BRrshe202.js} +1 -1
- package/dist/public/assets/{_CNClKCWp.js → _BSnpBPhR.js} +1 -1
- package/dist/public/assets/_BSnpBPhR.js.br +0 -0
- package/dist/public/assets/{_Csmr2y3G.js → _Bf8W6hR7.js} +1 -1
- package/dist/public/assets/_Bf8W6hR7.js.br +0 -0
- package/dist/public/assets/{_BE8lov_p2.js → _BjS-vjVo2.js} +1 -1
- package/dist/public/assets/_BjS-vjVo2.js.br +0 -0
- package/dist/public/assets/{_DjVNZ4eK2.js → _BsMtWEvw2.js} +1 -1
- package/dist/public/assets/_BsMtWEvw2.js.br +0 -0
- package/dist/public/assets/{_BSSf-PYx.js → _Bsi-MUb-.js} +1 -1
- package/dist/public/assets/_Bsi-MUb-.js.br +0 -0
- package/dist/public/assets/{_BpJS3XpY2.js → _C4OOpxns2.js} +1 -1
- package/dist/public/assets/_C4OOpxns2.js.br +0 -0
- package/dist/public/assets/{_BqE48K5c.js → _C4bcAkxw.js} +20 -20
- package/dist/public/assets/_C4bcAkxw.js.br +0 -0
- package/dist/public/assets/{_BkrDGdOx2.js → _CEjOmogC2.js} +1 -1
- package/dist/public/assets/_CEjOmogC2.js.br +0 -0
- package/dist/public/assets/{_BBWg58GJ2.js → _CHUg0ksH2.js} +1 -1
- package/dist/public/assets/_CHUg0ksH2.js.br +0 -0
- package/dist/public/assets/{_LdAm0jkh.js → _CJmkmGNg.js} +1 -1
- package/dist/public/assets/_CJmkmGNg.js.br +0 -0
- package/dist/public/assets/{_CfjckiVM2.js → _CKkkXYf42.js} +1 -1
- package/dist/public/assets/_CKkkXYf42.js.br +0 -0
- package/dist/public/assets/{_Y-mhaywp2.js → _CL6hsAgf2.js} +1 -1
- package/dist/public/assets/_CL6hsAgf2.js.br +0 -0
- package/dist/public/assets/{_UxrF5q9P.js → _CNHWN4ne.js} +1 -1
- package/dist/public/assets/_CNHWN4ne.js.br +0 -0
- package/dist/public/assets/{_vWJVVrmZ.js → _COQdreVN.js} +1 -1
- package/dist/public/assets/_COQdreVN.js.br +0 -0
- package/dist/public/assets/{_COZ91m9B.js → _CRzcId75.js} +1 -1
- package/dist/public/assets/_CRzcId75.js.br +0 -0
- package/dist/public/assets/{_snCcB5_5.js → _CSSWCImt.js} +1 -1
- package/dist/public/assets/_CSSWCImt.js.br +0 -0
- package/dist/public/assets/{_RF9fz9Iu.js → _CTIj6y6q.js} +1 -1
- package/dist/public/assets/_CTIj6y6q.js.br +0 -0
- package/dist/public/assets/{_D5nVZek7.js → _CVQsXn4K.js} +1 -1
- package/dist/public/assets/_CVQsXn4K.js.br +0 -0
- package/dist/public/assets/{_DX2Uab-U.js → _CY8DnUYp.js} +1 -1
- package/dist/public/assets/_CY8DnUYp.js.br +0 -0
- package/dist/public/assets/{_C82GEkZ4.js → _CbnLiunX.js} +1 -1
- package/dist/public/assets/_CbnLiunX.js.br +0 -0
- package/dist/public/assets/{_BGhBZpWT.js → _Ckz3mCrC.js} +1 -1
- package/dist/public/assets/_Ckz3mCrC.js.br +0 -0
- package/dist/public/assets/{_DAi07M7i.js → _Cl6zL1rb.js} +1 -1
- package/dist/public/assets/_Cl6zL1rb.js.br +0 -0
- package/dist/public/assets/{_CH2m75uw.js → _CmATrSbQ.js} +1 -1
- package/dist/public/assets/_CmATrSbQ.js.br +0 -0
- package/dist/public/assets/{_C41DPP-z2.js → _Cq4B-czG2.js} +1 -1
- package/dist/public/assets/_Cq4B-czG2.js.br +0 -0
- package/dist/public/assets/{_Dx6kLICJ.js → _CqJy9zqf.js} +1 -1
- package/dist/public/assets/_CqJy9zqf.js.br +0 -0
- package/dist/public/assets/{_BXzRffYj.js → _Cv5cB1Gc.js} +1 -1
- package/dist/public/assets/_Cv5cB1Gc.js.br +0 -0
- package/dist/public/assets/{_B61wm226.js → _CvqFUYec.js} +1 -1
- package/dist/public/assets/_CvqFUYec.js.br +0 -0
- package/dist/public/assets/{_f4WTM4Kz.js → _Cy4Qu_lY.js} +1 -1
- package/dist/public/assets/_Cy4Qu_lY.js.br +0 -0
- package/dist/public/assets/{_B_OOMZsL.js → _Cy6s-DjW.js} +1 -1
- package/dist/public/assets/_Cy6s-DjW.js.br +0 -0
- package/dist/public/assets/{_D1XJzdSj.js → _Cymp0KkN.js} +1 -1
- package/dist/public/assets/_Cymp0KkN.js.br +0 -0
- package/dist/public/assets/{_Bohi4mUp.js → _CzvbtXgZ.js} +1 -1
- package/dist/public/assets/_CzvbtXgZ.js.br +0 -0
- package/dist/public/assets/{_KFiFSJT8.js → _D-wyWmAu.js} +1 -1
- package/dist/public/assets/_D-wyWmAu.js.br +0 -0
- package/dist/public/assets/{_BRzgmRS2.js → _DAQlNNDT.js} +1 -1
- package/dist/public/assets/_DAQlNNDT.js.br +0 -0
- package/dist/public/assets/{_CV60RHGa.js → _DCLWmEuS.js} +1 -1
- package/dist/public/assets/_DCLWmEuS.js.br +0 -0
- package/dist/public/assets/{_CnIE6_qB2.js → _DHth5jay2.js} +1 -1
- package/dist/public/assets/_DHth5jay2.js.br +0 -0
- package/dist/public/assets/{_B7vLPjLl.js → _DI_ZoCy4.js} +1 -1
- package/dist/public/assets/_DI_ZoCy4.js.br +0 -0
- package/dist/public/assets/{_Clv6arvL.js → _DPPdU-Av.js} +1 -1
- package/dist/public/assets/_DPPdU-Av.js.br +0 -0
- package/dist/public/assets/{_Wxr28jKW.js → _DPfjt9fQ.js} +1 -1
- package/dist/public/assets/_DPfjt9fQ.js.br +0 -0
- package/dist/public/assets/{_BdVRHt6-.js → _DTZJyM9w.js} +1 -1
- package/dist/public/assets/_DTZJyM9w.js.br +0 -0
- package/dist/public/assets/{_B-xEEN4l2.js → _DXCkImvC2.js} +1 -1
- package/dist/public/assets/{_DFAhtXzm.js → _DdSK0SaL.js} +1 -1
- package/dist/public/assets/_DdSK0SaL.js.br +0 -0
- package/dist/public/assets/{_B0-ns0BU2.js → _Dim3Qa8e2.js} +1 -1
- package/dist/public/assets/_Dim3Qa8e2.js.br +0 -0
- package/dist/public/assets/{_DPL2ZCgQ.js → _DncKjJb4.js} +1 -1
- package/dist/public/assets/_DncKjJb4.js.br +0 -0
- package/dist/public/assets/{_wgItEK0c.js → _DsjVSWqF.js} +1 -1
- package/dist/public/assets/_DsjVSWqF.js.br +0 -0
- package/dist/public/assets/{_DshD8Ycc.js → _DwvzTp2-.js} +1 -1
- package/dist/public/assets/_DwvzTp2-.js.br +0 -0
- package/dist/public/assets/{_C-uc9hBA2.js → _DxrYm2uA2.js} +1 -1
- package/dist/public/assets/_DxrYm2uA2.js.br +0 -0
- package/dist/public/assets/{_B7OMjNs8.js → _DztmqTsm.js} +1 -1
- package/dist/public/assets/_DztmqTsm.js.br +0 -0
- package/dist/public/assets/{_DpENgSEx.js → _ETZIHvA2.js} +1 -1
- package/dist/public/assets/_ETZIHvA2.js.br +0 -0
- package/dist/public/assets/{_BKTem58K.js → _FgVKeYCS.js} +1 -1
- package/dist/public/assets/_FgVKeYCS.js.br +0 -0
- package/dist/public/assets/{_B5x1OTTu.js → _JL1loQ5W.js} +1 -1
- package/dist/public/assets/_JL1loQ5W.js.br +0 -0
- package/dist/public/assets/{_CWUF1FpI.js → _QP0MFlyi.js} +1 -1
- package/dist/public/assets/_QP0MFlyi.js.br +0 -0
- package/dist/public/assets/{_DvcpKhXL.js → _RZIVk7xV.js} +1 -1
- package/dist/public/assets/_RZIVk7xV.js.br +0 -0
- package/dist/public/assets/{_Bj5u_Vnk2.js → _RjnwisyN2.js} +1 -1
- package/dist/public/assets/_RjnwisyN2.js.br +0 -0
- package/dist/public/assets/{_BOQrg7gU2.js → _U11SdqZG2.js} +1 -1
- package/dist/public/assets/_U11SdqZG2.js.br +0 -0
- package/dist/public/assets/{_QPczAdMm2.js → _XSVpb5jO2.js} +1 -1
- package/dist/public/assets/_XSVpb5jO2.js.br +0 -0
- package/dist/public/assets/{_CifL_Zbh.js → _fDUiWXKb.js} +1 -1
- package/dist/public/assets/_fDUiWXKb.js.br +0 -0
- package/dist/public/assets/{_Dixad7y-2.js → _kVKsguoi2.js} +1 -1
- package/dist/public/assets/_kVKsguoi2.js.br +0 -0
- package/dist/public/assets/{_CYgKydU62.js → _o_bMNXwQ2.js} +1 -1
- package/dist/public/assets/_o_bMNXwQ2.js.br +0 -0
- package/dist/public/assets/{_DpCy3kYU.js → _tP5Jh-Ws.js} +45 -45
- package/dist/public/assets/_tP5Jh-Ws.js.br +0 -0
- package/dist/public/assets/{_c9sBllWt.js → _tpRUSSso.js} +1 -1
- package/dist/public/assets/_tpRUSSso.js.br +0 -0
- package/dist/public/assets/{_D-SthL18.js → _uEb-xDmI.js} +1 -1
- package/dist/public/assets/{_BUs7NMrG.js → _uKsdufG5.js} +1 -1
- package/dist/public/assets/_uKsdufG5.js.br +0 -0
- package/dist/public/assets/{_BTXq-nPh2.js → _vs0DFS9r2.js} +1 -1
- package/dist/public/assets/_vs0DFS9r2.js.br +0 -0
- package/dist/public/assets/{app-page-CAw2YLYv.css → app-page-KK8yJIbR.css} +1 -1
- package/dist/public/assets/app-page-KK8yJIbR.css.br +0 -0
- package/dist/public/assets/diff-view-TbHko8ib.css +1 -0
- package/dist/public/assets/diff-view-TbHko8ib.css.br +0 -0
- package/dist/public/assets/new-OSO__hUI.js +1 -0
- package/dist/public/assets/settings-OSO__hUI.js +1 -0
- package/dist/public/assets/w-OSO__hUI.js +1 -0
- package/dist/public/assets/w._-BVUaVdRa.js +1 -0
- package/dist/public/assets/w._-OSO__hUI.js +1 -0
- package/lib/setup/agents.json +66 -0
- package/lib/setup/catalog.d.mts +2 -0
- package/lib/setup/catalog.mjs +9 -10
- package/package.json +3 -3
- package/dist/_DLxkSyzt.js +0 -2
- package/dist/public/assets/_-G0Dx3t52.js.br +0 -0
- package/dist/public/assets/_B0-ns0BU2.js.br +0 -0
- package/dist/public/assets/_B5x1OTTu.js.br +0 -0
- package/dist/public/assets/_B61wm226.js.br +0 -0
- package/dist/public/assets/_B7OMjNs8.js.br +0 -0
- package/dist/public/assets/_B7vLPjLl.js.br +0 -0
- package/dist/public/assets/_B7vYPsWj.js.br +0 -0
- package/dist/public/assets/_BBWg58GJ2.js.br +0 -0
- package/dist/public/assets/_BE8lov_p2.js.br +0 -0
- package/dist/public/assets/_BGhBZpWT.js.br +0 -0
- package/dist/public/assets/_BKTem58K.js.br +0 -0
- package/dist/public/assets/_BLZtgkbJ2.js.br +0 -0
- package/dist/public/assets/_BOQrg7gU2.js.br +0 -0
- package/dist/public/assets/_BRzgmRS2.js.br +0 -0
- package/dist/public/assets/_BSSf-PYx.js.br +0 -0
- package/dist/public/assets/_BTXq-nPh2.js.br +0 -0
- package/dist/public/assets/_BUs7NMrG.js.br +0 -0
- package/dist/public/assets/_BXzRffYj.js.br +0 -0
- package/dist/public/assets/_B_OOMZsL.js.br +0 -0
- package/dist/public/assets/_BdVRHt6-.js.br +0 -0
- package/dist/public/assets/_Bj5u_Vnk2.js.br +0 -0
- package/dist/public/assets/_BkrDGdOx2.js.br +0 -0
- package/dist/public/assets/_Bohi4mUp.js.br +0 -0
- package/dist/public/assets/_BpJS3XpY2.js.br +0 -0
- package/dist/public/assets/_BqE48K5c.js.br +0 -0
- package/dist/public/assets/_C-uc9hBA2.js.br +0 -0
- package/dist/public/assets/_C41DPP-z2.js.br +0 -0
- package/dist/public/assets/_C5VLAw4k2.js.br +0 -0
- package/dist/public/assets/_C82GEkZ4.js.br +0 -0
- package/dist/public/assets/_CH2m75uw.js.br +0 -0
- package/dist/public/assets/_CNClKCWp.js.br +0 -0
- package/dist/public/assets/_COZ91m9B.js.br +0 -0
- package/dist/public/assets/_CTQouXRe.js.br +0 -0
- package/dist/public/assets/_CV60RHGa.js.br +0 -0
- package/dist/public/assets/_CWUF1FpI.js.br +0 -0
- package/dist/public/assets/_CYgKydU62.js.br +0 -0
- package/dist/public/assets/_CfjckiVM2.js.br +0 -0
- package/dist/public/assets/_ChkNS16f.js.br +0 -0
- package/dist/public/assets/_CifL_Zbh.js.br +0 -0
- package/dist/public/assets/_CivjiEX92.js.br +0 -0
- package/dist/public/assets/_Clv6arvL.js.br +0 -0
- package/dist/public/assets/_CnIE6_qB2.js.br +0 -0
- package/dist/public/assets/_Csmr2y3G.js.br +0 -0
- package/dist/public/assets/_D1XJzdSj.js.br +0 -0
- package/dist/public/assets/_D5nVZek7.js.br +0 -0
- package/dist/public/assets/_DAi07M7i.js.br +0 -10
- package/dist/public/assets/_DFAhtXzm.js.br +0 -0
- package/dist/public/assets/_DHelzj06.js.br +0 -0
- package/dist/public/assets/_DPL2ZCgQ.js.br +0 -5
- package/dist/public/assets/_DX2Uab-U.js.br +0 -0
- package/dist/public/assets/_Dixad7y-2.js.br +0 -0
- package/dist/public/assets/_DjVNZ4eK2.js.br +0 -0
- package/dist/public/assets/_DmLXUxIk.js.br +0 -0
- package/dist/public/assets/_DpCy3kYU.js.br +0 -0
- package/dist/public/assets/_DpENgSEx.js.br +0 -0
- package/dist/public/assets/_Drt_09zp.js.br +0 -0
- package/dist/public/assets/_DshD8Ycc.js.br +0 -0
- package/dist/public/assets/_DvcpKhXL.js.br +0 -0
- package/dist/public/assets/_Dx6kLICJ.js.br +0 -0
- package/dist/public/assets/_KFiFSJT8.js.br +0 -0
- package/dist/public/assets/_LdAm0jkh.js.br +0 -0
- package/dist/public/assets/_QPczAdMm2.js.br +0 -0
- package/dist/public/assets/_RF9fz9Iu.js.br +0 -0
- package/dist/public/assets/_UxrF5q9P.js.br +0 -0
- package/dist/public/assets/_Wxr28jKW.js.br +0 -0
- package/dist/public/assets/_Y-mhaywp2.js.br +0 -0
- package/dist/public/assets/_c9sBllWt.js.br +0 -0
- package/dist/public/assets/_ckRann09.js.br +0 -0
- package/dist/public/assets/_f4WTM4Kz.js.br +0 -0
- package/dist/public/assets/_sUX0JPgf2.js.br +0 -0
- package/dist/public/assets/_snCcB5_5.js.br +0 -0
- package/dist/public/assets/_vWJVVrmZ.js.br +0 -0
- package/dist/public/assets/_wgItEK0c.js.br +0 -0
- package/dist/public/assets/app-page-CAw2YLYv.css.br +0 -0
- package/dist/public/assets/diff-view-DCB49VYM.css +0 -1
- package/dist/public/assets/diff-view-DCB49VYM.css.br +0 -0
- package/dist/public/assets/new-C9qRFMyu.js +0 -1
- package/dist/public/assets/settings-C9qRFMyu.js +0 -1
- package/dist/public/assets/w-C9qRFMyu.js +0 -1
- package/dist/public/assets/w._-C9qRFMyu.js +0 -1
- package/dist/public/assets/w._-phpTDxP7.js +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "./_BMI-E3GI.js";
|
|
2
|
-
import { $ as
|
|
3
|
-
import { $ as _flush_head, A as metaTrunc, B as _attr_select_value, C as setPrimaryHost, Ct as _try, D as iconBtnRow, Dt as writeScope, Et as withPageAssets, F as _attr_class, G as _content, H as _attrs, K as _content_resume, L as _attr_input_value, M as tone, N as $global, O as iconBtnXs, P as _attr, Q as _existing_scope, R as _attr_option_value, S as repoWebUrl$1, St as _trailers, T as btnSm, Tt as attrTag, U as _attrs_partial, V as _attr_style, W as _await, X as _el_resume, Y as _el_read_error, Z as _escape, _ as sectionCount$1, _t as _show_end, at as _if, b as icon_base_default, bt as _template, c as sideNavOpen, ct as _resume_branch, d as rankRepos, dt as _scope_with_id, et as _for_of, f as icon_search_default, ft as _script, g as row, gt as _set_serialize_reason, h as iconBtn$2, ht as _serialize_if, it as _id, j as phase, k as inputLg, l as workspaceTab, lt as _scope_id, m as icon_refresh_default, mt as _serialize_guard, n as findInput, nt as _hoist_read_error, ot as _peek_scope_id, p as icon_back_default, pt as _sep, q as _dynamic_tag, r as icon_sidebar_default, rt as _html, s as setWorkspaceTab, st as _resume, t as findIconBtn, tt as _hoist, ut as _scope_reason, v as toast_default, vt as _show_start, w as btnLg, wt as _var, x as repoLabel, xt as _to_text, y as icon_xmark_default, yt as _subscribe, z as _attr_or } from "./
|
|
2
|
+
import { $ as DEFAULT_GITHUB_HOST, A as setScrapedPhase, B as allPrefs, C as agentBadge, D as agentMeta, E as agentLabel, F as publish, G as setDisabledAgents, H as enabledAgents, I as subscribe, J as doctor, K as setPref, L as subscriberCount, M as deleteSubscription, N as pushPublicKey, O as clearAgentPhase, P as saveSubscription, Q as which, R as subscriberJoins, S as blankRow, T as agentFromCommand, U as getSetting, V as disabledAgents, W as preferredAgent, X as miseVersions, Y as ghKnownHosts, Z as setupPath, _ as tmuxName, a as ensureTmuxServer, at as get, b as readHookPayload, c as killWorkspaceSessions, ct as gh, d as newSessionArgs, dt as tmux, et as TOOLS, ft as config, g as sessionStates, h as sendToSession, i as disposeSessions, it as db, j as setSessionViewers, k as setAgentPhase, l as listSessions, lt as git, m as renameSession, n as clearTmuxStarted, nt as toolById, o as getSession, ot as workspacePath, p as panePids, q as setSetting, r as createSession, rt as all, s as killSession, st as TMUX_SOCKET, t as cleanEnv, tt as agentById, u as markTmuxStarted, ut as run, v as tmuxWasStarted, w as agentFamily, x as reportsWorking, y as AGENTS, z as agentChoices } from "./_BDyG-m5v.js";
|
|
3
|
+
import { $ as _flush_head, A as metaTrunc, B as _attr_select_value, C as setPrimaryHost, Ct as _try, D as iconBtnRow, Dt as writeScope, Et as withPageAssets, F as _attr_class, G as _content, H as _attrs, K as _content_resume, L as _attr_input_value, M as tone, N as $global, O as iconBtnXs, P as _attr, Q as _existing_scope, R as _attr_option_value, S as repoWebUrl$1, St as _trailers, T as btnSm, Tt as attrTag, U as _attrs_partial, V as _attr_style, W as _await, X as _el_resume, Y as _el_read_error, Z as _escape, _ as sectionCount$1, _t as _show_end, at as _if, b as icon_base_default, bt as _template, c as sideNavOpen, ct as _resume_branch, d as rankRepos, dt as _scope_with_id, et as _for_of, f as icon_search_default, ft as _script, g as row, gt as _set_serialize_reason, h as iconBtn$2, ht as _serialize_if, it as _id, j as phase, k as inputLg, l as workspaceTab, lt as _scope_id, m as icon_refresh_default, mt as _serialize_guard, n as findInput, nt as _hoist_read_error, ot as _peek_scope_id, p as icon_back_default, pt as _sep, q as _dynamic_tag, r as icon_sidebar_default, rt as _html, s as setWorkspaceTab, st as _resume, t as findIconBtn, tt as _hoist, ut as _scope_reason, v as toast_default, vt as _show_start, w as btnLg, wt as _var, x as repoLabel, xt as _to_text, y as icon_xmark_default, yt as _subscribe, z as _attr_or } from "./_JZKScK_6.js";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import { createServer } from "node:http";
|
|
6
6
|
import path from "node:path";
|
|
@@ -10,7 +10,6 @@ import { Readable } from "node:stream";
|
|
|
10
10
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
11
11
|
import os from "node:os";
|
|
12
12
|
import { spawn } from "node:child_process";
|
|
13
|
-
import { DatabaseSync } from "node:sqlite";
|
|
14
13
|
import crypto, { createHash } from "node:crypto";
|
|
15
14
|
import fsp from "node:fs/promises";
|
|
16
15
|
import pty from "node-pty";
|
|
@@ -3133,67 +3132,10 @@ function coalesce(fn) {
|
|
|
3133
3132
|
};
|
|
3134
3133
|
}
|
|
3135
3134
|
//#endregion
|
|
3136
|
-
//#region src/client/agents.ts
|
|
3137
|
-
/** Agent instance ids are `<family><n?>` (`claude`, `claude2`) — see
|
|
3138
|
-
* lib/setup/catalog.mjs `parseAgentId`. This is the browser-side mirror for
|
|
3139
|
-
* icons, labels, and reading a shell's running command; the family table is
|
|
3140
|
-
* static so the client bundle needs no server round-trip. */
|
|
3141
|
-
var FAMILIES = {
|
|
3142
|
-
claude: {
|
|
3143
|
-
label: "Claude",
|
|
3144
|
-
bin: "claude"
|
|
3145
|
-
},
|
|
3146
|
-
codex: {
|
|
3147
|
-
label: "Codex",
|
|
3148
|
-
bin: "codex"
|
|
3149
|
-
},
|
|
3150
|
-
grok: {
|
|
3151
|
-
label: "Grok",
|
|
3152
|
-
bin: "grok"
|
|
3153
|
-
},
|
|
3154
|
-
copilot: {
|
|
3155
|
-
label: "Copilot",
|
|
3156
|
-
bin: "copilot"
|
|
3157
|
-
},
|
|
3158
|
-
cursor: {
|
|
3159
|
-
label: "Cursor",
|
|
3160
|
-
bin: "cursor-agent"
|
|
3161
|
-
}
|
|
3162
|
-
};
|
|
3163
|
-
function parseAgent(id) {
|
|
3164
|
-
const m = /^([a-z]+?)(\d*)$/.exec(id || "");
|
|
3165
|
-
return m && FAMILIES[m[1]] ? {
|
|
3166
|
-
family: m[1],
|
|
3167
|
-
suffix: m[2]
|
|
3168
|
-
} : null;
|
|
3169
|
-
}
|
|
3170
|
-
/** Icon family for an id — `shell` (or unknown) falls back to the prompt glyph. */
|
|
3171
|
-
function agentFamily(id) {
|
|
3172
|
-
return parseAgent(id)?.family ?? id;
|
|
3173
|
-
}
|
|
3174
|
-
/** Numeric suffix to badge on the icon; empty for the primary instance. */
|
|
3175
|
-
function agentBadge(id) {
|
|
3176
|
-
return parseAgent(id)?.suffix ?? "";
|
|
3177
|
-
}
|
|
3178
|
-
/** "Claude 2" / "Shell". */
|
|
3179
|
-
function agentLabel(id) {
|
|
3180
|
-
const p = parseAgent(id);
|
|
3181
|
-
if (!p) return id === "shell" ? "Shell" : id;
|
|
3182
|
-
return `${FAMILIES[p.family].label}${p.suffix ? ` ${p.suffix}` : ""}`;
|
|
3183
|
-
}
|
|
3184
|
-
/** Instance id for a running command (`cursor-agent2` → `cursor2`), or null. */
|
|
3185
|
-
function agentFromCommand(command) {
|
|
3186
|
-
for (const [family, { bin }] of Object.entries(FAMILIES)) {
|
|
3187
|
-
if (command === bin) return family;
|
|
3188
|
-
if (command.startsWith(bin) && /^\d+$/.test(command.slice(bin.length))) return `${family}${command.slice(bin.length)}`;
|
|
3189
|
-
}
|
|
3190
|
-
return null;
|
|
3191
|
-
}
|
|
3192
|
-
//#endregion
|
|
3193
3135
|
//#region src/tags/settings-page.css.ts
|
|
3194
|
-
var content$2 = "
|
|
3195
|
-
var agentGrid = "
|
|
3196
|
-
var toolGrid = "
|
|
3136
|
+
var content$2 = "_bV _bh _bi";
|
|
3137
|
+
var agentGrid = "_bZ _bs";
|
|
3138
|
+
var toolGrid = "_b9 _bs";
|
|
3197
3139
|
//#endregion
|
|
3198
3140
|
//#region src/tags/page-head.marko
|
|
3199
3141
|
var page_head_default = _template("o", (input) => {
|
|
@@ -3203,14 +3145,14 @@ var page_head_default = _template("o", (input) => {
|
|
|
3203
3145
|
_if(() => {
|
|
3204
3146
|
if (input.backHref) {
|
|
3205
3147
|
const $scope1_id = _scope_id();
|
|
3206
|
-
_html(`<a${_attr("href", input.backHref)}${_attr_class([iconBtnRow, "
|
|
3148
|
+
_html(`<a${_attr("href", input.backHref)}${_attr_class([iconBtnRow, "_cr"])}${_attr_or("title", input.backTitle, " title=\"Back (Esc)\"")}${_attr_or("aria-label", input.backTitle, " aria-label=Back")}>`);
|
|
3207
3149
|
icon_back_default({ size: 16 });
|
|
3208
3150
|
_html(`</a>${_el_resume($scope1_id, "a", _serialize_guard($scope0_reason, 0))}`);
|
|
3209
3151
|
_serialize_if($scope0_reason, 2) && writeScope($scope1_id, { _: _serialize_if($scope0_reason, 0) && _scope_with_id($scope0_id) });
|
|
3210
3152
|
return 0;
|
|
3211
3153
|
} else if (input.onBack) {
|
|
3212
3154
|
const $scope2_id = _scope_id();
|
|
3213
|
-
_html(`<button${_attr_class([iconBtnRow, "
|
|
3155
|
+
_html(`<button${_attr_class([iconBtnRow, "_cr"])}${_attr_or("title", input.backTitle, " title=\"Back (Esc)\"")}${_attr_or("aria-label", input.backTitle, " aria-label=Back")}>`);
|
|
3214
3156
|
icon_back_default({ size: 16 });
|
|
3215
3157
|
_html(`</button>${_el_resume($scope2_id, "a")}`);
|
|
3216
3158
|
_script($scope2_id, "o0");
|
|
@@ -3251,19 +3193,12 @@ var page_head_default = _template("o", (input) => {
|
|
|
3251
3193
|
});
|
|
3252
3194
|
//#endregion
|
|
3253
3195
|
//#region src/tags/icons/icon-agent.marko
|
|
3254
|
-
var PATHS = {
|
|
3255
|
-
claude: "M4.709 15.955l4.72-2.647.08-.23-.08-.128H9.2l-.79-.048-2.698-.073-2.339-.097-2.266-.122-.571-.121L0 11.784l.055-.352.48-.321.686.06 1.52.103 2.278.158 1.652.097 2.449.255h.389l.055-.157-.134-.098-.103-.097-2.358-1.596-2.552-1.688-1.336-.972-.724-.491-.364-.462-.158-1.008.656-.722.881.06.225.061.893.686 1.908 1.476 2.491 1.833.365.304.145-.103.019-.073-.164-.274-1.355-2.446-1.446-2.49-.644-1.032-.17-.619a2.97 2.97 0 01-.104-.729L6.283.134 6.696 0l.996.134.42.364.62 1.414 1.002 2.229 1.555 3.03.456.898.243.832.091.255h.158V9.01l.128-1.706.237-2.095.23-2.695.08-.76.376-.91.747-.492.584.28.48.685-.067.444-.286 1.851-.559 2.903-.364 1.942h.212l.243-.242.985-1.306 1.652-2.064.73-.82.85-.904.547-.431h1.033l.76 1.129-.34 1.166-1.064 1.347-.881 1.142-1.264 1.7-.79 1.36.073.11.188-.02 2.856-.606 1.543-.28 1.841-.315.833.388.091.395-.328.807-1.969.486-2.309.462-3.439.813-.042.03.049.061 1.549.146.662.036h1.622l3.02.225.79.522.474.638-.079.485-1.215.62-1.64-.389-3.829-.91-1.312-.329h-.182v.11l1.093 1.068 2.006 1.81 2.509 2.33.127.578-.322.455-.34-.049-2.205-1.657-.851-.747-1.926-1.62h-.128v.17l.444.649 2.345 3.521.122 1.08-.17.353-.608.213-.668-.122-1.374-1.925-1.415-2.167-1.143-1.943-.14.08-.674 7.254-.316.37-.729.28-.607-.461-.322-.747.322-1.476.389-1.924.315-1.53.286-1.9.17-.632-.012-.042-.14.018-1.434 1.967-2.18 2.945-1.726 1.845-.414.164-.717-.37.067-.662.401-.589 2.388-3.036 1.44-1.882.93-1.086-.006-.158h-.055L4.132 18.56l-1.13.146-.487-.456.061-.746.231-.243 1.908-1.312-.006.006z",
|
|
3256
|
-
codex: "M9.205 8.658v-2.26c0-.19.072-.333.238-.428l4.543-2.616c.619-.357 1.356-.523 2.117-.523 2.854 0 4.662 2.212 4.662 4.566 0 .167 0 .357-.024.547l-4.71-2.759a.797.797 0 00-.856 0l-5.97 3.473zm10.609 8.8V12.06c0-.333-.143-.57-.429-.737l-5.97-3.473 1.95-1.118a.433.433 0 01.476 0l4.543 2.617c1.309.76 2.189 2.378 2.189 3.948 0 1.808-1.07 3.473-2.76 4.163zM7.802 12.703l-1.95-1.142c-.167-.095-.239-.238-.239-.428V5.899c0-2.545 1.95-4.472 4.591-4.472 1 0 1.927.333 2.712.928L8.23 5.067c-.285.166-.428.404-.428.737v6.898zM12 15.128l-2.795-1.57v-3.33L12 8.658l2.795 1.57v3.33L12 15.128zm1.796 7.23c-1 0-1.927-.332-2.712-.927l4.686-2.712c.285-.166.428-.404.428-.737v-6.898l1.974 1.142c.167.095.238.238.238.428v5.233c0 2.545-1.974 4.472-4.614 4.472zm-5.637-5.303l-4.544-2.617c-1.308-.761-2.188-2.378-2.188-3.948A4.482 4.482 0 014.21 6.327v5.423c0 .333.143.571.428.738l5.947 3.449-1.95 1.118a.432.432 0 01-.476 0zm-.262 3.9c-2.688 0-4.662-2.021-4.662-4.519 0-.19.024-.38.047-.57l4.686 2.71c.286.167.571.167.856 0l5.97-3.448v2.26c0 .19-.07.333-.237.428l-4.543 2.616c-.619.357-1.356.523-2.117.523zm5.899 2.83a5.947 5.947 0 005.827-4.756C22.287 18.339 24 15.84 24 13.296c0-1.665-.713-3.282-1.998-4.448.119-.5.19-.999.19-1.498 0-3.401-2.759-5.947-5.946-5.947-.642 0-1.26.095-1.88.31A5.962 5.962 0 0010.205 0a5.947 5.947 0 00-5.827 4.757C1.713 5.447 0 7.945 0 10.49c0 1.666.713 3.283 1.998 4.448-.119.5-.19 1-.19 1.499 0 3.401 2.759 5.946 5.946 5.946.642 0 1.26-.095 1.88-.309a5.96 5.96 0 004.162 1.713z",
|
|
3257
|
-
grok: "M9.27 15.29l7.978-5.897c.391-.29.95-.177 1.137.272.98 2.369.542 5.215-1.41 7.169-1.951 1.954-4.667 2.382-7.149 1.406l-2.711 1.257c3.889 2.661 8.611 2.003 11.562-.953 2.341-2.344 3.066-5.539 2.388-8.42l.006.007c-.983-4.232.242-5.924 2.75-9.383.06-.082.12-.164.179-.248l-3.301 3.305v-.01L9.267 15.292M7.623 16.723c-2.792-2.67-2.31-6.801.071-9.184 1.761-1.763 4.647-2.483 7.166-1.425l2.705-1.25a7.808 7.808 0 00-1.829-1A8.975 8.975 0 005.984 5.83c-2.533 2.536-3.33 6.436-1.962 9.764 1.022 2.487-.653 4.246-2.34 6.022-.599.63-1.199 1.259-1.682 1.925l7.62-6.815",
|
|
3258
|
-
copilot: "M19.245 5.364c1.322 1.36 1.877 3.216 2.11 5.817.622 0 1.2.135 1.592.654l.73.964c.21.278.323.61.323.955v2.62c0 .339-.173.669-.453.868C20.239 19.602 16.157 21.5 12 21.5c-4.6 0-9.205-2.583-11.547-4.258-.28-.2-.452-.53-.453-.868v-2.62c0-.345.113-.679.321-.956l.73-.963c.392-.517.974-.654 1.593-.654l.029-.297c.25-2.446.81-4.213 2.082-5.52 2.461-2.54 5.71-2.851 7.146-2.864h.198c1.436.013 4.685.323 7.146 2.864zm-7.244 4.328c-.284 0-.613.016-.962.05-.123.447-.305.85-.57 1.108-1.05 1.023-2.316 1.18-2.994 1.18-.638 0-1.306-.13-1.851-.464-.516.165-1.012.403-1.044.996a65.882 65.882 0 00-.063 2.884l-.002.48c-.002.563-.005 1.126-.013 1.69.002.326.204.63.51.765 2.482 1.102 4.83 1.657 6.99 1.657 2.156 0 4.504-.555 6.985-1.657a.854.854 0 00.51-.766c.03-1.682.006-3.372-.076-5.053-.031-.596-.528-.83-1.046-.996-.546.333-1.212.464-1.85.464-.677 0-1.942-.157-2.993-1.18-.266-.258-.447-.661-.57-1.108-.32-.032-.64-.049-.96-.05zm-2.525 4.013c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zm5 0c.539 0 .976.426.976.95v1.753c0 .525-.437.95-.976.95a.964.964 0 01-.976-.95v-1.752c0-.525.437-.951.976-.951zM7.635 5.087c-1.05.102-1.935.438-2.385.906-.975 1.037-.765 3.668-.21 4.224.405.394 1.17.657 1.995.657h.09c.649-.013 1.785-.176 2.73-1.11.435-.41.705-1.433.675-2.47-.03-.834-.27-1.52-.63-1.813-.39-.336-1.275-.482-2.265-.394zm6.465.394c-.36.292-.6.98-.63 1.813-.03 1.037.24 2.06.675 2.47.968.957 2.136 1.104 2.776 1.11h.044c.825 0 1.59-.263 1.995-.657.555-.556.765-3.187-.21-4.224-.45-.468-1.335-.804-2.385-.906-.99-.088-1.875.058-2.265.394zM12 7.615c-.24 0-.525.015-.84.044.03.16.045.336.06.526l-.001.159a2.94 2.94 0 01-.014.25c.225-.022.425-.027.612-.028h.366c.187 0 .387.006.612.028-.015-.146-.015-.277-.015-.409.015-.19.03-.365.06-.526a9.29 9.29 0 00-.84-.044z",
|
|
3259
|
-
cursor: "M22.106 5.68L12.5.135a.998.998 0 00-.998 0L1.893 5.68a.84.84 0 00-.419.726v11.186c0 .3.16.577.42.727l9.607 5.547a.999.999 0 00.998 0l9.608-5.547a.84.84 0 00.42-.727V6.407a.84.84 0 00-.42-.726zm-.603 1.176L12.228 22.92c-.063.108-.228.064-.228-.061V12.34a.59.59 0 00-.295-.51l-9.11-5.26c-.107-.062-.063-.228.062-.228h18.55c.264 0 .428.286.296.514z"
|
|
3260
|
-
};
|
|
3261
3196
|
var icon_agent_default = _template("C", (input) => {
|
|
3262
3197
|
const $scope0_reason = _scope_reason(), $sg__input_agent = _serialize_guard($scope0_reason, 2), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0), $si__input_size__OR__input_class = _serialize_if($scope0_reason, 0), $si__input_size__OR__input_agent__OR__input_class = _serialize_if($scope0_reason, 1), $si__input_agent = _serialize_if($scope0_reason, 2);
|
|
3263
3198
|
const $scope0_id = _scope_id();
|
|
3264
3199
|
const $badge__closures = /* @__PURE__ */ new Set();
|
|
3265
3200
|
const size = input.size ?? 15;
|
|
3266
|
-
const d =
|
|
3201
|
+
const d = agentMeta(agentFamily(input.agent))?.icon;
|
|
3267
3202
|
const badge = agentBadge(input.agent);
|
|
3268
3203
|
_if(() => {
|
|
3269
3204
|
if (d) {
|
|
@@ -3308,7 +3243,7 @@ var icon_agent_default = _template("C", (input) => {
|
|
|
3308
3243
|
n: $badge__closures
|
|
3309
3244
|
});
|
|
3310
3245
|
});
|
|
3311
|
-
var usageNote = "
|
|
3246
|
+
var usageNote = "_cy _P";
|
|
3312
3247
|
//#endregion
|
|
3313
3248
|
//#region src/tags/usage-meters.marko
|
|
3314
3249
|
function duration(ms) {
|
|
@@ -3332,11 +3267,11 @@ var usage_meters_default = _template("z", (input) => {
|
|
|
3332
3267
|
const $scope0_reason = _scope_reason(), $sg__input_agent__OR__input_hideName = _serialize_guard($scope0_reason, 0), $sg__input_agent = _serialize_guard($scope0_reason, 1), $si__input_agent = _serialize_if($scope0_reason, 1), $sg__input_hideName = _serialize_guard($scope0_reason, 2), $si__input_agent__OR__input_hideName = _serialize_if($scope0_reason, 0);
|
|
3333
3268
|
const $scope0_id = _scope_id();
|
|
3334
3269
|
const agent = input.agent;
|
|
3335
|
-
_html(`<div${_attr_class(["
|
|
3270
|
+
_html(`<div${_attr_class(["_cs", { ["_ct"]: input.hideName }])}><div${_attr_class("_cu")}>`);
|
|
3336
3271
|
_if(() => {
|
|
3337
3272
|
if (!input.hideName) {
|
|
3338
3273
|
const $scope1_id = _scope_id();
|
|
3339
|
-
_html(`<strong${_attr_class("
|
|
3274
|
+
_html(`<strong${_attr_class("_cN")}>${_escape(agent.agent)}${_el_resume($scope1_id, "b", $sg__input_agent)}</strong>`);
|
|
3340
3275
|
$si__input_agent__OR__input_hideName && writeScope($scope1_id, { _: $si__input_agent && _scope_with_id($scope0_id) });
|
|
3341
3276
|
return 0;
|
|
3342
3277
|
}
|
|
@@ -3344,7 +3279,7 @@ var usage_meters_default = _template("z", (input) => {
|
|
|
3344
3279
|
_if(() => {
|
|
3345
3280
|
if (agent.plan && agent.plan.toLowerCase() !== agent.agent.toLowerCase()) {
|
|
3346
3281
|
const $scope2_id = _scope_id();
|
|
3347
|
-
_html(`<span${_attr_class("
|
|
3282
|
+
_html(`<span${_attr_class("_cv")}>${_escape(agent.plan.replace(/^default_/, "").replaceAll("_", " "))}${_el_resume($scope2_id, "b", $sg__input_agent)}</span>`);
|
|
3348
3283
|
$si__input_agent && writeScope($scope2_id, { _: _scope_with_id($scope0_id) });
|
|
3349
3284
|
return 0;
|
|
3350
3285
|
}
|
|
@@ -3352,19 +3287,19 @@ var usage_meters_default = _template("z", (input) => {
|
|
|
3352
3287
|
_if(() => {
|
|
3353
3288
|
if (agent.stale_seconds != null) {
|
|
3354
3289
|
const $scope3_id = _scope_id();
|
|
3355
|
-
_html(`<span${_attr_class("
|
|
3290
|
+
_html(`<span${_attr_class("_cw")}${_attr("title", `${agent.note || "provider unreachable"}. Last cached numbers, ${duration(agent.stale_seconds * 1e3)} old`)}>⚠ ${_sep($sg__input_agent)}${_escape(duration(agent.stale_seconds * 1e3))}${_el_resume($scope3_id, "b", $sg__input_agent)} old</span>${_el_resume($scope3_id, "a", $sg__input_agent)}`);
|
|
3356
3291
|
$si__input_agent && writeScope($scope3_id, { _: _scope_with_id($scope0_id) });
|
|
3357
3292
|
return 0;
|
|
3358
3293
|
}
|
|
3359
3294
|
}, $scope0_id, "e", $sg__input_agent, $sg__input_agent, $sg__input_agent__OR__input_hideName, 0, 1);
|
|
3360
|
-
_html(`</div><div${_attr_class(["
|
|
3295
|
+
_html(`</div><div${_attr_class(["_cx", { ["_cO"]: agent.stale_seconds != null }])}>`);
|
|
3361
3296
|
_for_of(agent.windows || [], (win) => {
|
|
3362
3297
|
const $scope4_id = _scope_id();
|
|
3363
3298
|
const pct = pctText$1(win.used_percent);
|
|
3364
3299
|
const label = resetLabel(win.resets_at, agent.stale_seconds != null);
|
|
3365
|
-
const fillClass = win.used_percent >= 90 ? "
|
|
3366
|
-
const pctClass = win.used_percent >= 90 ? "
|
|
3367
|
-
_html(`<div${_attr_class("
|
|
3300
|
+
const fillClass = win.used_percent >= 90 ? "_cG" : win.used_percent >= 70 ? "_cF" : win.used_percent >= 40 ? "_cE" : "_cD";
|
|
3301
|
+
const pctClass = win.used_percent >= 90 ? "_cL" : win.used_percent >= 70 ? "_cK" : win.used_percent >= 40 ? "_cJ" : "_cI";
|
|
3302
|
+
_html(`<div${_attr_class("_cz")}${_attr("title", `${win.window}: ${pct} used${win.resets_at ? `, resets ${new Date(win.resets_at).toLocaleString()}` : ""}`)}><span${_attr_class("_cA")}>${_escape(win.window)}${_el_resume($scope4_id, "c", $sg__input_agent)}</span><span${_attr_class("_cB")}><span${_attr_class(["_cC", fillClass])}${_attr_style(`width:${Math.min(100, Math.max(2, win.used_percent))}%`)}></span>${_el_resume($scope4_id, "e", $sg__input_agent)}</span><span${_attr_class(["_cH", pctClass])}>${_escape(pct)}${_el_resume($scope4_id, "g", $sg__input_agent)}</span>${_el_resume($scope4_id, "f", $sg__input_agent)}<span${_attr_class("_cM")}>${label ? `↻ ${_escape(`${_to_text(label)}`)}` : ""}${_el_resume($scope4_id, "i", $sg__input_agent)}</span></div>${_el_resume($scope4_id, "a", $sg__input_agent)}`);
|
|
3368
3303
|
$si__input_agent && writeScope($scope4_id, { _: _scope_with_id($scope0_id) });
|
|
3369
3304
|
}, "window", $scope0_id, "g", $sg__input_agent, $sg__input_agent, $sg__input_agent, 0, 1);
|
|
3370
3305
|
_if(() => {
|
|
@@ -3423,7 +3358,7 @@ var modal_view_default = _template("m", (input) => {
|
|
|
3423
3358
|
const { label, class: inputClass, open: _open, openChange: _openChange, dismissable: _dismissable, content, footer, closedby: _closedby, onCancel: _onCancel, onClose: _onClose, "aria-label": inputAriaLabel, "aria-labelledby": inputLabelledBy, ...htmlInput } = input;
|
|
3424
3359
|
const dismissable = input.dismissable !== false;
|
|
3425
3360
|
let open = input.open;
|
|
3426
|
-
_html(`<dialog${_attr_class(["
|
|
3361
|
+
_html(`<dialog${_attr_class(["_c2", inputClass])}${_attr("aria-labelledby", inputLabelledBy)}${inputLabelledBy ? _attr("aria-label", inputAriaLabel) : _attr("aria-label", inputAriaLabel || label)} closedby=${dismissable ? "any" : "none"}${_attrs_partial({
|
|
3427
3362
|
...htmlInput,
|
|
3428
3363
|
open: null
|
|
3429
3364
|
}, {
|
|
@@ -3433,20 +3368,20 @@ var modal_view_default = _template("m", (input) => {
|
|
|
3433
3368
|
closedby: 1,
|
|
3434
3369
|
"on-cancel": 1,
|
|
3435
3370
|
"on-close": 1
|
|
3436
|
-
}, "a", $scope0_id, "dialog")}><div${_attr_class("
|
|
3371
|
+
}, "a", $scope0_id, "dialog")}><div${_attr_class("_c3")}>`);
|
|
3437
3372
|
_dynamic_tag($scope0_id, "c", content, {}, 0, 0, _serialize_guard($scope0_reason, 6));
|
|
3438
3373
|
_html("</div>");
|
|
3439
3374
|
_if(() => {
|
|
3440
3375
|
if (footer) {
|
|
3441
3376
|
const $scope1_id = _scope_id();
|
|
3442
|
-
_html(`<form method=dialog${_attr_class("
|
|
3377
|
+
_html(`<form method=dialog${_attr_class("_c4")}>`);
|
|
3443
3378
|
_dynamic_tag($scope1_id, "b", footer.content, {}, 0, 0, _serialize_guard($scope0_reason, 7));
|
|
3444
3379
|
_html("</form>");
|
|
3445
3380
|
$si__input_openChange__OR__input_footer && writeScope($scope1_id, { _: _serialize_if($scope0_reason, 7) && _scope_with_id($scope0_id) });
|
|
3446
3381
|
return 0;
|
|
3447
3382
|
} else if (input.openChange) {
|
|
3448
3383
|
const $scope2_id = _scope_id();
|
|
3449
|
-
_html(`<form method=dialog${_attr_class("
|
|
3384
|
+
_html(`<form method=dialog${_attr_class("_c4")}>`);
|
|
3450
3385
|
dialog_close_default({
|
|
3451
3386
|
class: ["_l", "_m"],
|
|
3452
3387
|
content: _content("m0", () => {
|
|
@@ -3505,7 +3440,7 @@ var prompt_dialog_default = _template("p", (input) => {
|
|
|
3505
3440
|
const $childScope = _peek_scope_id();
|
|
3506
3441
|
modal_view_default({
|
|
3507
3442
|
label: input.label,
|
|
3508
|
-
class: "
|
|
3443
|
+
class: "_cp",
|
|
3509
3444
|
open: input.open,
|
|
3510
3445
|
openChange: input.openChange,
|
|
3511
3446
|
"aria-labelledby": titleId,
|
|
@@ -3528,7 +3463,7 @@ var prompt_dialog_default = _template("p", (input) => {
|
|
|
3528
3463
|
content: _content("p6", () => {
|
|
3529
3464
|
_scope_reason();
|
|
3530
3465
|
const $scope2_id = _scope_id();
|
|
3531
|
-
_html(`<h2${_attr_class("
|
|
3466
|
+
_html(`<h2${_attr_class("_cq")}${_attr("id", titleId)}>${_escape(input.label)}${_el_resume($scope2_id, "b", $sg__input_label)}</h2><input${_attr_input_value($scope2_id, "c", value, _resume((_new_value) => {
|
|
3532
3467
|
value = _new_value;
|
|
3533
3468
|
}, "p0", $scope2_id))}${_attr("placeholder", input.placeholder)}>${_el_resume($scope2_id, "c")}`);
|
|
3534
3469
|
_script($scope2_id, "p4");
|
|
@@ -3791,12 +3726,12 @@ var settings_page_default = _template("s", (input) => {
|
|
|
3791
3726
|
return 0;
|
|
3792
3727
|
} else if (setup.ready) {
|
|
3793
3728
|
const $scope43_id = _scope_id();
|
|
3794
|
-
_html(`<span${_attr_class("
|
|
3729
|
+
_html(`<span${_attr_class("_bX")}>Ready</span>. Tools, GitHub, and an agent are all in place.`);
|
|
3795
3730
|
writeScope($scope43_id, {});
|
|
3796
3731
|
return 1;
|
|
3797
3732
|
} else {
|
|
3798
3733
|
const $scope5_id = _scope_id();
|
|
3799
|
-
_html(`<span${_attr_class("
|
|
3734
|
+
_html(`<span${_attr_class("_bY")}>Not ready</span>. Missing <!>${_escape(setup.missing.map((m) => MISSING_LABEL[m] || m).join(", "))}${_el_resume($scope5_id, "b")}.`);
|
|
3800
3735
|
_subscribe($setup_missing__closures, writeScope($scope5_id, {}));
|
|
3801
3736
|
return 2;
|
|
3802
3737
|
}
|
|
@@ -3843,11 +3778,11 @@ var settings_page_default = _template("s", (input) => {
|
|
|
3843
3778
|
return 0;
|
|
3844
3779
|
}
|
|
3845
3780
|
}, $scope0_id, "e", 1, 1, 1, 0, 1);
|
|
3846
|
-
_html(`<section${_attr_class("_bp")}${_attr("aria-labelledby", agentsId)}><div${_attr_class("_bq")}><h2${_attr("id", agentsId)}${_attr_class("_bE")}>Agents</h2><div${_attr_class("_v")}></div><label${_attr_class("
|
|
3781
|
+
_html(`<section${_attr_class("_bp")}${_attr("aria-labelledby", agentsId)}><div${_attr_class("_bq")}><h2${_attr("id", agentsId)}${_attr_class("_bE")}>Agents</h2><div${_attr_class("_v")}></div><label${_attr_class("_b1")}><span${_attr_class("_P")}>Default</span><span${_attr_class("_j")}>`);
|
|
3847
3782
|
_attr_select_value($scope0_id, "m", input.preferred, _resume(function(v) {
|
|
3848
3783
|
setPreferred(v);
|
|
3849
3784
|
}, "s1", $scope0_id), () => {
|
|
3850
|
-
_html(`<select${_attr_class(["_k", "
|
|
3785
|
+
_html(`<select${_attr_class(["_k", "_b2"])} aria-label="Default agent (starts when a workspace has no session yet)" title="Starts when a workspace has no session yet">`);
|
|
3851
3786
|
_for_of(input.agents.filter((a) => a !== "shell"), (id) => {
|
|
3852
3787
|
const $scope44_id = _scope_id();
|
|
3853
3788
|
_html(`<option${_attr_option_value(id)}>${_escape(agentLabel(id))}${_el_resume($scope44_id, "b", $sg__input_agents)}</option>${_el_resume($scope44_id, "a", $sg__input_agents)}`);
|
|
@@ -3868,7 +3803,7 @@ var settings_page_default = _template("s", (input) => {
|
|
|
3868
3803
|
const rows = lone ? [] : a.instances;
|
|
3869
3804
|
const loneAccounts = lone && lone.enabled ? accountsFor(lone.id) : [];
|
|
3870
3805
|
const extraAccounts = a.installed ? strayAccountsFor(a) : [];
|
|
3871
|
-
_html(`<li${_attr_class(["_bu", "
|
|
3806
|
+
_html(`<li${_attr_class(["_bu", "_b0"])}><div${_attr_class(["_b3", { ["_b6"]: lone && !lone.enabled }])}>`);
|
|
3872
3807
|
_set_serialize_reason(12);
|
|
3873
3808
|
const $childScope4 = _peek_scope_id();
|
|
3874
3809
|
icon_agent_default({
|
|
@@ -3888,7 +3823,7 @@ var settings_page_default = _template("s", (input) => {
|
|
|
3888
3823
|
_if(() => {
|
|
3889
3824
|
if (active.has(a.id)) {
|
|
3890
3825
|
const $scope10_id = _scope_id();
|
|
3891
|
-
_html(`<span${_attr_class("
|
|
3826
|
+
_html(`<span${_attr_class("_bW")}><span${_attr_class("_C")}></span><!>${_escape(active.get(a.id) || "Starting…")}${_el_resume($scope10_id, "c")}</span>`);
|
|
3892
3827
|
_subscribe($active__closures, writeScope($scope10_id, {}));
|
|
3893
3828
|
return 0;
|
|
3894
3829
|
} else if (!a.installed) {
|
|
@@ -3925,18 +3860,18 @@ var settings_page_default = _template("s", (input) => {
|
|
|
3925
3860
|
_if(() => {
|
|
3926
3861
|
if (rows.length || loneAccounts.length || extraAccounts.length) {
|
|
3927
3862
|
const $scope2_id = _scope_id();
|
|
3928
|
-
_html(`<ul${_attr_class("
|
|
3863
|
+
_html(`<ul${_attr_class("_b8")}>`);
|
|
3929
3864
|
_for_of(rows, (inst) => {
|
|
3930
3865
|
const $scope3_id = _scope_id();
|
|
3931
3866
|
const accounts = inst.enabled ? accountsFor(inst.id) : [];
|
|
3932
|
-
_html(`<li${_attr_class("
|
|
3867
|
+
_html(`<li${_attr_class("_b4")}><div${_attr_class(["_b5", { ["_b6"]: !inst.enabled }])}>`);
|
|
3933
3868
|
_set_serialize_reason(12);
|
|
3934
3869
|
const $childScope5 = _peek_scope_id();
|
|
3935
3870
|
icon_agent_default({
|
|
3936
3871
|
agent: inst.id,
|
|
3937
3872
|
size: 15
|
|
3938
3873
|
});
|
|
3939
|
-
_html(`<span${_attr_class(["
|
|
3874
|
+
_html(`<span${_attr_class(["_b7", "_u"])}>${_escape(inst.command)}${_el_resume($scope3_id, "e")}</span>`);
|
|
3940
3875
|
_if(() => {
|
|
3941
3876
|
if (input.preferred === inst.id) {
|
|
3942
3877
|
const $scope47_id = _scope_id();
|
|
@@ -4011,7 +3946,7 @@ var settings_page_default = _template("s", (input) => {
|
|
|
4011
3946
|
}, "id", $scope0_id, "q", 1, 1, 1, 0, 1);
|
|
4012
3947
|
_for_of(otherUsage, (u) => {
|
|
4013
3948
|
const $scope51_id = _scope_id();
|
|
4014
|
-
_html(`<li${_attr_class(["_bu", "
|
|
3949
|
+
_html(`<li${_attr_class(["_bu", "_b0"])}>`);
|
|
4015
3950
|
_set_serialize_reason(6);
|
|
4016
3951
|
const $childScope9 = _peek_scope_id();
|
|
4017
3952
|
usage_meters_default({ agent: u });
|
|
@@ -4049,12 +3984,12 @@ var settings_page_default = _template("s", (input) => {
|
|
|
4049
3984
|
_if(() => {
|
|
4050
3985
|
if (active.has(h.host) && authCodes.has(h.host)) {
|
|
4051
3986
|
const $scope22_id = _scope_id();
|
|
4052
|
-
_html(`<span${_attr_class("
|
|
3987
|
+
_html(`<span${_attr_class("_bW")}><span${_attr_class("_C")}></span> Enter code <strong${_attr_class("_cf")}>${_escape(authCodes.get(h.host))}${_el_resume($scope22_id, "d")}</strong> at <a${_attr("href", `https://${h.host}/login/device`)} target=_blank rel=noopener${_attr_class("_cg")}>${_escape(h.host)}${_el_resume($scope22_id, "f")}/login/device</a>${_el_resume($scope22_id, "e")}</span>`);
|
|
4053
3988
|
_subscribe($authCodes__closures, writeScope($scope22_id, {}));
|
|
4054
3989
|
return 0;
|
|
4055
3990
|
} else if (active.has(h.host)) {
|
|
4056
3991
|
const $scope12_id = _scope_id();
|
|
4057
|
-
_html(`<span${_attr_class("
|
|
3992
|
+
_html(`<span${_attr_class("_bW")}><span${_attr_class("_C")}></span><!>${_escape(active.get(h.host) || "Starting…")}${_el_resume($scope12_id, "c")}</span>`);
|
|
4058
3993
|
_subscribe($active__closures, writeScope($scope12_id, { Cck: 1 }));
|
|
4059
3994
|
return 1;
|
|
4060
3995
|
} else if (h.authed) {
|
|
@@ -4146,7 +4081,7 @@ var settings_page_default = _template("s", (input) => {
|
|
|
4146
4081
|
_if(() => {
|
|
4147
4082
|
if (setup) {
|
|
4148
4083
|
const $scope33_id = _scope_id();
|
|
4149
|
-
_html(`<form${_attr_class("
|
|
4084
|
+
_html(`<form${_attr_class("_ce")}><label${_attr_class("_T")}>`);
|
|
4150
4085
|
icon_plus_default({
|
|
4151
4086
|
size: 14,
|
|
4152
4087
|
class: "_U"
|
|
@@ -4213,11 +4148,11 @@ var settings_page_default = _template("s", (input) => {
|
|
|
4213
4148
|
const $for_content4__t_path__closures = /* @__PURE__ */ new Set();
|
|
4214
4149
|
const $for_content4__t_latest__closures = /* @__PURE__ */ new Set();
|
|
4215
4150
|
const $for_content4__t_id__closures = /* @__PURE__ */ new Set();
|
|
4216
|
-
_html(`<li${_attr_class([row, { ["
|
|
4151
|
+
_html(`<li${_attr_class([row, { ["_b_"]: !t.installed }])}><span${_attr_class(["_ca", "_u"])}>${_escape(t.label)}${_el_resume($scope16_id, "c")}</span>`);
|
|
4217
4152
|
_if(() => {
|
|
4218
4153
|
if (active.has(t.id)) {
|
|
4219
4154
|
const $scope17_id = _scope_id();
|
|
4220
|
-
_html(`<span${_attr_class("
|
|
4155
|
+
_html(`<span${_attr_class("_bW")}><span${_attr_class("_C")}></span><!>${_escape(active.get(t.id) || "Starting…")}${_el_resume($scope17_id, "c")}</span>`);
|
|
4221
4156
|
_subscribe($active__closures, writeScope($scope17_id, { Cck: 2 }));
|
|
4222
4157
|
return 0;
|
|
4223
4158
|
} else if (t.installed) {
|
|
@@ -4225,7 +4160,7 @@ var settings_page_default = _template("s", (input) => {
|
|
|
4225
4160
|
_if(() => {
|
|
4226
4161
|
if (t.version) {
|
|
4227
4162
|
const $scope30_id = _scope_id();
|
|
4228
|
-
_html(`<button${_attr_class(["
|
|
4163
|
+
_html(`<button${_attr_class(["_cb", "_u"])}${_attr("title", `${t.path || t.label}. Pin a version`)}>v<!>${_escape(t.version)}${_el_resume($scope30_id, "b")}</button>${_el_resume($scope30_id, "a")}`);
|
|
4229
4164
|
_script($scope30_id, "s36");
|
|
4230
4165
|
_subscribe($for_content4__t_path__closures, _subscribe($for_content4__t_version__closures, _subscribe($for_content4__t_label__closures, writeScope($scope30_id, { Cu: 1 }))));
|
|
4231
4166
|
return 0;
|
|
@@ -4239,7 +4174,7 @@ var settings_page_default = _template("s", (input) => {
|
|
|
4239
4174
|
_if(() => {
|
|
4240
4175
|
if (outdated(t)) {
|
|
4241
4176
|
const $scope37_id = _scope_id();
|
|
4242
|
-
_html(`<button${_attr_class([btnSm, "
|
|
4177
|
+
_html(`<button${_attr_class([btnSm, "_cc"])}${_attr("title", `Update to v${t.latest}`)}>↑ <!>${_escape(t.latest)}${_el_resume($scope37_id, "b")}</button>${_el_resume($scope37_id, "a")}`);
|
|
4243
4178
|
_script($scope37_id, "s37");
|
|
4244
4179
|
_subscribe($for_content4__t_latest__closures, writeScope($scope37_id, {}));
|
|
4245
4180
|
return 0;
|
|
@@ -4338,14 +4273,14 @@ var settings_page_default = _template("s", (input) => {
|
|
|
4338
4273
|
_if(() => {
|
|
4339
4274
|
if (hits && hits.length) {
|
|
4340
4275
|
const $scope19_id = _scope_id();
|
|
4341
|
-
_html(`<ul${_attr_class([toolGrid, "
|
|
4276
|
+
_html(`<ul${_attr_class([toolGrid, "_cd"])}>`);
|
|
4342
4277
|
_for_of(hits, (h) => {
|
|
4343
4278
|
const $scope20_id = _scope_id();
|
|
4344
|
-
_html(`<li${_attr_class(row)}><div${_attr_class("_bv")}><span${_attr_class(["
|
|
4279
|
+
_html(`<li${_attr_class(row)}><div${_attr_class("_bv")}><span${_attr_class(["_ca", "_u"])}>${_escape(h.name)}${_el_resume($scope20_id, "d")}</span>`);
|
|
4345
4280
|
_if(() => {
|
|
4346
4281
|
if (active.has(h.name)) {
|
|
4347
4282
|
const $scope21_id = _scope_id();
|
|
4348
|
-
_html(`<span${_attr_class("
|
|
4283
|
+
_html(`<span${_attr_class("_bW")}><span${_attr_class("_C")}></span><!>${_escape(active.get(h.name) || "Starting…")}${_el_resume($scope21_id, "c")}</span>`);
|
|
4349
4284
|
_subscribe($active__closures, writeScope($scope21_id, { Cck: 4 }));
|
|
4350
4285
|
return 0;
|
|
4351
4286
|
} else if (h.description) {
|
|
@@ -4501,8 +4436,8 @@ var curBase = "_bN _Q _P";
|
|
|
4501
4436
|
var archived = "_bR _bp";
|
|
4502
4437
|
var archivedHint = "_bS _P";
|
|
4503
4438
|
var archivedCard = "_bT _bu";
|
|
4504
|
-
var resultBranch = "
|
|
4505
|
-
var branchInput = "
|
|
4439
|
+
var resultBranch = "_cV _W _g";
|
|
4440
|
+
var branchInput = "_c0 _S _R";
|
|
4506
4441
|
//#endregion
|
|
4507
4442
|
//#region src/tags/repo-picker.marko
|
|
4508
4443
|
var api$5;
|
|
@@ -4552,7 +4487,7 @@ var repo_picker_default = _template("q", (input) => {
|
|
|
4552
4487
|
input.onError?.(String(err.message || err));
|
|
4553
4488
|
}
|
|
4554
4489
|
}, "q5", $scope0_id);
|
|
4555
|
-
_html(`<div${_attr_class("
|
|
4490
|
+
_html(`<div${_attr_class("_cP")}><label${_attr_class("_T")}>`);
|
|
4556
4491
|
icon_search_default({
|
|
4557
4492
|
size: 14,
|
|
4558
4493
|
class: "_U"
|
|
@@ -4572,19 +4507,19 @@ var repo_picker_default = _template("q", (input) => {
|
|
|
4572
4507
|
_if(() => {
|
|
4573
4508
|
if (results.length) {
|
|
4574
4509
|
const $scope2_id = _scope_id();
|
|
4575
|
-
_html(`<ul${_attr_class("
|
|
4510
|
+
_html(`<ul${_attr_class("_cQ")}>`);
|
|
4576
4511
|
_for_of(results, (repo, i) => {
|
|
4577
4512
|
const $scope3_id = _scope_id();
|
|
4578
|
-
_html(`<li><div${_attr_class(["
|
|
4513
|
+
_html(`<li><div${_attr_class(["_cS", { ["_cR"]: i === highlight }])}><button${_attr_class("_cT")}>`);
|
|
4579
4514
|
icon_plus_default({
|
|
4580
4515
|
size: 12,
|
|
4581
|
-
class: "
|
|
4516
|
+
class: "_cY"
|
|
4582
4517
|
});
|
|
4583
|
-
_html(`<span${_attr_class("
|
|
4518
|
+
_html(`<span${_attr_class("_cZ")}>${_escape(repoLabel(repo.nameWithOwner))}${_el_resume($scope3_id, "e")}</span></button>${_el_resume($scope3_id, "b")}<button${_attr_class([resultBranch, { ["_cU"]: branchesFor === repo.nameWithOwner }])}${_attr("title", `Pick a base branch for ${repo.nameWithOwner}`)}${_attr("aria-label", `Pick a base branch for ${repo.nameWithOwner}`)}>⎇</button>${_el_resume($scope3_id, "f")}</div>${_el_resume($scope3_id, "a")}`);
|
|
4584
4519
|
_if(() => {
|
|
4585
4520
|
if (branchesFor === repo.nameWithOwner) {
|
|
4586
4521
|
const $scope4_id = _scope_id();
|
|
4587
|
-
_html(`<div${_attr_class("
|
|
4522
|
+
_html(`<div${_attr_class("_cW")}>`);
|
|
4588
4523
|
_if(() => {
|
|
4589
4524
|
if (!branches) {
|
|
4590
4525
|
const $scope9_id = _scope_id();
|
|
@@ -4605,10 +4540,10 @@ var repo_picker_default = _template("q", (input) => {
|
|
|
4605
4540
|
}
|
|
4606
4541
|
}, $scope5_id, "a", 1, 1, 1, 0, 1);
|
|
4607
4542
|
const shown = (branchFilter ? branches.filter((b) => b.toLowerCase().includes(branchFilter.toLowerCase())) : branches).slice(0, 12);
|
|
4608
|
-
_html(`<ul${_attr_class("
|
|
4543
|
+
_html(`<ul${_attr_class("_cX")}>`);
|
|
4609
4544
|
_for_of(shown, (branch) => {
|
|
4610
4545
|
const $scope7_id = _scope_id();
|
|
4611
|
-
_html(`<li><button${_attr_class(["
|
|
4546
|
+
_html(`<li><button${_attr_class(["_cT", "_c1"])}><span${_attr_class(["_cZ", "_u"])}>${_escape(branch)}${_el_resume($scope7_id, "c")}</span></button>${_el_resume($scope7_id, "a")}</li>`);
|
|
4612
4547
|
_script($scope7_id, "q7");
|
|
4613
4548
|
writeScope($scope7_id, { e: branch });
|
|
4614
4549
|
}, (b) => b, $scope5_id, "c", 1, 1, 1, 0, 1);
|
|
@@ -5041,8 +4976,8 @@ function activeAgent(session) {
|
|
|
5041
4976
|
const command = session.state?.command?.trim();
|
|
5042
4977
|
return command && agentFromCommand(command) || session.agent;
|
|
5043
4978
|
}
|
|
5044
|
-
var iconBtn$1 = "
|
|
5045
|
-
var navToggle = "
|
|
4979
|
+
var iconBtn$1 = "_dg _g";
|
|
4980
|
+
var navToggle = "_dl _g";
|
|
5046
4981
|
_template("F", (input) => {
|
|
5047
4982
|
const $scope0_reason = _scope_reason(), $sg__input_size__OR__input_class = _serialize_guard($scope0_reason, 0);
|
|
5048
4983
|
const $scope0_id = _scope_id();
|
|
@@ -5085,12 +5020,12 @@ var ARM_MS = 3500;
|
|
|
5085
5020
|
function disarmLater(fn) {
|
|
5086
5021
|
return setTimeout(fn, ARM_MS);
|
|
5087
5022
|
}
|
|
5088
|
-
var railBtn = "
|
|
5089
|
-
var rowIcon = "
|
|
5090
|
-
var close = "
|
|
5023
|
+
var railBtn = "_fy _g";
|
|
5024
|
+
var rowIcon = "_fH _W _g";
|
|
5025
|
+
var close = "_fI _W _g _Z";
|
|
5091
5026
|
//#endregion
|
|
5092
5027
|
//#region src/styles/session-pop.css.ts
|
|
5093
|
-
var sessionPop = "
|
|
5028
|
+
var sessionPop = "_e2 _1";
|
|
5094
5029
|
//#endregion
|
|
5095
5030
|
//#region src/client/usage.ts
|
|
5096
5031
|
/** The plan row an agent instance draws on: its own account (`claude2`)
|
|
@@ -5151,21 +5086,21 @@ var usage_pcts_default = _template("A", (input) => {
|
|
|
5151
5086
|
if (windows.length) {
|
|
5152
5087
|
const $scope1_id = _scope_id();
|
|
5153
5088
|
_html(`<span${_attr_class([
|
|
5154
|
-
"
|
|
5089
|
+
"_eW",
|
|
5155
5090
|
input.class,
|
|
5156
|
-
{ ["
|
|
5091
|
+
{ ["_eX"]: agent.stale_seconds != null }
|
|
5157
5092
|
])}${agent.stale_seconds != null ? _attr("title", `${agent.note || "provider unreachable"}; last cached numbers`) : " title=\"Plan usage\""}>`);
|
|
5158
5093
|
_for_of(windows, (win$1, i) => {
|
|
5159
5094
|
const $scope2_id = _scope_id();
|
|
5160
5095
|
_if(() => {
|
|
5161
5096
|
if (i) {
|
|
5162
5097
|
const $scope3_id = _scope_id();
|
|
5163
|
-
_html(`<span${_attr_class("
|
|
5098
|
+
_html(`<span${_attr_class("_e1")} aria-hidden=true>·</span>`);
|
|
5164
5099
|
$si__input_agent && writeScope($scope3_id, {});
|
|
5165
5100
|
return 0;
|
|
5166
5101
|
}
|
|
5167
5102
|
}, $scope2_id, "a", $sg__input_agent, $sg__input_agent, $sg__input_agent, 0, 1);
|
|
5168
|
-
_html(`<span${_attr_class("
|
|
5103
|
+
_html(`<span${_attr_class("_eY")}><span${_attr_class("_eZ")}>${_escape(win$1.window)}${_el_resume($scope2_id, "d", $sg__input_agent)}</span><span${_attr_class(["_e0", win$1.used_percent >= 90 ? "_cL" : win$1.used_percent >= 70 ? "_cK" : win$1.used_percent >= 40 ? "_cJ" : "_cI"])}>${_escape(pctText(win$1.used_percent))}${_el_resume($scope2_id, "f", $sg__input_agent)}</span>${_el_resume($scope2_id, "e", $sg__input_agent)}</span>`);
|
|
5169
5104
|
$si__input_agent && writeScope($scope2_id, {});
|
|
5170
5105
|
}, "window", $scope1_id, "a", $sg__input_agent, $sg__input_agent__OR__input_class, $sg__input_agent, "</span>");
|
|
5171
5106
|
$si__input_agent__OR__input_class && writeScope($scope1_id, { _: _scope_with_id($scope0_id) });
|
|
@@ -5196,12 +5131,12 @@ var icon_edit_default = _template("K", (input) => {
|
|
|
5196
5131
|
});
|
|
5197
5132
|
_serialize_if($scope0_reason, 0) && writeScope($scope0_id, { a: _existing_scope($childScope) });
|
|
5198
5133
|
});
|
|
5199
|
-
var prChip = "
|
|
5200
|
-
var portChip = "
|
|
5134
|
+
var prChip = "_gz _p _gy";
|
|
5135
|
+
var portChip = "_gA _p _gy";
|
|
5201
5136
|
var prState = {
|
|
5202
|
-
open: "
|
|
5203
|
-
merged: "
|
|
5204
|
-
closed: "
|
|
5137
|
+
open: "_gE",
|
|
5138
|
+
merged: "_gF",
|
|
5139
|
+
closed: "_gG"
|
|
5205
5140
|
};
|
|
5206
5141
|
//#endregion
|
|
5207
5142
|
//#region src/tags/side-nav-chips.marko
|
|
@@ -5249,7 +5184,7 @@ var side_nav_chips_default = _template("t", (input) => {
|
|
|
5249
5184
|
const name = repo.full_name.split("/").at(-1);
|
|
5250
5185
|
return repos.some((r) => r.full_name !== repo.full_name && r.full_name.split("/").at(-1) === name) ? repoLabel(repo.full_name) : name;
|
|
5251
5186
|
}, "t2", $scope1_id);
|
|
5252
|
-
_html(`<div${_attr_class("
|
|
5187
|
+
_html(`<div${_attr_class("_gx")}>`);
|
|
5253
5188
|
_for_of(repos, (repo) => {
|
|
5254
5189
|
const $scope2_id = _scope_id();
|
|
5255
5190
|
const $for_content__repo_worktree__closures = /* @__PURE__ */ new Set();
|
|
@@ -5265,11 +5200,11 @@ var side_nav_chips_default = _template("t", (input) => {
|
|
|
5265
5200
|
[prState.merged]: pr.state === "MERGED",
|
|
5266
5201
|
[prState.closed]: pr.state === "CLOSED"
|
|
5267
5202
|
}
|
|
5268
|
-
])}${_attr("title", prTitle(repo, pr))}><a${_attr_class(["
|
|
5203
|
+
])}${_attr("title", prTitle(repo, pr))}><a${_attr_class(["_gB", { ["_gI"]: !open }])}${_attr("href", pr.url)} target=_blank rel=noopener>${_escape(repoLabel$1(repo))}${_el_resume($scope3_id, "c", $sg__input_status_repos)}#${_sep($sg__input_status_repos)}${_escape(pr.number)}${_el_resume($scope3_id, "d", $sg__input_status_repos)}</a>${_el_resume($scope3_id, "b", $sg__input_status_repos)}`);
|
|
5269
5204
|
_if(() => {
|
|
5270
5205
|
if (open) {
|
|
5271
5206
|
const $scope4_id = _scope_id();
|
|
5272
|
-
_html(`<a${_attr_class(["
|
|
5207
|
+
_html(`<a${_attr_class(["_gB", "_gC"])}${_attr("href", `/w/${input.workspaceId}/review?pr=${encodeURIComponent(`${repo.worktree}/${pr.number}`)}`)}${_attr("title", `Review #${pr.number} changes`)}>`);
|
|
5273
5208
|
icon_diff_default({ size: 12 });
|
|
5274
5209
|
_html(`</a>${_el_resume($scope4_id, "a", _serialize_guard($scope0_reason, 0))}`);
|
|
5275
5210
|
_serialize_if($scope0_reason, 2) && _subscribe($si__input_status_repos && $for_content__repo_worktree__closures, _subscribe($si__input_workspaceId && $input_workspaceId__closures, writeScope($scope4_id, { _: _scope_with_id($scope3_id) })));
|
|
@@ -5277,9 +5212,9 @@ var side_nav_chips_default = _template("t", (input) => {
|
|
|
5277
5212
|
} else {
|
|
5278
5213
|
const $scope6_id = _scope_id();
|
|
5279
5214
|
_html(`<button type=button${_attr_class([
|
|
5280
|
-
"_gA",
|
|
5281
5215
|
"_gB",
|
|
5282
|
-
"_gC"
|
|
5216
|
+
"_gC",
|
|
5217
|
+
"_gD"
|
|
5283
5218
|
])}${_attr("title", `Dismiss #${pr.number}`)}>`);
|
|
5284
5219
|
icon_xmark_default({ size: 12 });
|
|
5285
5220
|
_html(`</button>${_el_resume($scope6_id, "a")}`);
|
|
@@ -5304,10 +5239,10 @@ var side_nav_chips_default = _template("t", (input) => {
|
|
|
5304
5239
|
}, "full_name", $scope1_id, "b", $sg__input_status_repos, $sg__input_status_repos, $sg__input_status_repos__OR__input_status_ports);
|
|
5305
5240
|
_for_of(ports, (p) => {
|
|
5306
5241
|
const $scope5_id = _scope_id();
|
|
5307
|
-
_html(`<span${_attr_class(["_p", portChip])}${_attr("title", p.cmd)}><button type=button${_attr_class(["
|
|
5308
|
-
"_gA",
|
|
5242
|
+
_html(`<span${_attr_class(["_p", portChip])}${_attr("title", p.cmd)}><button type=button${_attr_class(["_gB", "_gH"])}${_attr("title", `Open http://${typeof location === "undefined" ? "localhost" : location.hostname}:${p.port}`)}>:${_sep($sg__input_status_ports)}${_escape(p.port)}${_el_resume($scope5_id, "c", $sg__input_status_ports)}</button>${_el_resume($scope5_id, "b")}<button type=button${_attr_class([
|
|
5309
5243
|
"_gB",
|
|
5310
5244
|
"_gC",
|
|
5245
|
+
"_gD",
|
|
5311
5246
|
{ ["_n"]: armedPid === p.pid }
|
|
5312
5247
|
])}${armedPid === p.pid ? " title=Kill?" : _attr("title", `Kill ${p.cmd} (pid ${p.pid})`)}>`);
|
|
5313
5248
|
icon_xmark_default({ size: 12 });
|
|
@@ -5399,10 +5334,10 @@ var side_nav_item_default = _template("u", (input) => {
|
|
|
5399
5334
|
_if(() => {
|
|
5400
5335
|
if (input.rail) {
|
|
5401
5336
|
const $scope2_id = _scope_id();
|
|
5402
|
-
_html(`<a${_attr("href", `/w/${ws$1.id}`)}${_attr_class([railBtn, { ["
|
|
5337
|
+
_html(`<a${_attr("href", `/w/${ws$1.id}`)}${_attr_class([railBtn, { ["_fw"]: input.current }])}${_attr("title", ws$1.name)}>${_escape((input.index ?? 0) + 1)}${_el_resume($scope2_id, "b", _serialize_guard($scope0_reason, 27))}<span${_attr_class([
|
|
5403
5338
|
"_w",
|
|
5404
5339
|
phase[dot],
|
|
5405
|
-
"
|
|
5340
|
+
"_fz"
|
|
5406
5341
|
])}></span>${_el_resume($scope2_id, "c", $sg__input_workspaceId__OR__input_status)}</a>${_el_resume($scope2_id, "a", _serialize_guard($scope0_reason, 3))}`);
|
|
5407
5342
|
_serialize_if($scope0_reason, 18) && _subscribe($si__input_workspaces__OR__input_workspaceId && $ws_name__closures, _subscribe($si__input_workspaces__OR__input_workspaceId && $ws_id__closures, _subscribe($si__input_index && $input_index__closures, _subscribe($si__input_current && $input_current__closures, writeScope($scope2_id, { _: _scope_with_id($scope1_id) })))));
|
|
5408
5343
|
return 0;
|
|
@@ -5410,15 +5345,15 @@ var side_nav_item_default = _template("u", (input) => {
|
|
|
5410
5345
|
const $scope3_id = _scope_id();
|
|
5411
5346
|
const sessions$1 = input.sessions || [];
|
|
5412
5347
|
const phaseLabel = dot === "working" ? "Working" : dot === "waiting" ? "Needs input" : dot === "idle" ? "Idle" : "Not running";
|
|
5413
|
-
_html(`<section${_attr_class(["
|
|
5414
|
-
["
|
|
5348
|
+
_html(`<section${_attr_class(["_fB", {
|
|
5349
|
+
["_fw"]: input.current,
|
|
5415
5350
|
["_2"]: input.current,
|
|
5416
|
-
["
|
|
5417
|
-
["
|
|
5418
|
-
}])}><div${_attr_class("
|
|
5351
|
+
["_fC"]: input.railPop,
|
|
5352
|
+
["_fA"]: input.page
|
|
5353
|
+
}])}><div${_attr_class("_fD")}><a${_attr("href", `/w/${ws$1.id}`)}${_attr_class("_fE")}><span${_attr_class([
|
|
5419
5354
|
"_w",
|
|
5420
5355
|
phase[dot],
|
|
5421
|
-
"
|
|
5356
|
+
"_fS"
|
|
5422
5357
|
])}${_attr("title", phaseLabel)}></span>${_el_resume($scope3_id, "d", $sg__input_workspaceId__OR__input_status)}`);
|
|
5423
5358
|
_if(() => {
|
|
5424
5359
|
if (sessions$1.length === 1) {
|
|
@@ -5431,7 +5366,7 @@ var side_nav_item_default = _template("u", (input) => {
|
|
|
5431
5366
|
icon_agent_default({
|
|
5432
5367
|
agent: activeAgent(sessions$1[0]),
|
|
5433
5368
|
size: 12,
|
|
5434
|
-
class: "
|
|
5369
|
+
class: "_fJ"
|
|
5435
5370
|
});
|
|
5436
5371
|
$si__input_sessions && writeScope($scope14_id, {
|
|
5437
5372
|
_: _scope_with_id($scope3_id),
|
|
@@ -5441,16 +5376,16 @@ var side_nav_item_default = _template("u", (input) => {
|
|
|
5441
5376
|
}
|
|
5442
5377
|
}, $scope3_id, "e", $sg__input_sessions, $sg__input_sessions);
|
|
5443
5378
|
const metaText = sessions$1.length === 0 ? phaseLabel : sessions$1.length === 1 ? sessions$1[0].title || "" : `${sessions$1.length} sessions`;
|
|
5444
|
-
_html(`<span${_attr_class("
|
|
5379
|
+
_html(`<span${_attr_class("_fK")}><span${_attr_class("_fL")}>${_escape(ws$1.name)}${_el_resume($scope3_id, "h", $sg__input_workspaces__OR__input_workspaceId)}</span>`);
|
|
5445
5380
|
_if(() => {
|
|
5446
5381
|
if (input.page && metaText) {
|
|
5447
5382
|
const $scope16_id = _scope_id();
|
|
5448
|
-
_html(`<span${_attr_class("
|
|
5383
|
+
_html(`<span${_attr_class("_fQ")}>${_escape(metaText)}${_el_resume($scope16_id, "b", _serialize_guard($scope0_reason, 7))}</span>`);
|
|
5449
5384
|
$si__input_page__OR__input_sessions__OR__input_workspaceId__OR__input_status && writeScope($scope16_id, { _: _serialize_if($scope0_reason, 7) && _scope_with_id($scope3_id) });
|
|
5450
5385
|
return 0;
|
|
5451
5386
|
} else if (sessions$1.length === 1 && sessions$1[0].title) {
|
|
5452
5387
|
const $scope15_id = _scope_id();
|
|
5453
|
-
_html(`<span${_attr_class("
|
|
5388
|
+
_html(`<span${_attr_class("_fM")}>${_escape(sessions$1[0].title)}${_el_resume($scope15_id, "b", $sg__input_sessions)}</span>`);
|
|
5454
5389
|
$si__input_page__OR__input_sessions__OR__input_workspaceId__OR__input_status && writeScope($scope15_id, { _: $si__input_sessions && _scope_with_id($scope3_id) });
|
|
5455
5390
|
return 1;
|
|
5456
5391
|
}
|
|
@@ -5463,7 +5398,7 @@ var side_nav_item_default = _template("u", (input) => {
|
|
|
5463
5398
|
"_F",
|
|
5464
5399
|
"_O",
|
|
5465
5400
|
"_H",
|
|
5466
|
-
"
|
|
5401
|
+
"_fR"
|
|
5467
5402
|
])}>${input.current ? "Open" : ""}${_el_resume($scope4_id, "b", _serialize_guard($scope0_reason, 21))}</span>`);
|
|
5468
5403
|
$si__input_current__OR__input_page__OR__input_rail__OR__input_workspaces__OR__input_workspaceId && _subscribe($si__input_current && $input_current__closures, writeScope($scope4_id, {
|
|
5469
5404
|
_: _scope_with_id($scope3_id),
|
|
@@ -5476,7 +5411,7 @@ var side_nav_item_default = _template("u", (input) => {
|
|
|
5476
5411
|
_if(() => {
|
|
5477
5412
|
if (!input.page) {
|
|
5478
5413
|
const $scope5_id = _scope_id();
|
|
5479
|
-
_html(`<div${_attr_class("
|
|
5414
|
+
_html(`<div${_attr_class("_fF")}>`);
|
|
5480
5415
|
_if(() => {
|
|
5481
5416
|
if (input.onNewSession) {
|
|
5482
5417
|
const $scope6_id = _scope_id();
|
|
@@ -5490,7 +5425,7 @@ var side_nav_item_default = _template("u", (input) => {
|
|
|
5490
5425
|
_html(`</button>${_el_resume($scope6_id, "a")}<div${_attr("id", newPopId)} popover=auto${_attr_class(sessionPop)}>`);
|
|
5491
5426
|
_for_of([], (agent) => {
|
|
5492
5427
|
const $scope7_id = _scope_id();
|
|
5493
|
-
_html(`<button${_attr_class("
|
|
5428
|
+
_html(`<button${_attr_class("_e3")}>`);
|
|
5494
5429
|
_set_serialize_reason(12);
|
|
5495
5430
|
const $childScope2 = _peek_scope_id();
|
|
5496
5431
|
icon_agent_default({
|
|
@@ -5525,7 +5460,7 @@ var side_nav_item_default = _template("u", (input) => {
|
|
|
5525
5460
|
return 0;
|
|
5526
5461
|
}
|
|
5527
5462
|
}, $scope5_id, "c", $sg__input_onReview, $sg__input_onReview, $sg__input_onNewSession__OR__input_onReview, 0, 1);
|
|
5528
|
-
_html(`<a${_attr("href", `/w/${ws$1.id}/manage`)}${_attr_class([rowIcon, { ["
|
|
5463
|
+
_html(`<a${_attr("href", `/w/${ws$1.id}/manage`)}${_attr_class([rowIcon, { ["_fx"]: input.managing }])} title="Manage workspace"${input.managing ? " aria-current=page" : ""}>`);
|
|
5529
5464
|
icon_manage_default({ size: 12 });
|
|
5530
5465
|
_html(`</a>${_el_resume($scope5_id, "d", _serialize_guard($scope0_reason, 8))}</div>`);
|
|
5531
5466
|
_subscribe($si__input_workspaces__OR__input_workspaceId && $ws_id__closures, _subscribe($si__input_managing && $input_managing__closures, _subscribe($si__input_onReview && $input_onReview__closures, _subscribe($si__input_onNewSession && $input_onNewSession__closures, writeScope($scope5_id, {
|
|
@@ -5535,7 +5470,7 @@ var side_nav_item_default = _template("u", (input) => {
|
|
|
5535
5470
|
return 0;
|
|
5536
5471
|
}
|
|
5537
5472
|
}, $scope3_id, "k", $sg__input_page, $sg__input_page, 1, 0, 1);
|
|
5538
|
-
_html(`</div><div${_attr_class("
|
|
5473
|
+
_html(`</div><div${_attr_class("_fX")}>`);
|
|
5539
5474
|
_if(() => {
|
|
5540
5475
|
if (sessions$1.length === 1 && openPlan) {
|
|
5541
5476
|
const $scope11_id = _scope_id();
|
|
@@ -5543,7 +5478,7 @@ var side_nav_item_default = _template("u", (input) => {
|
|
|
5543
5478
|
const $childScope3 = _peek_scope_id();
|
|
5544
5479
|
usage_pcts_default({
|
|
5545
5480
|
agent: openPlan,
|
|
5546
|
-
class: "
|
|
5481
|
+
class: "_fN"
|
|
5547
5482
|
});
|
|
5548
5483
|
_subscribe($openPlan__closures, writeScope($scope11_id, {
|
|
5549
5484
|
a: _existing_scope($childScope3),
|
|
@@ -5554,14 +5489,14 @@ var side_nav_item_default = _template("u", (input) => {
|
|
|
5554
5489
|
}, $scope3_id, "m");
|
|
5555
5490
|
_for_of(sessions$1.length > 1 ? sessions$1 : [], (s) => {
|
|
5556
5491
|
const $scope8_id = _scope_id();
|
|
5557
|
-
_html(`<div${_attr_class(["
|
|
5492
|
+
_html(`<div${_attr_class(["_fG", { ["_fw"]: s.id === input.currentTab }])}>`);
|
|
5558
5493
|
_if(() => {
|
|
5559
5494
|
if (renamingId === s.id) {
|
|
5560
5495
|
const $scope10_id = _scope_id();
|
|
5561
5496
|
_html(`<span${_attr_class([
|
|
5562
5497
|
"_w",
|
|
5563
5498
|
phase[sessionPhase(s.state)],
|
|
5564
|
-
"
|
|
5499
|
+
"_fV"
|
|
5565
5500
|
])}></span>${_el_resume($scope10_id, "a", $sg__input_sessions)}`);
|
|
5566
5501
|
_set_serialize_reason({
|
|
5567
5502
|
1: $sg__input_sessions,
|
|
@@ -5571,17 +5506,17 @@ var side_nav_item_default = _template("u", (input) => {
|
|
|
5571
5506
|
icon_agent_default({
|
|
5572
5507
|
agent: activeAgent(s),
|
|
5573
5508
|
size: 13,
|
|
5574
|
-
class: "
|
|
5509
|
+
class: "_fZ"
|
|
5575
5510
|
});
|
|
5576
5511
|
_html(`<input${_attr_input_value($scope10_id, "c", renameValue, _resume((_new_renameValue) => {
|
|
5577
5512
|
renameValue = _new_renameValue;
|
|
5578
|
-
}, "u0", $scope10_id))}${_attr_class(["_R", "
|
|
5513
|
+
}, "u0", $scope10_id))}${_attr_class(["_R", "_fW"])} aria-label="Session name">${_el_resume($scope10_id, "c")}`);
|
|
5579
5514
|
_script($scope10_id, "u5");
|
|
5580
5515
|
_subscribe($renameValue__closures, writeScope($scope10_id, { b: $si__input_sessions && _existing_scope($childScope4) }));
|
|
5581
5516
|
return 0;
|
|
5582
5517
|
} else {
|
|
5583
5518
|
const $scope9_id = _scope_id();
|
|
5584
|
-
_html(`<a${_attr("href", `/w/${ws$1.id}?s=${s.id}`)}${_attr_class("
|
|
5519
|
+
_html(`<a${_attr("href", `/w/${ws$1.id}?s=${s.id}`)}${_attr_class("_fY")}><span${_attr_class(["_w", phase[sessionPhase(s.state)]])}></span>${_el_resume($scope9_id, "b", $sg__input_sessions)}`);
|
|
5585
5520
|
_set_serialize_reason({
|
|
5586
5521
|
1: $sg__input_sessions,
|
|
5587
5522
|
2: $sg__input_sessions
|
|
@@ -5590,9 +5525,9 @@ var side_nav_item_default = _template("u", (input) => {
|
|
|
5590
5525
|
icon_agent_default({
|
|
5591
5526
|
agent: activeAgent(s),
|
|
5592
5527
|
size: 13,
|
|
5593
|
-
class: "
|
|
5528
|
+
class: "_fZ"
|
|
5594
5529
|
});
|
|
5595
|
-
_html(`<span${_attr_class("
|
|
5530
|
+
_html(`<span${_attr_class("_fO")}><span${_attr_class("_fT")}>${_escape(s.title || activeAgent(s))}${_el_resume($scope9_id, "f", $sg__input_sessions)}</span>`);
|
|
5596
5531
|
_if(() => {
|
|
5597
5532
|
if (openPlan && s.id === openSess?.id) {
|
|
5598
5533
|
const $scope12_id = _scope_id();
|
|
@@ -5600,7 +5535,7 @@ var side_nav_item_default = _template("u", (input) => {
|
|
|
5600
5535
|
const $childScope6 = _peek_scope_id();
|
|
5601
5536
|
usage_pcts_default({
|
|
5602
5537
|
agent: openPlan,
|
|
5603
|
-
class: "
|
|
5538
|
+
class: "_fP"
|
|
5604
5539
|
});
|
|
5605
5540
|
_subscribe($openPlan__closures, writeScope($scope12_id, {
|
|
5606
5541
|
a: _existing_scope($childScope6),
|
|
@@ -5609,7 +5544,7 @@ var side_nav_item_default = _template("u", (input) => {
|
|
|
5609
5544
|
return 0;
|
|
5610
5545
|
}
|
|
5611
5546
|
}, $scope9_id, "g");
|
|
5612
|
-
_html(`</span></a>${_el_resume($scope9_id, "a", _serialize_guard($scope0_reason, 6))}<div${_attr_class("
|
|
5547
|
+
_html(`</span></a>${_el_resume($scope9_id, "a", _serialize_guard($scope0_reason, 6))}<div${_attr_class("_fU")}><button${_attr_class(rowIcon)} title="Rename session">`);
|
|
5613
5548
|
icon_edit_default({ size: 12 });
|
|
5614
5549
|
_html(`</button>${_el_resume($scope9_id, "i")}<button${_attr_class([close, { ["_n"]: armedKill === s.id }])} title=${armedKill === s.id ? "Close?" : "\"Close session\""}>`);
|
|
5615
5550
|
icon_xmark_default({ size: 12 });
|
|
@@ -5804,25 +5739,25 @@ var side_nav_default = _template("v", (input) => {
|
|
|
5804
5739
|
const isPage = view === "nav";
|
|
5805
5740
|
const otherIds = itemIds.filter((id) => id !== ws.id);
|
|
5806
5741
|
const listIds = isPage ? [ws.id, ...otherIds] : itemIds;
|
|
5807
|
-
_html(`<aside${_attr_class(["
|
|
5808
|
-
["
|
|
5809
|
-
["
|
|
5742
|
+
_html(`<aside${_attr_class(["_dk", {
|
|
5743
|
+
["_di"]: !navOpen,
|
|
5744
|
+
["_dj"]: isPage
|
|
5810
5745
|
}])}${_attr("hidden", view === "diff")}>`);
|
|
5811
5746
|
_if(() => {
|
|
5812
5747
|
if (isPage) {
|
|
5813
5748
|
const $scope1_id = _scope_id();
|
|
5814
|
-
_html(`<header${_attr_class("
|
|
5749
|
+
_html(`<header${_attr_class("_dn")}><h1${_attr_class("_do")}>Workspaces</h1><div${_attr_class("_dp")}>`);
|
|
5815
5750
|
_if(() => {}, $scope1_id, "d", 1, 1, 1, 0, 1);
|
|
5816
5751
|
_html(`<a href=/settings${_attr_class([
|
|
5817
5752
|
iconBtn$1,
|
|
5818
|
-
"
|
|
5819
|
-
{ ["
|
|
5753
|
+
"_dq",
|
|
5754
|
+
{ ["_df"]: view === "settings" }
|
|
5820
5755
|
])} title=Settings${view === "settings" ? " aria-current=page" : ""}>`);
|
|
5821
5756
|
icon_settings_default({ size: 16 });
|
|
5822
5757
|
_if(() => {
|
|
5823
5758
|
if (input.setupReady === false) {
|
|
5824
5759
|
const $scope10_id = _scope_id();
|
|
5825
|
-
_html(`<span${_attr_class(["_w", "
|
|
5760
|
+
_html(`<span${_attr_class(["_w", "_dh"])} title="Machine setup incomplete"></span>`);
|
|
5826
5761
|
$si__input_setupReady && writeScope($scope10_id, {});
|
|
5827
5762
|
return 0;
|
|
5828
5763
|
}
|
|
@@ -5832,13 +5767,13 @@ var side_nav_default = _template("v", (input) => {
|
|
|
5832
5767
|
return 0;
|
|
5833
5768
|
}
|
|
5834
5769
|
}, $scope0_id, "b", 1, 1, 1, 0, 1);
|
|
5835
|
-
_html(`<div${_attr_class("
|
|
5770
|
+
_html(`<div${_attr_class("_dt")}>`);
|
|
5836
5771
|
_for_of(listIds, (wsId) => {
|
|
5837
5772
|
const $scope2_id = _scope_id();
|
|
5838
5773
|
_if(() => {
|
|
5839
5774
|
if (isPage && wsId === ws.id) {
|
|
5840
5775
|
const $scope11_id = _scope_id();
|
|
5841
|
-
_html(`<h2${_attr_class(["_bE", "
|
|
5776
|
+
_html(`<h2${_attr_class(["_bE", "_dr"])}>Current</h2>`);
|
|
5842
5777
|
writeScope($scope11_id, {});
|
|
5843
5778
|
return 0;
|
|
5844
5779
|
}
|
|
@@ -5846,7 +5781,7 @@ var side_nav_default = _template("v", (input) => {
|
|
|
5846
5781
|
_if(() => {
|
|
5847
5782
|
if (isPage && wsId !== ws.id && wsId === otherIds[0]) {
|
|
5848
5783
|
const $scope12_id = _scope_id();
|
|
5849
|
-
_html(`<h2${_attr_class(["_bE", "
|
|
5784
|
+
_html(`<h2${_attr_class(["_bE", "_dr"])}>Other workspaces</h2>`);
|
|
5850
5785
|
writeScope($scope12_id, {});
|
|
5851
5786
|
return 0;
|
|
5852
5787
|
}
|
|
@@ -5933,7 +5868,7 @@ var side_nav_default = _template("v", (input) => {
|
|
|
5933
5868
|
railHover = null;
|
|
5934
5869
|
}, 150);
|
|
5935
5870
|
}, "v6", $scope3_id);
|
|
5936
|
-
_html(`<div${_attr_class("
|
|
5871
|
+
_html(`<div${_attr_class("_du")}>`);
|
|
5937
5872
|
_for_of(itemIds, (wsId, i) => {
|
|
5938
5873
|
const $scope4_id = _scope_id();
|
|
5939
5874
|
_html("<span>");
|
|
@@ -5987,7 +5922,7 @@ var side_nav_default = _template("v", (input) => {
|
|
|
5987
5922
|
if (railHover) {
|
|
5988
5923
|
const $scope5_id = _scope_id();
|
|
5989
5924
|
const hoverId = railHover.id;
|
|
5990
|
-
_html(`<div${_attr_class(["_1", "
|
|
5925
|
+
_html(`<div${_attr_class(["_1", "_dx"])}${_attr_style(`top:${railHover.top}px;left:${railHover.left}px`)}>`);
|
|
5991
5926
|
_set_serialize_reason({
|
|
5992
5927
|
0: 1,
|
|
5993
5928
|
1: 1,
|
|
@@ -6075,7 +6010,7 @@ var side_nav_default = _template("v", (input) => {
|
|
|
6075
6010
|
return 0;
|
|
6076
6011
|
}
|
|
6077
6012
|
}, $scope0_id, "d");
|
|
6078
|
-
_html(`<div${_attr_class("
|
|
6013
|
+
_html(`<div${_attr_class("_dv")}>`);
|
|
6079
6014
|
_if(() => {
|
|
6080
6015
|
if (isPage) {
|
|
6081
6016
|
const $scope7_id = _scope_id();
|
|
@@ -6083,7 +6018,7 @@ var side_nav_default = _template("v", (input) => {
|
|
|
6083
6018
|
"_l",
|
|
6084
6019
|
"_m",
|
|
6085
6020
|
btnLg,
|
|
6086
|
-
"
|
|
6021
|
+
"_ds"
|
|
6087
6022
|
])} title="New workspace"${view === "new" ? " aria-current=page" : ""}>`);
|
|
6088
6023
|
icon_folder_plus_default({ size: 16 });
|
|
6089
6024
|
_html(` New workspace</a>${_el_resume($scope7_id, "a")}`);
|
|
@@ -6105,19 +6040,19 @@ var side_nav_default = _template("v", (input) => {
|
|
|
6105
6040
|
return 1;
|
|
6106
6041
|
}
|
|
6107
6042
|
}, $scope6_id, "a", 1, 1, 1, "</button>", 1);
|
|
6108
|
-
_html(`<div${_attr_class(["_v", "
|
|
6043
|
+
_html(`<div${_attr_class(["_v", "_dw"])}></div>`);
|
|
6109
6044
|
_if(() => {}, $scope6_id, "c", 1, 1, 1, 0, 1);
|
|
6110
|
-
_html(`<a href=/settings${_attr_class([iconBtn$1, { ["
|
|
6045
|
+
_html(`<a href=/settings${_attr_class([iconBtn$1, { ["_df"]: view === "settings" }])} title=Settings${view === "settings" ? " aria-current=page" : ""}>`);
|
|
6111
6046
|
icon_settings_default({ size: 15 });
|
|
6112
6047
|
_if(() => {
|
|
6113
6048
|
if (input.setupReady === false) {
|
|
6114
6049
|
const $scope15_id = _scope_id();
|
|
6115
|
-
_html(`<span${_attr_class(["_w", "
|
|
6050
|
+
_html(`<span${_attr_class(["_w", "_dh"])} title="Machine setup incomplete"></span>`);
|
|
6116
6051
|
$si__input_setupReady && writeScope($scope15_id, {});
|
|
6117
6052
|
return 0;
|
|
6118
6053
|
}
|
|
6119
6054
|
}, $scope6_id, "f", $sg__input_setupReady, $sg__input_setupReady, 1, 0, 1);
|
|
6120
|
-
_html(`</a>${_el_resume($scope6_id, "d")}<a href=/new${_attr_class([iconBtn$1, { ["
|
|
6055
|
+
_html(`</a>${_el_resume($scope6_id, "d")}<a href=/new${_attr_class([iconBtn$1, { ["_df"]: view === "new" }])} title="New workspace"${view === "new" ? " aria-current=page" : ""}>`);
|
|
6121
6056
|
icon_folder_plus_default({ size: 16 });
|
|
6122
6057
|
_html(`</a>${_el_resume($scope6_id, "g")}`);
|
|
6123
6058
|
_script($scope6_id, "v15");
|
|
@@ -6179,10 +6114,10 @@ var side_nav_default = _template("v", (input) => {
|
|
|
6179
6114
|
});
|
|
6180
6115
|
var iconBtn = "_X _g";
|
|
6181
6116
|
var sectionCount = "_br _F _G";
|
|
6182
|
-
var content = "
|
|
6183
|
-
var pageMeta = "
|
|
6184
|
-
var pathMeta = "
|
|
6185
|
-
var dangerHint = "
|
|
6117
|
+
var content = "_c5 _bh";
|
|
6118
|
+
var pageMeta = "_c6 _bm";
|
|
6119
|
+
var pathMeta = "_c9 _u";
|
|
6120
|
+
var dangerHint = "_de _P";
|
|
6186
6121
|
//#endregion
|
|
6187
6122
|
//#region src/tags/manage-workspace.marko
|
|
6188
6123
|
var api$2;
|
|
@@ -6293,7 +6228,7 @@ var manage_workspace_default = _template("l", (input) => {
|
|
|
6293
6228
|
meta: attrTag({ content: _content_resume("l11", () => {
|
|
6294
6229
|
_scope_reason();
|
|
6295
6230
|
const $scope8_id = _scope_id();
|
|
6296
|
-
_html(`<span${_attr_class(pageMeta)}${_attr("title", ws.display_path || ws.path)}><span${_attr_class("
|
|
6231
|
+
_html(`<span${_attr_class(pageMeta)}${_attr("title", ws.display_path || ws.path)}><span${_attr_class("_c7")}>${_escape(ws.name)}${_el_resume($scope8_id, "c")}</span>`);
|
|
6297
6232
|
_if(() => {
|
|
6298
6233
|
if (ws.status !== "active") {
|
|
6299
6234
|
const $scope11_id = _scope_id();
|
|
@@ -6302,7 +6237,7 @@ var manage_workspace_default = _template("l", (input) => {
|
|
|
6302
6237
|
return 0;
|
|
6303
6238
|
}
|
|
6304
6239
|
}, $scope8_id, "d", 1, 1, 1, 0, 1);
|
|
6305
|
-
_html(`<span${_attr_class("
|
|
6240
|
+
_html(`<span${_attr_class("_c8")} aria-hidden=true>·</span><span${_attr_class(pathMeta)}>${_escape(ws.display_path || ws.path)}${_el_resume($scope8_id, "g")}</span></span>${_el_resume($scope8_id, "a")}`);
|
|
6306
6241
|
_subscribe($ws_status__closures, _subscribe($ws_name__closures, _subscribe($ws_path__closures, _subscribe($ws_display_path__closures, writeScope($scope8_id, { _: _scope_with_id($scope0_id) })))));
|
|
6307
6242
|
_resume_branch($scope8_id);
|
|
6308
6243
|
}, $scope0_id) })
|
|
@@ -6345,7 +6280,7 @@ var manage_workspace_default = _template("l", (input) => {
|
|
|
6345
6280
|
_html(`</button>${_el_resume($scope0_id, "m")}</div><ul${_attr_class("_bs")}>`);
|
|
6346
6281
|
_for_of(ws.repos, (row) => {
|
|
6347
6282
|
const $scope1_id = _scope_id();
|
|
6348
|
-
_html(`<li${_attr_class("_bu")}><div${_attr_class("_bv")}><span${_attr_class(["_bw", "_u"])}>${_escape(row.worktree)}${_el_resume($scope1_id, "d")}/</span><span${_attr_class("_bx")}><a${_attr_class(["_by", "
|
|
6283
|
+
_html(`<li${_attr_class("_bu")}><div${_attr_class("_bv")}><span${_attr_class(["_bw", "_u"])}>${_escape(row.worktree)}${_el_resume($scope1_id, "d")}/</span><span${_attr_class("_bx")}><a${_attr_class(["_by", "_da"])}${_attr("href", repoWebUrl$1(row.full_name))} target=_blank rel=noopener${_attr("title", `Open ${row.full_name} on GitHub`)}>${_escape(repoLabel(row.full_name))}${_el_resume($scope1_id, "g")}</a>${_el_resume($scope1_id, "f")}`);
|
|
6349
6284
|
_if(() => {
|
|
6350
6285
|
if (row.base_branch !== row.default_branch) {
|
|
6351
6286
|
const $scope12_id = _scope_id();
|
|
@@ -6409,7 +6344,7 @@ var manage_workspace_default = _template("l", (input) => {
|
|
|
6409
6344
|
return 0;
|
|
6410
6345
|
}
|
|
6411
6346
|
}, $scope0_id, "r", 1, 1, 1, 0, 1);
|
|
6412
|
-
_html(`<div${_attr_class("
|
|
6347
|
+
_html(`<div${_attr_class("_c_")}>`);
|
|
6413
6348
|
const $childScope3 = _peek_scope_id();
|
|
6414
6349
|
let refreshCatalog = repo_picker_default({
|
|
6415
6350
|
exclude: inWorkspace,
|
|
@@ -6439,7 +6374,7 @@ var manage_workspace_default = _template("l", (input) => {
|
|
|
6439
6374
|
_html(`<span${_attr_class("_bx")}>`);
|
|
6440
6375
|
_for_of(p.ports, (port) => {
|
|
6441
6376
|
const $scope19_id = _scope_id();
|
|
6442
|
-
_html(`<button${_attr_class(["_p", "
|
|
6377
|
+
_html(`<button${_attr_class(["_p", "_db"])}${_attr("title", `Open http://${typeof location === "undefined" ? "localhost" : location.hostname}:${port}`)}>:<!>${_escape(port)}${_el_resume($scope19_id, "b")}</button>${_el_resume($scope19_id, "a")}`);
|
|
6443
6378
|
_script($scope19_id, "l15");
|
|
6444
6379
|
writeScope($scope19_id, { d: port });
|
|
6445
6380
|
}, (x) => String(x), $scope18_id, "a", 1, 1, 1, "</span>", 1);
|
|
@@ -6461,7 +6396,7 @@ var manage_workspace_default = _template("l", (input) => {
|
|
|
6461
6396
|
return 0;
|
|
6462
6397
|
}
|
|
6463
6398
|
}, $scope0_id, "v", 1, 1, 1, 0, 1);
|
|
6464
|
-
_html(`<section${_attr_class(["_bp", "
|
|
6399
|
+
_html(`<section${_attr_class(["_bp", "_dc"])}><div${_attr_class("_bq")}><h2${_attr_class("_bE")}>Workspace</h2></div><div${_attr_class("_dd")}>`);
|
|
6465
6400
|
_if(() => {
|
|
6466
6401
|
if (ws.status === "active") {
|
|
6467
6402
|
const $scope4_id = _scope_id();
|
|
@@ -6562,15 +6497,15 @@ var term_find_default = _template("w", (input) => {
|
|
|
6562
6497
|
const canStep = hasQuery && open;
|
|
6563
6498
|
const keybar = input.placement === "keybar";
|
|
6564
6499
|
_html(`<div${_attr_class([
|
|
6565
|
-
"
|
|
6566
|
-
keybar ? "
|
|
6567
|
-
!open && "
|
|
6568
|
-
])} aria-hidden=${open ? "false" : "true"}><div${_attr_class(["
|
|
6500
|
+
"_eP",
|
|
6501
|
+
keybar ? "_eR" : "_eQ",
|
|
6502
|
+
!open && "_eT"
|
|
6503
|
+
])} aria-hidden=${open ? "false" : "true"}><div${_attr_class(["_eK", keybar ? "_eS" : "_eM"])}><input${_attr_input_value($scope0_id, "c", query, _resume(function(v) {
|
|
6569
6504
|
if (!open) return;
|
|
6570
6505
|
query = v;
|
|
6571
6506
|
live.query = v;
|
|
6572
6507
|
run(0);
|
|
6573
|
-
}, "w0", $scope0_id))}${_attr_class([findInput, keybar && "
|
|
6508
|
+
}, "w0", $scope0_id))}${_attr_class([findInput, keybar && "_eU"])} type=search enterkeyhint=search autocomplete=off tabindex=${open ? "0" : "-1"} placeholder="Find in terminal" aria-label="Find in terminal">${_el_resume($scope0_id, "c")}<button type=button${_attr_class([findIconBtn, keybar && "_eV"])} title="Previous match"${_attr("disabled", !canStep)} tabindex=${open ? "0" : "-1"}>↑</button>${_el_resume($scope0_id, "d")}<button type=button${_attr_class([findIconBtn, keybar && "_eV"])} title="Next match"${_attr("disabled", !canStep)} tabindex=${open ? "0" : "-1"}>↓</button>${_el_resume($scope0_id, "e")}<button type=button${_attr_class([findIconBtn, keybar && "_eV"])} title="Close find" tabindex=${open ? "0" : "-1"}>`);
|
|
6574
6509
|
icon_xmark_default({ size: 14 });
|
|
6575
6510
|
_html(`</button>${_el_resume($scope0_id, "f")}</div>${_el_resume($scope0_id, "b", _serialize_guard($scope0_reason, 2))}</div>${_el_resume($scope0_id, "a")}`);
|
|
6576
6511
|
_script($scope0_id, "w4");
|
|
@@ -6844,7 +6779,7 @@ var term_default = _template("x", (input) => {
|
|
|
6844
6779
|
trapOpen = true;
|
|
6845
6780
|
}
|
|
6846
6781
|
}, "x14", $scope0_id);
|
|
6847
|
-
_html(`<div${_attr("hidden", !onTermPage)}${_attr_class("
|
|
6782
|
+
_html(`<div${_attr("hidden", !onTermPage)}${_attr_class("_dy")}><div${_attr_class("_dz")}></div>${_el_resume($scope0_id, "b")}`);
|
|
6848
6783
|
_if(() => {
|
|
6849
6784
|
if (findOpen) {
|
|
6850
6785
|
const $scope12_id = _scope_id();
|
|
@@ -6871,7 +6806,7 @@ var term_default = _template("x", (input) => {
|
|
|
6871
6806
|
_if(() => {
|
|
6872
6807
|
if (uploading) {
|
|
6873
6808
|
const $scope19_id = _scope_id();
|
|
6874
|
-
_html(`<div${_attr_class("
|
|
6809
|
+
_html(`<div${_attr_class("_dF")}>uploading…</div>`);
|
|
6875
6810
|
writeScope($scope19_id, {});
|
|
6876
6811
|
return 0;
|
|
6877
6812
|
}
|
|
@@ -6879,7 +6814,7 @@ var term_default = _template("x", (input) => {
|
|
|
6879
6814
|
_if(() => {
|
|
6880
6815
|
if (copiedFlash) {
|
|
6881
6816
|
const $scope20_id = _scope_id();
|
|
6882
|
-
_html(`<div${_attr_class("
|
|
6817
|
+
_html(`<div${_attr_class("_dE")}>Copied</div>`);
|
|
6883
6818
|
writeScope($scope20_id, {});
|
|
6884
6819
|
return 0;
|
|
6885
6820
|
}
|
|
@@ -6888,7 +6823,7 @@ var term_default = _template("x", (input) => {
|
|
|
6888
6823
|
_if(() => {
|
|
6889
6824
|
if (trapOpen) {
|
|
6890
6825
|
const $scope11_id = _scope_id();
|
|
6891
|
-
_html(`<div${_attr_class("
|
|
6826
|
+
_html(`<div${_attr_class("_dG")}><div${_attr_class("_dH")}><p${_attr_class("_eb")}>Long-press the field below and choose Paste</p><input placeholder="Paste here…">${_el_resume($scope11_id, "d")}<button${_attr_class("_l")}>Cancel</button>${_el_resume($scope11_id, "e")}</div>${_el_resume($scope11_id, "b")}</div>${_el_resume($scope11_id, "a")}`);
|
|
6892
6827
|
_script($scope11_id, "x25");
|
|
6893
6828
|
_script($scope11_id, "x26");
|
|
6894
6829
|
writeScope($scope11_id, {});
|
|
@@ -6991,7 +6926,7 @@ var work_view_default = _template("B", (input) => {
|
|
|
6991
6926
|
let DiffView = null;
|
|
6992
6927
|
const loadDiffView = _resume(() => {
|
|
6993
6928
|
if (DiffView) return;
|
|
6994
|
-
import("./
|
|
6929
|
+
import("./_C4T3WOc-.js").then((m) => {
|
|
6995
6930
|
DiffView = m.default;
|
|
6996
6931
|
});
|
|
6997
6932
|
}, "B6", $scope0_id);
|
|
@@ -7177,7 +7112,7 @@ var work_view_default = _template("B", (input) => {
|
|
|
7177
7112
|
toggleDiff();
|
|
7178
7113
|
}
|
|
7179
7114
|
}, "B21", $scope0_id);
|
|
7180
|
-
_html(`<div${_attr_class(["
|
|
7115
|
+
_html(`<div${_attr_class(["_ci", { ["_ch"]: view === "nav" }])}><div${_attr_class("_cj")}>`);
|
|
7181
7116
|
_set_serialize_reason({
|
|
7182
7117
|
0: _serialize_guard($scope0_reason, 0),
|
|
7183
7118
|
1: _serialize_guard($scope0_reason, 1),
|
|
@@ -7233,7 +7168,7 @@ var work_view_default = _template("B", (input) => {
|
|
|
7233
7168
|
openDiff(pr);
|
|
7234
7169
|
}, "B29", $scope0_id)
|
|
7235
7170
|
});
|
|
7236
|
-
_html(`</div><div${_attr_class("
|
|
7171
|
+
_html(`</div><div${_attr_class("_ck")}>`);
|
|
7237
7172
|
_if(() => {
|
|
7238
7173
|
if (error) {
|
|
7239
7174
|
const $scope8_id = _scope_id();
|
|
@@ -7384,13 +7319,13 @@ var work_view_default = _template("B", (input) => {
|
|
|
7384
7319
|
return 0;
|
|
7385
7320
|
}
|
|
7386
7321
|
}, $scope0_id, "i");
|
|
7387
|
-
_html(`<div${_attr_class(["
|
|
7322
|
+
_html(`<div${_attr_class(["_cm", { ["_cl"]: view !== "term" }])}>`);
|
|
7388
7323
|
_if(() => {
|
|
7389
7324
|
if (shownSessions) {
|
|
7390
7325
|
const $scope5_id = _scope_id();
|
|
7391
7326
|
_for_of(shownSessions, (s) => {
|
|
7392
7327
|
const $scope6_id = _scope_id();
|
|
7393
|
-
_html(`<div${_attr_class(["
|
|
7328
|
+
_html(`<div${_attr_class(["_cn", { ["_co"]: s.id === curTab }])}>`);
|
|
7394
7329
|
_set_serialize_reason({
|
|
7395
7330
|
0: 1,
|
|
7396
7331
|
1: 1,
|
|
@@ -8949,7 +8884,10 @@ var postHandler$13 = normalizeHandler(Run.POST({ search: (value) => parse(Query$
|
|
|
8949
8884
|
if (q.session && q.state) {
|
|
8950
8885
|
const payload = await ctx.request.json().catch(() => void 0);
|
|
8951
8886
|
if (q.state === "idle") clearAgentPhase(q.session);
|
|
8952
|
-
else
|
|
8887
|
+
else {
|
|
8888
|
+
const read = readHookPayload(getSession(q.session)?.agent, payload, q.reason);
|
|
8889
|
+
if (!read.ignore) setAgentPhase(q.session, q.state, read.reason, read.summary);
|
|
8890
|
+
}
|
|
8953
8891
|
return Response.json({ ok: true });
|
|
8954
8892
|
}
|
|
8955
8893
|
const body = parse(AgentState, await ctx.request.json());
|
|
@@ -9499,724 +9437,6 @@ function head24(context) {
|
|
|
9499
9437
|
return stripResponseBody(get24(context));
|
|
9500
9438
|
}
|
|
9501
9439
|
//#endregion
|
|
9502
|
-
//#region src/server/usage/shared.ts
|
|
9503
|
-
var HOME = os.homedir();
|
|
9504
|
-
var obj = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
9505
|
-
var arr = (value) => Array.isArray(value) ? value : [];
|
|
9506
|
-
var str = (value) => typeof value === "string" ? value : "";
|
|
9507
|
-
/** Numeric coercion that refuses NaN/Infinity — a provider sending "n/a"
|
|
9508
|
-
* must read as "no number", not as a percentage that renders a bar. */
|
|
9509
|
-
function num(value) {
|
|
9510
|
-
if (value == null || value === "") return null;
|
|
9511
|
-
const n = typeof value === "number" ? value : Number(value);
|
|
9512
|
-
return Number.isFinite(n) ? n : null;
|
|
9513
|
-
}
|
|
9514
|
-
function readJson(file) {
|
|
9515
|
-
try {
|
|
9516
|
-
return obj(JSON.parse(fs.readFileSync(file, "utf8")));
|
|
9517
|
-
} catch {
|
|
9518
|
-
return null;
|
|
9519
|
-
}
|
|
9520
|
-
}
|
|
9521
|
-
/** True if an epoch (seconds or ms) or ISO-8601 expiry is in the past. */
|
|
9522
|
-
function expired(value) {
|
|
9523
|
-
if (value == null) return false;
|
|
9524
|
-
if (typeof value === "string") {
|
|
9525
|
-
const t = Date.parse(value.replace(/\.\d+/, ""));
|
|
9526
|
-
return Number.isFinite(t) && t < Date.now();
|
|
9527
|
-
}
|
|
9528
|
-
const n = num(value);
|
|
9529
|
-
if (n == null) return false;
|
|
9530
|
-
return (n > 1e11 ? n : n * 1e3) < Date.now();
|
|
9531
|
-
}
|
|
9532
|
-
function isoFromEpoch(value) {
|
|
9533
|
-
const n = num(value);
|
|
9534
|
-
if (n == null || n <= 0) return null;
|
|
9535
|
-
const ms = n > 1e11 ? n : n * 1e3;
|
|
9536
|
-
return new Date(ms).toISOString();
|
|
9537
|
-
}
|
|
9538
|
-
/** `p•••@g•••.com` — enough to tell two accounts apart, and the page is
|
|
9539
|
-
* screenshotted into PRs and chat, so the address itself doesn't belong. */
|
|
9540
|
-
function maskEmail(email) {
|
|
9541
|
-
if (!email || !email.includes("@")) return email || "—";
|
|
9542
|
-
const [local, domain] = email.split("@");
|
|
9543
|
-
if (!local || !domain) return email;
|
|
9544
|
-
const tld = domain.split(".").pop() || "";
|
|
9545
|
-
return `${local[0]}•••@${domain[0]}•••.${tld}`;
|
|
9546
|
-
}
|
|
9547
|
-
/** A fetch that failed, carrying a reason fit to show on the row.
|
|
9548
|
-
*
|
|
9549
|
-
* A stale number with no explanation is what makes a usage table untrustworthy
|
|
9550
|
-
* — "why is claude2 from yesterday?" deserves an answer next to the number. */
|
|
9551
|
-
var FetchFailed = class extends Error {
|
|
9552
|
-
reason;
|
|
9553
|
-
constructor(reason) {
|
|
9554
|
-
super(reason);
|
|
9555
|
-
this.reason = reason;
|
|
9556
|
-
}
|
|
9557
|
-
};
|
|
9558
|
-
function httpReason(status) {
|
|
9559
|
-
if (status === 401 || status === 403) return "auth expired";
|
|
9560
|
-
if (status === 429) return "rate limited or auth expired";
|
|
9561
|
-
if (status >= 500) return `provider error (HTTP ${status})`;
|
|
9562
|
-
return `HTTP ${status}`;
|
|
9563
|
-
}
|
|
9564
|
-
var TIMEOUT_MS = 15e3;
|
|
9565
|
-
/** JSON over HTTPS, with every failure mode collapsed into a FetchFailed
|
|
9566
|
-
* whose reason is worth showing to a human. */
|
|
9567
|
-
async function fetchJson(url, init = {}) {
|
|
9568
|
-
let res;
|
|
9569
|
-
try {
|
|
9570
|
-
res = await fetch(url, {
|
|
9571
|
-
...init,
|
|
9572
|
-
signal: AbortSignal.timeout(TIMEOUT_MS)
|
|
9573
|
-
});
|
|
9574
|
-
} catch (err) {
|
|
9575
|
-
const name = err?.name;
|
|
9576
|
-
throw new FetchFailed(name === "TimeoutError" || name === "AbortError" ? "timed out" : "network unreachable");
|
|
9577
|
-
}
|
|
9578
|
-
if (!res.ok) throw new FetchFailed(httpReason(res.status));
|
|
9579
|
-
try {
|
|
9580
|
-
return await res.json();
|
|
9581
|
-
} catch {
|
|
9582
|
-
throw new FetchFailed("unreadable response");
|
|
9583
|
-
}
|
|
9584
|
-
}
|
|
9585
|
-
var cacheDir = path.join(config.dataDir, "usage");
|
|
9586
|
-
function readCache(key) {
|
|
9587
|
-
const blob = readJson(path.join(cacheDir, `${key}.json`));
|
|
9588
|
-
if (!blob) return null;
|
|
9589
|
-
const payload = blob.payload;
|
|
9590
|
-
const at = num(blob.fetched_at);
|
|
9591
|
-
if (!payload || typeof payload !== "object" || at == null) return null;
|
|
9592
|
-
return {
|
|
9593
|
-
payload: obj(payload),
|
|
9594
|
-
ageMs: Math.max(0, Date.now() - at)
|
|
9595
|
-
};
|
|
9596
|
-
}
|
|
9597
|
-
function writeCache(key, payload) {
|
|
9598
|
-
try {
|
|
9599
|
-
fs.mkdirSync(cacheDir, { recursive: true });
|
|
9600
|
-
fs.writeFileSync(path.join(cacheDir, `${key}.json`), JSON.stringify({
|
|
9601
|
-
fetched_at: Date.now(),
|
|
9602
|
-
payload
|
|
9603
|
-
}));
|
|
9604
|
-
} catch {}
|
|
9605
|
-
}
|
|
9606
|
-
/** Live fetch, falling back to the last good payload on disk.
|
|
9607
|
-
*
|
|
9608
|
-
* There is no "cache is fresh enough, skip the fetch" branch: the page's own
|
|
9609
|
-
* 60s stale-while-revalidate (server/usage/index.ts) already decides how often
|
|
9610
|
-
* this runs, and a second TTL underneath it only makes the numbers older than
|
|
9611
|
-
* the page claims. */
|
|
9612
|
-
async function loadPayload(key, live) {
|
|
9613
|
-
let reason;
|
|
9614
|
-
try {
|
|
9615
|
-
const data = await live();
|
|
9616
|
-
if (data) {
|
|
9617
|
-
writeCache(key, data);
|
|
9618
|
-
return {
|
|
9619
|
-
payload: data,
|
|
9620
|
-
source: "live"
|
|
9621
|
-
};
|
|
9622
|
-
}
|
|
9623
|
-
} catch (err) {
|
|
9624
|
-
reason = err instanceof FetchFailed ? err.reason : "fetch failed";
|
|
9625
|
-
}
|
|
9626
|
-
const disk = readCache(key);
|
|
9627
|
-
if (disk) return {
|
|
9628
|
-
payload: disk.payload,
|
|
9629
|
-
source: `stale-cache ${Math.round(disk.ageMs / 1e3)}s`,
|
|
9630
|
-
reason
|
|
9631
|
-
};
|
|
9632
|
-
return {
|
|
9633
|
-
payload: null,
|
|
9634
|
-
source: "missing",
|
|
9635
|
-
reason
|
|
9636
|
-
};
|
|
9637
|
-
}
|
|
9638
|
-
/** How to get a fresh token back, per provider. */
|
|
9639
|
-
var REAUTH = {
|
|
9640
|
-
codex: "codex login",
|
|
9641
|
-
cursor: "cursor-agent login",
|
|
9642
|
-
grok: "grok",
|
|
9643
|
-
copilot: "gh auth login"
|
|
9644
|
-
};
|
|
9645
|
-
/** Never signed in (or the CLI's credentials went missing) — not an outage.
|
|
9646
|
-
* Distinct from a failed request: nothing was ever sent, so blaming the
|
|
9647
|
-
* network would send you debugging the wrong thing. */
|
|
9648
|
-
/** Row note for a CLI signed in with an API key: metered by the bill, not
|
|
9649
|
-
* by plan windows, so the empty meters are the whole story. */
|
|
9650
|
-
var API_KEY_NOTE = "API key — pay per use, no plan limits";
|
|
9651
|
-
function noAuthReason(key) {
|
|
9652
|
-
const hint = REAUTH[key];
|
|
9653
|
-
return hint ? `not signed in (run \`${hint}\`)` : "no credentials on disk";
|
|
9654
|
-
}
|
|
9655
|
-
function blankRow(agent, source = "missing") {
|
|
9656
|
-
return {
|
|
9657
|
-
agent,
|
|
9658
|
-
plan: agent,
|
|
9659
|
-
account: "—",
|
|
9660
|
-
five_h: null,
|
|
9661
|
-
five_h_resets: null,
|
|
9662
|
-
seven_d: null,
|
|
9663
|
-
seven_d_resets: null,
|
|
9664
|
-
fable: null,
|
|
9665
|
-
fable_resets: null,
|
|
9666
|
-
source
|
|
9667
|
-
};
|
|
9668
|
-
}
|
|
9669
|
-
/** Say *why* a row is showing last-known numbers, on the row itself.
|
|
9670
|
-
*
|
|
9671
|
-
* `tokenExpired` is the local credential check: true/false where an expiry is
|
|
9672
|
-
* readable off disk, undefined where it isn't. It beats guessing from the
|
|
9673
|
-
* status code — a dead token comes back 429 or 403 as readily as 401 — and
|
|
9674
|
-
* knowing the token is *good* is what lets a 429 be reported as plain
|
|
9675
|
-
* throttling instead of sending you to re-authenticate for nothing. */
|
|
9676
|
-
function markStale(row, key, tokenExpired, reason) {
|
|
9677
|
-
if (!/^(stale|claude\.json|missing)/.test(row.source)) return row;
|
|
9678
|
-
let why = reason ?? (tokenExpired ? "auth expired" : void 0);
|
|
9679
|
-
if (!why) why = "couldn't reach provider";
|
|
9680
|
-
if (why.startsWith("rate limited") && tokenExpired === false) why = "rate limited — retry shortly";
|
|
9681
|
-
else if (/^(auth expired|rate limited)/.test(why)) {
|
|
9682
|
-
const hint = REAUTH[key];
|
|
9683
|
-
why += hint ? ` (run \`${hint}\`)` : " (sign in again)";
|
|
9684
|
-
}
|
|
9685
|
-
return {
|
|
9686
|
-
...row,
|
|
9687
|
-
stale_reason: why
|
|
9688
|
-
};
|
|
9689
|
-
}
|
|
9690
|
-
//#endregion
|
|
9691
|
-
//#region src/server/usage/claude.ts
|
|
9692
|
-
/** Every Claude account this machine can read.
|
|
9693
|
-
*
|
|
9694
|
-
* Numbered dirs (~/.claude-1, -2, …) keep metadata at <dir>/.claude.json; the
|
|
9695
|
-
* stock single-account install keeps it at ~/.claude.json with only
|
|
9696
|
-
* credentials under ~/.claude/. The numbered ones are discovered rather than
|
|
9697
|
-
* assumed — hardcoding a count is a guess about one machine's setup. */
|
|
9698
|
-
function claudeAccounts() {
|
|
9699
|
-
const candidates = [...numberedDirs().map((n) => ({
|
|
9700
|
-
suffix: n,
|
|
9701
|
-
dir: path.join(HOME, `.claude-${n}`),
|
|
9702
|
-
meta: path.join(HOME, `.claude-${n}`, ".claude.json"),
|
|
9703
|
-
label: `claude${n}`
|
|
9704
|
-
})), {
|
|
9705
|
-
suffix: "",
|
|
9706
|
-
dir: path.join(HOME, ".claude"),
|
|
9707
|
-
meta: path.join(HOME, ".claude.json"),
|
|
9708
|
-
label: "claude"
|
|
9709
|
-
}];
|
|
9710
|
-
const out = [];
|
|
9711
|
-
for (const candidate of candidates) {
|
|
9712
|
-
const meta = readJson(candidate.meta);
|
|
9713
|
-
if (!meta) continue;
|
|
9714
|
-
const oauth = obj(meta.oauthAccount);
|
|
9715
|
-
out.push({
|
|
9716
|
-
...candidate,
|
|
9717
|
-
email: str(oauth.emailAddress).trim(),
|
|
9718
|
-
plan: str(oauth.organizationRateLimitTier || oauth.organizationType)
|
|
9719
|
-
});
|
|
9720
|
-
}
|
|
9721
|
-
return out;
|
|
9722
|
-
}
|
|
9723
|
-
/** `.claude-<n>` directories in $HOME, in numeric order. */
|
|
9724
|
-
function numberedDirs() {
|
|
9725
|
-
try {
|
|
9726
|
-
return fs.readdirSync(HOME).map((entry) => /^\.claude-(\d+)$/.exec(entry)?.[1]).filter((n) => !!n).sort((a, b) => Number(a) - Number(b));
|
|
9727
|
-
} catch {
|
|
9728
|
-
return [];
|
|
9729
|
-
}
|
|
9730
|
-
}
|
|
9731
|
-
var credentials = (account) => readJson(path.join(account.dir, ".credentials.json"));
|
|
9732
|
-
/** Why an account has no live data — an expired token is the common case
|
|
9733
|
-
* and only that account's own CLI can refresh it. */
|
|
9734
|
-
function credentialNote(account) {
|
|
9735
|
-
const cred = credentials(account);
|
|
9736
|
-
if (!cred) return "no credentials — run: claude";
|
|
9737
|
-
if (expired(obj(cred.claudeAiOauth).expiresAt)) return "token expired — use this Claude account to refresh";
|
|
9738
|
-
return "usage unavailable";
|
|
9739
|
-
}
|
|
9740
|
-
function tokenExpired(account) {
|
|
9741
|
-
const cred = credentials(account);
|
|
9742
|
-
return cred ? expired(obj(cred.claudeAiOauth).expiresAt) : false;
|
|
9743
|
-
}
|
|
9744
|
-
async function fetchUsage$3(account) {
|
|
9745
|
-
const token = str(obj(credentials(account)?.claudeAiOauth).accessToken);
|
|
9746
|
-
if (!token) return null;
|
|
9747
|
-
return obj(await fetchJson("https://api.anthropic.com/api/oauth/usage", { headers: {
|
|
9748
|
-
Authorization: `Bearer ${token}`,
|
|
9749
|
-
"anthropic-beta": "oauth-2025-04-20",
|
|
9750
|
-
"User-Agent": "claude-cli",
|
|
9751
|
-
Accept: "application/json"
|
|
9752
|
-
} }));
|
|
9753
|
-
}
|
|
9754
|
-
/** The CLI's own last-seen utilization, written into .claude.json. Older and
|
|
9755
|
-
* coarser than the API, but it survives an expired token. */
|
|
9756
|
-
function claudeJsonFallback(account) {
|
|
9757
|
-
const cached = readJson(account.meta)?.cachedUsageUtilization;
|
|
9758
|
-
return cached && typeof cached === "object" ? obj(cached) : null;
|
|
9759
|
-
}
|
|
9760
|
-
/** The payload nests windows under `utilization` on some plans and inlines
|
|
9761
|
-
* them on others. */
|
|
9762
|
-
function utilRoot(data) {
|
|
9763
|
-
const util = obj(data.utilization);
|
|
9764
|
-
return "five_hour" in util || "limits" in util ? util : data;
|
|
9765
|
-
}
|
|
9766
|
-
function window$2(data, key) {
|
|
9767
|
-
const win = obj(utilRoot(data)[key]);
|
|
9768
|
-
const used = num(win.utilization);
|
|
9769
|
-
return [used == null ? null : Math.trunc(used), str(win.resets_at) || null];
|
|
9770
|
-
}
|
|
9771
|
-
/** Fable gets its own weekly cap, listed as a model-scoped limit rather than
|
|
9772
|
-
* a top-level window. */
|
|
9773
|
-
function fableWindow(data) {
|
|
9774
|
-
for (const entry of arr(utilRoot(data).limits)) {
|
|
9775
|
-
const limit = obj(entry);
|
|
9776
|
-
if (limit.kind !== "weekly_scoped") continue;
|
|
9777
|
-
const model = obj(obj(limit.scope).model);
|
|
9778
|
-
if (!str(model.display_name || model.id).toLowerCase().includes("fable")) continue;
|
|
9779
|
-
const pct = num(limit.percent);
|
|
9780
|
-
return [pct == null ? null : Math.trunc(pct), str(limit.resets_at) || null];
|
|
9781
|
-
}
|
|
9782
|
-
return [null, null];
|
|
9783
|
-
}
|
|
9784
|
-
function parseRow$4(account, data, source) {
|
|
9785
|
-
const [five, fiveResets] = data ? window$2(data, "five_hour") : [null, null];
|
|
9786
|
-
const [seven, sevenResets] = data ? window$2(data, "seven_day") : [null, null];
|
|
9787
|
-
const [fable, fableResets] = data ? fableWindow(data) : [null, null];
|
|
9788
|
-
const row = {
|
|
9789
|
-
agent: account.label,
|
|
9790
|
-
plan: account.plan || "claude",
|
|
9791
|
-
account: maskEmail(account.email),
|
|
9792
|
-
five_h: five,
|
|
9793
|
-
five_h_resets: fiveResets,
|
|
9794
|
-
seven_d: seven,
|
|
9795
|
-
seven_d_resets: sevenResets,
|
|
9796
|
-
fable,
|
|
9797
|
-
fable_resets: fableResets,
|
|
9798
|
-
source
|
|
9799
|
-
};
|
|
9800
|
-
if (five == null && seven == null && fable == null) row.note = credentialNote(account);
|
|
9801
|
-
return row;
|
|
9802
|
-
}
|
|
9803
|
-
/** No OAuth session but an API key in play (helper, an approved key, or
|
|
9804
|
-
* the env): pay-as-you-go, nothing to meter. */
|
|
9805
|
-
function apiKeyMode$1(account) {
|
|
9806
|
-
if (str(obj(credentials(account)?.claudeAiOauth).accessToken)) return false;
|
|
9807
|
-
const settings = readJson(path.join(account.dir, "settings.json"));
|
|
9808
|
-
const approved = obj(readJson(account.meta)?.customApiKeyResponses).approved;
|
|
9809
|
-
return !!str(settings?.apiKeyHelper) || Array.isArray(approved) && approved.length > 0 || !!process.env.ANTHROPIC_API_KEY;
|
|
9810
|
-
}
|
|
9811
|
-
async function claudeRow(account) {
|
|
9812
|
-
if (apiKeyMode$1(account)) return {
|
|
9813
|
-
...blankRow(account.label, "api-key"),
|
|
9814
|
-
plan: "API key",
|
|
9815
|
-
note: API_KEY_NOTE
|
|
9816
|
-
};
|
|
9817
|
-
const loaded = await loadPayload(`claude${account.suffix}`, () => fetchUsage$3(account));
|
|
9818
|
-
const fallback = loaded.payload ? null : claudeJsonFallback(account);
|
|
9819
|
-
return markStale(parseRow$4(account, loaded.payload ?? fallback, fallback ? "claude.json" : loaded.source), account.label, tokenExpired(account), loaded.reason);
|
|
9820
|
-
}
|
|
9821
|
-
//#endregion
|
|
9822
|
-
//#region src/server/usage/codex.ts
|
|
9823
|
-
var AUTH$2 = path.join(HOME, ".codex", "auth.json");
|
|
9824
|
-
/** Live rate-limit windows from the endpoint the Codex CLI itself uses. */
|
|
9825
|
-
async function fetchUsage$2() {
|
|
9826
|
-
const tokens = obj(readJson(AUTH$2)?.tokens);
|
|
9827
|
-
const token = str(tokens.access_token);
|
|
9828
|
-
if (!token) return null;
|
|
9829
|
-
return obj(await fetchJson("https://chatgpt.com/backend-api/wham/usage", { headers: {
|
|
9830
|
-
Authorization: `Bearer ${token}`,
|
|
9831
|
-
"chatgpt-account-id": str(tokens.account_id),
|
|
9832
|
-
"User-Agent": "codex-cli",
|
|
9833
|
-
Accept: "application/json"
|
|
9834
|
-
} }));
|
|
9835
|
-
}
|
|
9836
|
-
/** (used percent, reset) for whichever window is `seconds` long — the two
|
|
9837
|
-
* windows arrive as primary/secondary rather than named 5h / 7d. */
|
|
9838
|
-
function window$1(rateLimit, seconds) {
|
|
9839
|
-
for (const key of ["primary_window", "secondary_window"]) {
|
|
9840
|
-
const win = obj(rateLimit[key]);
|
|
9841
|
-
if (num(win.limit_window_seconds) !== seconds) continue;
|
|
9842
|
-
const used = num(win.used_percent);
|
|
9843
|
-
return [used == null ? null : Math.trunc(used), isoFromEpoch(win.reset_at)];
|
|
9844
|
-
}
|
|
9845
|
-
return [null, null];
|
|
9846
|
-
}
|
|
9847
|
-
function parseRow$3(payload, source) {
|
|
9848
|
-
const rateLimit = obj(payload.rate_limit);
|
|
9849
|
-
const [five, fiveResets] = window$1(rateLimit, 18e3);
|
|
9850
|
-
const [seven, sevenResets] = window$1(rateLimit, 604800);
|
|
9851
|
-
return {
|
|
9852
|
-
agent: "codex",
|
|
9853
|
-
plan: str(payload.plan_type) || "codex",
|
|
9854
|
-
account: maskEmail(str(payload.email)),
|
|
9855
|
-
five_h: five,
|
|
9856
|
-
five_h_resets: fiveResets,
|
|
9857
|
-
seven_d: seven,
|
|
9858
|
-
seven_d_resets: sevenResets,
|
|
9859
|
-
fable: null,
|
|
9860
|
-
fable_resets: null,
|
|
9861
|
-
source
|
|
9862
|
-
};
|
|
9863
|
-
}
|
|
9864
|
-
/** Signed in with an API key rather than a ChatGPT plan: pay-as-you-go,
|
|
9865
|
-
* no rate-limit windows to draw. */
|
|
9866
|
-
function apiKeyMode() {
|
|
9867
|
-
const auth = readJson(AUTH$2);
|
|
9868
|
-
return !!auth && (str(auth.auth_mode) === "apikey" || !obj(auth.tokens).access_token && !!auth.OPENAI_API_KEY);
|
|
9869
|
-
}
|
|
9870
|
-
async function codexRow() {
|
|
9871
|
-
if (apiKeyMode()) return {
|
|
9872
|
-
...blankRow("codex", "api-key"),
|
|
9873
|
-
plan: "API key",
|
|
9874
|
-
note: API_KEY_NOTE
|
|
9875
|
-
};
|
|
9876
|
-
const { payload, source, reason } = await loadPayload("codex", fetchUsage$2);
|
|
9877
|
-
const missingAuth = fs.existsSync(AUTH$2) ? void 0 : noAuthReason("codex");
|
|
9878
|
-
return markStale(payload ? parseRow$3(payload, source) : {
|
|
9879
|
-
...blankRow("codex", source),
|
|
9880
|
-
note: missingAuth ?? "usage unavailable"
|
|
9881
|
-
}, "codex", void 0, missingAuth ?? reason);
|
|
9882
|
-
}
|
|
9883
|
-
//#endregion
|
|
9884
|
-
//#region src/server/usage/copilot.ts
|
|
9885
|
-
var USER_API = "https://api.github.com/copilot_internal/user";
|
|
9886
|
-
var HOSTS = path.join(process.env.XDG_CONFIG_HOME || path.join(HOME, ".config"), "gh", "hosts.yml");
|
|
9887
|
-
var SESSION_DB = path.join(HOME, ".copilot", "session-store.db");
|
|
9888
|
-
/** github.com's `oauth_token` straight out of gh's own hosts.yml.
|
|
9889
|
-
*
|
|
9890
|
-
* Deliberately not a YAML parse (no dependency): track the current top-level
|
|
9891
|
-
* host key by indentation and take the first token beneath github.com. */
|
|
9892
|
-
function hostsToken() {
|
|
9893
|
-
let text;
|
|
9894
|
-
try {
|
|
9895
|
-
text = fs.readFileSync(HOSTS, "utf8");
|
|
9896
|
-
} catch {
|
|
9897
|
-
return null;
|
|
9898
|
-
}
|
|
9899
|
-
let host = "";
|
|
9900
|
-
for (const line of text.split("\n")) {
|
|
9901
|
-
if (line[0]?.trim() && line.trimEnd().endsWith(":")) {
|
|
9902
|
-
host = line.trim().replace(/:$/, "");
|
|
9903
|
-
continue;
|
|
9904
|
-
}
|
|
9905
|
-
if (host !== "github.com") continue;
|
|
9906
|
-
const match = /^\s+oauth_token:\s*(\S+)/.exec(line);
|
|
9907
|
-
if (match) return match[1] ?? null;
|
|
9908
|
-
}
|
|
9909
|
-
return null;
|
|
9910
|
-
}
|
|
9911
|
-
/** The Copilot CLI keeps its own auth in the OS keyring, so reuse the token
|
|
9912
|
-
* gh manages. Copilot entitlement is account-scoped, so any valid token for
|
|
9913
|
-
* the entitled user reads the quota. */
|
|
9914
|
-
async function token() {
|
|
9915
|
-
for (const key of ["GH_TOKEN", "GITHUB_TOKEN"]) {
|
|
9916
|
-
const value = process.env[key]?.trim();
|
|
9917
|
-
if (value) return value;
|
|
9918
|
-
}
|
|
9919
|
-
const fromHosts = hostsToken();
|
|
9920
|
-
if (fromHosts) return fromHosts;
|
|
9921
|
-
try {
|
|
9922
|
-
return await run("gh", ["auth", "token"]) || null;
|
|
9923
|
-
} catch {
|
|
9924
|
-
return null;
|
|
9925
|
-
}
|
|
9926
|
-
}
|
|
9927
|
-
async function fetchUsage$1(auth) {
|
|
9928
|
-
if (!auth) return null;
|
|
9929
|
-
const data = obj(await fetchJson(USER_API, { headers: {
|
|
9930
|
-
Authorization: `token ${auth}`,
|
|
9931
|
-
"User-Agent": "GitHubCopilotCLI",
|
|
9932
|
-
Accept: "application/json"
|
|
9933
|
-
} }));
|
|
9934
|
-
return data.quota_snapshots == null ? null : data;
|
|
9935
|
-
}
|
|
9936
|
-
/** Billing period start = one month before the quota reset date. */
|
|
9937
|
-
function periodStart(resetIso) {
|
|
9938
|
-
const reset = new Date(resetIso);
|
|
9939
|
-
if (Number.isNaN(reset.getTime())) return null;
|
|
9940
|
-
const year = reset.getUTCMonth() === 0 ? reset.getUTCFullYear() - 1 : reset.getUTCFullYear();
|
|
9941
|
-
const month = reset.getUTCMonth() === 0 ? 12 : reset.getUTCMonth();
|
|
9942
|
-
const day = Math.min(reset.getUTCDate(), 28);
|
|
9943
|
-
return `${String(year).padStart(4, "0")}-${String(month).padStart(2, "0")}-${String(day).padStart(2, "0")}`;
|
|
9944
|
-
}
|
|
9945
|
-
/** Credits this machine's Copilot CLI has spent in the current period.
|
|
9946
|
-
*
|
|
9947
|
-
* GitHub's own quota snapshot is batched — it can still read `credits_used: 0`
|
|
9948
|
-
* minutes after a session that plainly spent credits — so the CLI's local
|
|
9949
|
-
* ledger is the only number that moves in real time. It sees this machine
|
|
9950
|
-
* only, which is why the caller floors it with upstream rather than trusting
|
|
9951
|
-
* it alone. */
|
|
9952
|
-
function localCredits(start) {
|
|
9953
|
-
if (!start || !fs.existsSync(SESSION_DB)) return null;
|
|
9954
|
-
try {
|
|
9955
|
-
const db = new DatabaseSync(SESSION_DB, { readOnly: true });
|
|
9956
|
-
try {
|
|
9957
|
-
const nano = num(db.prepare("select sum(total_nano_aiu) as nano from assistant_usage_events where created_at >= ?").get(start)?.nano);
|
|
9958
|
-
return nano == null ? 0 : nano / 1e9;
|
|
9959
|
-
} finally {
|
|
9960
|
-
db.close();
|
|
9961
|
-
}
|
|
9962
|
-
} catch {
|
|
9963
|
-
return null;
|
|
9964
|
-
}
|
|
9965
|
-
}
|
|
9966
|
-
function parseRow$2(payload, source) {
|
|
9967
|
-
const premium = obj(obj(payload.quota_snapshots).premium_interactions);
|
|
9968
|
-
const reset = str(payload.quota_reset_date_utc || payload.quota_reset_date) || null;
|
|
9969
|
-
let pct = null;
|
|
9970
|
-
let note;
|
|
9971
|
-
if (!Object.keys(premium).length || !premium.has_quota) note = "no premium quota";
|
|
9972
|
-
else if (premium.unlimited) note = "unlimited premium requests";
|
|
9973
|
-
else {
|
|
9974
|
-
const remaining = num(premium.percent_remaining);
|
|
9975
|
-
if (remaining != null) pct = 100 - remaining;
|
|
9976
|
-
const entitlement = num(premium.entitlement) ?? 0;
|
|
9977
|
-
const used = reset ? localCredits(periodStart(reset)) : null;
|
|
9978
|
-
if (entitlement > 0 && used != null) {
|
|
9979
|
-
const localPct = 100 * used / entitlement;
|
|
9980
|
-
if (pct == null || localPct > pct) {
|
|
9981
|
-
pct = localPct;
|
|
9982
|
-
source = `${source}+local`;
|
|
9983
|
-
}
|
|
9984
|
-
}
|
|
9985
|
-
}
|
|
9986
|
-
if (pct != null) pct = Math.round(pct * 1e3) / 1e3;
|
|
9987
|
-
const row = {
|
|
9988
|
-
agent: "copilot",
|
|
9989
|
-
plan: str(payload.copilot_plan) || "copilot",
|
|
9990
|
-
account: str(payload.login) || "—",
|
|
9991
|
-
five_h: null,
|
|
9992
|
-
five_h_resets: null,
|
|
9993
|
-
seven_d: pct,
|
|
9994
|
-
seven_d_resets: pct == null ? null : reset,
|
|
9995
|
-
seven_d_label: "month",
|
|
9996
|
-
fable: null,
|
|
9997
|
-
fable_resets: null,
|
|
9998
|
-
source
|
|
9999
|
-
};
|
|
10000
|
-
if (note) row.note = note;
|
|
10001
|
-
return row;
|
|
10002
|
-
}
|
|
10003
|
-
async function copilotRow() {
|
|
10004
|
-
const auth = await token();
|
|
10005
|
-
const { payload, source, reason } = await loadPayload("copilot", () => fetchUsage$1(auth));
|
|
10006
|
-
const missingAuth = auth ? void 0 : noAuthReason("copilot");
|
|
10007
|
-
return markStale(payload ? parseRow$2(payload, source) : {
|
|
10008
|
-
...blankRow("copilot", source),
|
|
10009
|
-
note: missingAuth ?? "usage unavailable"
|
|
10010
|
-
}, "copilot", void 0, missingAuth ?? reason);
|
|
10011
|
-
}
|
|
10012
|
-
//#endregion
|
|
10013
|
-
//#region src/server/usage/cursor.ts
|
|
10014
|
-
var AUTH$1 = path.join(HOME, ".config", "cursor", "auth.json");
|
|
10015
|
-
var CLI_CONFIG = path.join(HOME, ".cursor", "cli-config.json");
|
|
10016
|
-
var API = "https://api2.cursor.sh";
|
|
10017
|
-
var WWW = "https://cursor.com";
|
|
10018
|
-
function cursorAuth() {
|
|
10019
|
-
const auth = readJson(AUTH$1);
|
|
10020
|
-
if (!auth) return null;
|
|
10021
|
-
const token = str(auth.accessToken || auth.access_token);
|
|
10022
|
-
if (!token) return null;
|
|
10023
|
-
let sub = "";
|
|
10024
|
-
try {
|
|
10025
|
-
sub = str(obj(JSON.parse(Buffer.from(str(token.split(".")[1]), "base64url").toString())).sub);
|
|
10026
|
-
} catch {}
|
|
10027
|
-
return {
|
|
10028
|
-
token,
|
|
10029
|
-
sub,
|
|
10030
|
-
email: str(obj(readJson(CLI_CONFIG)?.authInfo).email).trim()
|
|
10031
|
-
};
|
|
10032
|
-
}
|
|
10033
|
-
var dashboardPost = async (token, method) => obj(await fetchJson(`${API}/aiserver.v1.DashboardService/${method}`, {
|
|
10034
|
-
method: "POST",
|
|
10035
|
-
body: "{}",
|
|
10036
|
-
headers: {
|
|
10037
|
-
Authorization: `Bearer ${token}`,
|
|
10038
|
-
"Content-Type": "application/json",
|
|
10039
|
-
Accept: "application/json",
|
|
10040
|
-
"Connect-Protocol-Version": "1",
|
|
10041
|
-
"User-Agent": "cursor-agent"
|
|
10042
|
-
}
|
|
10043
|
-
}));
|
|
10044
|
-
/** Enterprise/team monthly pool, which the dashboard service leaves empty —
|
|
10045
|
-
* it is only readable with the web session cookie. */
|
|
10046
|
-
async function usageSummary(auth) {
|
|
10047
|
-
if (!auth.sub) return null;
|
|
10048
|
-
const cookie = `WorkosCursorSessionToken=${encodeURIComponent(`${auth.sub}::${auth.token}`)}`;
|
|
10049
|
-
return obj(await fetchJson(`${WWW}/api/usage-summary`, { headers: {
|
|
10050
|
-
Cookie: cookie,
|
|
10051
|
-
Accept: "application/json",
|
|
10052
|
-
"User-Agent": "Mozilla/5.0"
|
|
10053
|
-
} }));
|
|
10054
|
-
}
|
|
10055
|
-
/** Prefer the dashboard's planUsage (Pro/Ultra); fall back to the web
|
|
10056
|
-
* summary for Enterprise/team accounts, where planUsage comes back empty.
|
|
10057
|
-
* Each call is optional on its own, so one failing endpoint must not hide a
|
|
10058
|
-
* number another would have produced — but if nothing lands, the first
|
|
10059
|
-
* failure is rethrown so the row can say why. */
|
|
10060
|
-
async function fetchUsage(auth) {
|
|
10061
|
-
let failure;
|
|
10062
|
-
const soft = async (load) => {
|
|
10063
|
-
try {
|
|
10064
|
-
return await load();
|
|
10065
|
-
} catch (err) {
|
|
10066
|
-
failure ??= err;
|
|
10067
|
-
return null;
|
|
10068
|
-
}
|
|
10069
|
-
};
|
|
10070
|
-
const [period, planInfo] = await Promise.all([soft(() => dashboardPost(auth.token, "GetCurrentPeriodUsage")), soft(() => dashboardPost(auth.token, "GetPlanInfo"))]);
|
|
10071
|
-
const planUsage = obj(obj(period).planUsage);
|
|
10072
|
-
const summary = num(planUsage.limit) ? null : await soft(() => usageSummary(auth));
|
|
10073
|
-
if (!Object.keys(planUsage).length && !summary) {
|
|
10074
|
-
if (failure) throw failure;
|
|
10075
|
-
return null;
|
|
10076
|
-
}
|
|
10077
|
-
return {
|
|
10078
|
-
period: obj(period),
|
|
10079
|
-
plan_info: obj(obj(planInfo).planInfo),
|
|
10080
|
-
summary
|
|
10081
|
-
};
|
|
10082
|
-
}
|
|
10083
|
-
function parseRow$1(payload, auth, source) {
|
|
10084
|
-
const period = obj(payload.period);
|
|
10085
|
-
const planInfo = obj(payload.plan_info);
|
|
10086
|
-
const summary = obj(payload.summary);
|
|
10087
|
-
let pct = num(obj(period.planUsage).totalPercentUsed);
|
|
10088
|
-
let resets = isoFromEpoch(period.billingCycleEnd);
|
|
10089
|
-
if (pct == null) {
|
|
10090
|
-
const overall = obj(obj(summary.individualUsage).overall);
|
|
10091
|
-
const used = num(overall.used);
|
|
10092
|
-
const limit = num(overall.limit);
|
|
10093
|
-
if (used != null && limit) pct = Math.round(100 * used / limit);
|
|
10094
|
-
resets = str(summary.billingCycleEnd) || resets;
|
|
10095
|
-
}
|
|
10096
|
-
return {
|
|
10097
|
-
agent: "cursor",
|
|
10098
|
-
plan: str(planInfo.planName || summary.membershipType) || "cursor",
|
|
10099
|
-
account: auth?.email ? maskEmail(auth.email) : "—",
|
|
10100
|
-
five_h: null,
|
|
10101
|
-
five_h_resets: null,
|
|
10102
|
-
seven_d: pct == null ? null : Math.trunc(pct),
|
|
10103
|
-
seven_d_resets: resets,
|
|
10104
|
-
seven_d_label: "month",
|
|
10105
|
-
fable: null,
|
|
10106
|
-
fable_resets: null,
|
|
10107
|
-
source
|
|
10108
|
-
};
|
|
10109
|
-
}
|
|
10110
|
-
async function cursorRow() {
|
|
10111
|
-
const auth = cursorAuth();
|
|
10112
|
-
const { payload, source, reason } = await loadPayload("cursor", () => auth ? fetchUsage(auth) : Promise.resolve(null));
|
|
10113
|
-
const missingAuth = auth ? void 0 : noAuthReason("cursor");
|
|
10114
|
-
return markStale(payload ? parseRow$1(payload, auth, source) : {
|
|
10115
|
-
...blankRow("cursor", source),
|
|
10116
|
-
note: missingAuth ?? "usage unavailable"
|
|
10117
|
-
}, "cursor", void 0, missingAuth ?? reason);
|
|
10118
|
-
}
|
|
10119
|
-
//#endregion
|
|
10120
|
-
//#region src/server/usage/grok.ts
|
|
10121
|
-
var AUTH = path.join(HOME, ".grok", "auth.json");
|
|
10122
|
-
var LOG = path.join(HOME, ".grok", "logs", "unified.jsonl");
|
|
10123
|
-
/** The newest usable entry in ~/.grok/auth.json, which is keyed by scope
|
|
10124
|
-
* rather than being a single credential. */
|
|
10125
|
-
function grokAuth() {
|
|
10126
|
-
const auth = readJson(AUTH);
|
|
10127
|
-
if (!auth) return null;
|
|
10128
|
-
const entry = Object.values(auth).map(obj).filter((entry) => str(entry.key) || str(entry.access_token)).sort((a, b) => str(b.create_time || b.expires_at).localeCompare(str(a.create_time || a.expires_at)))[0];
|
|
10129
|
-
if (!entry) return null;
|
|
10130
|
-
return {
|
|
10131
|
-
token: str(entry.key) || str(entry.access_token),
|
|
10132
|
-
email: str(entry.email),
|
|
10133
|
-
expiresAt: entry.expires_at
|
|
10134
|
-
};
|
|
10135
|
-
}
|
|
10136
|
-
/** Weekly credit pool from the Grok Build CLI's own proxy. */
|
|
10137
|
-
async function fetchBilling(token) {
|
|
10138
|
-
const data = obj(await fetchJson("https://cli-chat-proxy.grok.com/v1/billing?format=credits", { headers: {
|
|
10139
|
-
Authorization: `Bearer ${token}`,
|
|
10140
|
-
Accept: "application/json",
|
|
10141
|
-
"User-Agent": "grok-cli",
|
|
10142
|
-
"x-grok-client-mode": "cli"
|
|
10143
|
-
} }));
|
|
10144
|
-
return data.config ? data : null;
|
|
10145
|
-
}
|
|
10146
|
-
/** Fallback: the last credits config the CLI logged, normalized to the live
|
|
10147
|
-
* API's shape. Reads only the tail — this log grows without bound. */
|
|
10148
|
-
function billingFromLogs() {
|
|
10149
|
-
let chunk;
|
|
10150
|
-
try {
|
|
10151
|
-
const { size } = fs.statSync(LOG);
|
|
10152
|
-
const start = Math.max(0, size - 512e3);
|
|
10153
|
-
const fd = fs.openSync(LOG, "r");
|
|
10154
|
-
try {
|
|
10155
|
-
const buf = Buffer.alloc(size - start);
|
|
10156
|
-
fs.readSync(fd, buf, 0, buf.length, start);
|
|
10157
|
-
chunk = buf.toString("utf8");
|
|
10158
|
-
} finally {
|
|
10159
|
-
fs.closeSync(fd);
|
|
10160
|
-
}
|
|
10161
|
-
} catch {
|
|
10162
|
-
return null;
|
|
10163
|
-
}
|
|
10164
|
-
let latest = null;
|
|
10165
|
-
for (const line of chunk.split("\n")) {
|
|
10166
|
-
if (!line.includes("billing: fetched credits config")) continue;
|
|
10167
|
-
try {
|
|
10168
|
-
const entry = obj(JSON.parse(line));
|
|
10169
|
-
if (entry.msg === "billing: fetched credits config") latest = entry;
|
|
10170
|
-
} catch {}
|
|
10171
|
-
}
|
|
10172
|
-
if (!latest) return null;
|
|
10173
|
-
const ctx = obj(latest.ctx);
|
|
10174
|
-
const cfg = obj(ctx.config);
|
|
10175
|
-
if (!Object.keys(cfg).length) return null;
|
|
10176
|
-
return {
|
|
10177
|
-
config: cfg,
|
|
10178
|
-
subscriptionTier: ctx.subscriptionTier
|
|
10179
|
-
};
|
|
10180
|
-
}
|
|
10181
|
-
function parseRow(payload, auth, source) {
|
|
10182
|
-
const cfg = payload.config ? obj(payload.config) : payload;
|
|
10183
|
-
const pct = num(cfg.creditUsagePercent);
|
|
10184
|
-
let productPct = null;
|
|
10185
|
-
for (const entry of arr(cfg.productUsage)) {
|
|
10186
|
-
const usage = obj(entry);
|
|
10187
|
-
if (!str(usage.product).toLowerCase().includes("grok")) continue;
|
|
10188
|
-
productPct = num(usage.usagePercent);
|
|
10189
|
-
break;
|
|
10190
|
-
}
|
|
10191
|
-
const used = pct ?? productPct;
|
|
10192
|
-
const period = obj(cfg.currentPeriod);
|
|
10193
|
-
return {
|
|
10194
|
-
agent: "grok",
|
|
10195
|
-
plan: str(payload.subscriptionTier || cfg.subscriptionTier) || "Grok Build",
|
|
10196
|
-
account: auth?.email ? maskEmail(auth.email) : "—",
|
|
10197
|
-
five_h: null,
|
|
10198
|
-
five_h_resets: null,
|
|
10199
|
-
seven_d: used == null ? null : Math.trunc(used),
|
|
10200
|
-
seven_d_resets: str(period.end || cfg.billingPeriodEnd) || null,
|
|
10201
|
-
seven_d_label: /MONTH/i.test(str(period.type)) ? "month" : "7d",
|
|
10202
|
-
fable: null,
|
|
10203
|
-
fable_resets: null,
|
|
10204
|
-
source
|
|
10205
|
-
};
|
|
10206
|
-
}
|
|
10207
|
-
async function grokRow() {
|
|
10208
|
-
const auth = grokAuth();
|
|
10209
|
-
const loaded = await loadPayload("grok", () => auth?.token ? fetchBilling(auth.token) : Promise.resolve(null));
|
|
10210
|
-
const fromLog = loaded.payload ? null : billingFromLogs();
|
|
10211
|
-
const payload = loaded.payload ?? fromLog;
|
|
10212
|
-
const source = fromLog ? "unified.jsonl" : loaded.source;
|
|
10213
|
-
const missingAuth = auth?.token ? void 0 : noAuthReason("grok");
|
|
10214
|
-
return markStale(payload ? parseRow(payload, auth, source) : {
|
|
10215
|
-
...blankRow("grok", source),
|
|
10216
|
-
note: missingAuth ?? "usage unavailable"
|
|
10217
|
-
}, "grok", expired(auth?.expiresAt), missingAuth ?? loaded.reason);
|
|
10218
|
-
}
|
|
10219
|
-
//#endregion
|
|
10220
9440
|
//#region src/server/usage/index.ts
|
|
10221
9441
|
var TTL_MS = 6e4;
|
|
10222
9442
|
/** Plan/quota usage across every agent account this machine is signed into.
|
|
@@ -10225,17 +9445,10 @@ var TTL_MS = 6e4;
|
|
|
10225
9445
|
* own CLI uses; they touch disjoint credentials and cache files, so they run
|
|
10226
9446
|
* concurrently and the wait is the slowest single provider, not their sum. */
|
|
10227
9447
|
async function collect() {
|
|
10228
|
-
|
|
10229
|
-
...
|
|
10230
|
-
["codex", codexRow],
|
|
10231
|
-
["cursor", cursorRow],
|
|
10232
|
-
["grok", grokRow],
|
|
10233
|
-
["copilot", copilotRow]
|
|
10234
|
-
];
|
|
10235
|
-
return Promise.all(providers.map(([key, load]) => load().catch(() => ({
|
|
10236
|
-
...blankRow(key, "error"),
|
|
9448
|
+
return (await Promise.all(AGENTS.map((agent) => (agent.usage?.() ?? Promise.resolve([])).catch(() => [{
|
|
9449
|
+
...blankRow(agent.meta.id, "error"),
|
|
10237
9450
|
note: "fetch failed"
|
|
10238
|
-
}))));
|
|
9451
|
+
}])))).flat();
|
|
10239
9452
|
}
|
|
10240
9453
|
/** Age of a row served from a failed refresh, in seconds — undefined when the
|
|
10241
9454
|
* numbers are current. Percentages from a stale row describe a window that has
|
|
@@ -15834,4 +15047,4 @@ server.listen(port, () => {
|
|
|
15834
15047
|
//#endregion
|
|
15835
15048
|
export {};
|
|
15836
15049
|
|
|
15837
|
-
;var __MARKO_MANIFEST__={"
|
|
15050
|
+
;var __MARKO_MANIFEST__={"ibphXY4":{"block":[2,"stylesheet#/assets/app-page-KK8yJIbR.css",6,"<link",0," rel=\"stylesheet\" crossorigin href=\"",1,"assets/app-page-KK8yJIbR.css\"",">"],"defer":[2,"/assets/w._-OSO__hUI.js",6,"<script",0," async type=\"module\" crossorigin src=\"",1,"assets/w._-OSO__hUI.js\"","></script>",2,"modulepreload#/assets/_C4bcAkxw.js",6,"<link",0," rel=\"modulepreload\" crossorigin href=\"",1,"assets/_C4bcAkxw.js\"",">"]},"ZLT8joi":{"block":[2,"stylesheet#/assets/app-page-KK8yJIbR.css",6,"<link",0," rel=\"stylesheet\" crossorigin href=\"",1,"assets/app-page-KK8yJIbR.css\"",">"],"defer":[2,"/assets/new-OSO__hUI.js",6,"<script",0," async type=\"module\" crossorigin src=\"",1,"assets/new-OSO__hUI.js\"","></script>",2,"modulepreload#/assets/_C4bcAkxw.js",6,"<link",0," rel=\"modulepreload\" crossorigin href=\"",1,"assets/_C4bcAkxw.js\"",">"]},"AA0T2xt":{"block":[2,"stylesheet#/assets/app-page-KK8yJIbR.css",6,"<link",0," rel=\"stylesheet\" crossorigin href=\"",1,"assets/app-page-KK8yJIbR.css\"",">"],"defer":[2,"/assets/settings-OSO__hUI.js",6,"<script",0," async type=\"module\" crossorigin src=\"",1,"assets/settings-OSO__hUI.js\"","></script>",2,"modulepreload#/assets/_C4bcAkxw.js",6,"<link",0," rel=\"modulepreload\" crossorigin href=\"",1,"assets/_C4bcAkxw.js\"",">"]},"T$MNY0k":{"block":[2,"stylesheet#/assets/app-page-KK8yJIbR.css",6,"<link",0," rel=\"stylesheet\" crossorigin href=\"",1,"assets/app-page-KK8yJIbR.css\"",">"],"defer":[2,"/assets/w._-BVUaVdRa.js",6,"<script",0," async type=\"module\" crossorigin src=\"",1,"assets/w._-BVUaVdRa.js\"","></script>",2,"modulepreload#/assets/_C4bcAkxw.js",6,"<link",0," rel=\"modulepreload\" crossorigin href=\"",1,"assets/_C4bcAkxw.js\"",">"]},"LH2lXAg":{"block":[2,"stylesheet#/assets/app-page-KK8yJIbR.css",6,"<link",0," rel=\"stylesheet\" crossorigin href=\"",1,"assets/app-page-KK8yJIbR.css\"",">"],"defer":[2,"/assets/w-OSO__hUI.js",6,"<script",0," async type=\"module\" crossorigin src=\"",1,"assets/w-OSO__hUI.js\"","></script>",2,"modulepreload#/assets/_C4bcAkxw.js",6,"<link",0," rel=\"modulepreload\" crossorigin href=\"",1,"assets/_C4bcAkxw.js\"",">"]}};
|