elanous 0.3.9 → 0.3.11
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/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/404/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/404.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/EYSh3cX6PSbWZ9jfAV-ZL/_buildManifest.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/EYSh3cX6PSbWZ9jfAV-ZL/_ssgManifest.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/01d37f32.f1ecc352bfc51dba.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/1205.fe10b7987f8524ef.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/1349.f7811f2ffa218061.js +115 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/1384.1cb410c0f56171eb.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/1428.0e64b175c610d66f.js +217 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/1573.f7798ecec5a0c856.js +62 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/1704.873747d458a61393.js +226 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/1744.be78cf6a0a3a74d6.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/1984-49012b18b68b1cf9.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/2148-6f0c9b53f41fe475.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/2320.b695c0cf2687a257.js +86 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/2361246f.b0c89bf269cf461a.js +18 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/2435.f5c7a8ec43bf380d.js +148 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/2444-14f479a9f931d064.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/2546.54bca8b2efbfc20f.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/2548.d44d521b5f8c4430.js +149 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/261-a046190a9a00a2e9.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/2797.075b49a780b777f9.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/2869.89f22df850ffcffb.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/293a491b.83fead916f3d4b84.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3061-347b0ea159fbd1ff.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3090.1ce88a5426850ed6.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3092.7ba336afc0ff5129.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3191.8ba727790cf10b35.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3305-72701e4eaf50e6df.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3346.ce452aec61c3b95c.js +66 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3377-ee5f16870d6175ba.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3429.26af58ade120e0f6.js +32 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3441.4826303af0ba2719.js +23 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3476.83efa7b4266c7e51.js +77 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3586.51fa867dadba71b6.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3614-9958a689c070352d.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3694.b629d2f7208eac8f.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3722-ccce3970d69d2872.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3730-21d7ec4ebcc8c568.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3778.7c2878335b916833.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3830.397d404d47d8a062.js +8 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/3b874777.9cb8232267532d67.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/4009.77649c720a2856f6.js +27 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/4215-b3f308605f4b13a8.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/4244.d72a596d89009db0.js +287 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/4319.00de505e04749979.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/4377.afed39cdcc4a27ac.js +34 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/4512-aaced97ea8e990bb.js +25 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/4639-33bcab91d6560f78.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/4679-58da0c73ea8fd4c0.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/4739.eb609076dc7d0ce5.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/474.3358006016a4c378.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/4775.4dcbb1305bc9fdc0.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/479-e85749bccf84c3a1.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/4861.4f637b319161ac19.js +94 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/4912.bb366634a6b91a57.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/5015-9e7cd0f0977b5fca.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/5051.8970f4af47f47d8a.js +24 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/5063.29502b1640091906.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/514.d0f3de1f9677a072.js +5 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/5217-4a8b3b42eb940df6.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/5274-170b82d1f713ef4e.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/529.7900408e7a632b2a.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/5319.e66b9cc59edf68ed.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/5481.c7257f98606bca86.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/5486.b2f3ef1cc08a5f44.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/5493.5ad34e07e4d2e24e.js +38 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/5646-4a4067780272d157.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/56667286.ca5125d61802d0fc.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/5771-e4339e65e1a8e6e6.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/5787.6c56877c23d51f70.js +90 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/586.ff5c84cbb8592a98.js +2 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/5980.ed2554b4e5883ef8.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/6037.a946c7b0d3ccbbf2.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/6118.194e7e1a958f3f0e.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/6136.5a9cd50e34193654.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/6177.ab44c9a7bfebdff9.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/6226-be213570dc2842c5.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/624.4f0dbb8a82bae173.js +79 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/6334-5efa5dc3a22e32be.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/6602.87ab7eda9e749a9a.js +36 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/669.7dca63fb3b95ddc1.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/6779-35afb880061a9ed1.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/684.7ca728c023a5be43.js +9 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/6944.e9ef3404b61b22ce.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/697.044dbc2599425241.js +64 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/7016-71707efce1d33e5f.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/703.22d162ce983376c7.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/7147.fd66f2c11680c3e7.js +104 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/730.d287a7a56dc4215c.js +93 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/7504-69e607e9d2ccb233.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/7647.013fa7f7dd501ed8.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/7747.4f032894f7b78fc8.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/7806.06d650368ecaf19f.js +286 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/7845-409d6e1159d19ed2.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/8047-92020eb3411682d0.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/8066.c20a12b9b6773b64.js +24 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/8279.57d08b9e979bc906.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/83-f25b23c8bea39fe4.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/8415.bcf8d2b3ea589c60.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/8650.c195cacb1e3abfaf.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/8668.b01c159a88f542c0.js +41 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/8998.06aa9e56b8064e1b.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/9032.acf91f7cb1584b78.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/9383.40bd9676ab465b77.js +74 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/9460.65cd2094d0bc9c9c.js +309 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/9482.2b76ee1769f3ec4e.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/9673-ba8a3c4683caac32.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/9716.2185e2ff59e8ba1e.js +193 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/a886a261.307a967dd06d12b7.js +66 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/_not-found/page-c775796a00d9389e.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/apps/page-7775cfa4c480b4db.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/apps/report/page-6e3a012662c704c6.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/board/page-755cecfc4a9b8ed8.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/chat/page-b616ac17834db5d8.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/credentials/page-8182cf153d7d41f8.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/credentials/register/claim/page-3f539594c23d3f8e.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/credentials/register/page-ea4f262cb9aba420.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/design-check/page-8165faf239f6e27e.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/editor/page-1cf7bd94569f060b.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/healthz/route-c775796a00d9389e.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/layout-444d1c4c8fabdbea.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/live-run/adaptive/page-1f4aee3b56fd22f0.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/live-run/page-29d6b10ace96d7af.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/member/invite/page-02ec6c1f61c37ed7.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/not-found-008e905e8d38bf0b.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/ops/release/page-770c3b6e5356cc91.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/page-c775796a00d9389e.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/settings/page-93b362aa4a88d529.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/setup/done/page-1cf98810677499bc.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/setup/layout-c775796a00d9389e.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/setup/page-9698cb2297abfb29.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/share/received/page-3be6f5986ce29402.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/signup/complete/page-c5b4b6795a11f869.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/signup/page-fc2da335d0504034.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/term/page-3f7ee4b011d2ef8b.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/app/vault/page-4c7e6af7c5347116.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/bffd1d00-2d9bdb4c8a5d9104.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/cd29f327-7f91f59b9139237c.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/d110d9e0.f5573b826f27af65.js +160 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/d14cd3a4.6d09bf3f19730f21.js +122 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/db225b10.128c168f4a6546cf.js +62 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/framework-8678a23bfc3bab37.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/main-ad7216630e0b83b8.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/main-app-4572a82b0e60345c.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/pages/_app-9a06989434b6a0f6.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/pages/_error-47654d73dd8821dc.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/chunks/webpack-1e12b19ca7234d95.js +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/css/085673d826b98b62.css +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/css/0963166d1794fcd2.css +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/css/0d7fd8c441e32b99.css +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/css/599369d853c61df7.css +31 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/css/659eccb5db697b76.css +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/media/22a5144ee8d83bca-s.p.woff2 +0 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/media/9766a7e9e2e0ad5a-s.woff2 +0 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/media/aa016aab0e6d1295-s.woff2 +0 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/media/b66cf8e69499582a-s.woff2 +0 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/_next/static/media/f639721981034f88-s.woff2 +0 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/apps/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/apps/index.txt +33 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/apps/report/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/apps/report/index.txt +33 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/board/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/board/index.txt +33 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/chat/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/chat/index.txt +30 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/credentials/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/credentials/index.txt +33 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/credentials/register/claim/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/credentials/register/claim/index.txt +33 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/credentials/register/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/credentials/register/index.txt +33 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/design-check/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/design-check/index.txt +33 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/editor/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/editor/index.txt +35 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/fonts/JetBrainsMonoNerdFontMono-Bold.ttf +0 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/fonts/JetBrainsMonoNerdFontMono-BoldItalic.ttf +0 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/fonts/JetBrainsMonoNerdFontMono-Italic.ttf +0 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/fonts/JetBrainsMonoNerdFontMono-Regular.ttf +0 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/healthz +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/icons/elanous-16.png +0 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/icons/elanous-180.png +0 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/icons/elanous-192.png +0 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/icons/elanous-32.png +0 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/icons/elanous-512.png +0 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/index.txt +30 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/live-run/adaptive/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/live-run/adaptive/index.txt +31 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/live-run/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/live-run/index.txt +35 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/manifest.webmanifest +31 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/member/invite/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/member/invite/index.txt +33 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/offline.html +84 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/ops/release/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/ops/release/index.txt +34 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/settings/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/settings/index.txt +33 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/setup/done/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/setup/done/index.txt +33 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/setup/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/setup/index.txt +33 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/share/received/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/share/received/index.txt +33 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/signup/complete/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/signup/complete/index.txt +33 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/signup/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/signup/index.txt +33 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/sw-strategies.js +44 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/sw.js +388 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/term/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/term/index.txt +33 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/vault/index.html +1 -0
- package/apps/pwa/.pwa-generations/1794438971150-31097a5b-df19-4054-81ae-c523427dd7b2/vault/index.txt +33 -0
- package/apps/pwa/README.md +59 -0
- package/apps/pwa/bun.lock +1530 -0
- package/apps/pwa/components.json +25 -0
- package/apps/pwa/next.config.ts +60 -0
- package/apps/pwa/package-lock.json +7538 -0
- package/apps/pwa/package.json +73 -0
- package/apps/pwa/postcss.config.mjs +5 -0
- package/apps/pwa/public/fonts/JetBrainsMonoNerdFontMono-Bold.ttf +0 -0
- package/apps/pwa/public/fonts/JetBrainsMonoNerdFontMono-BoldItalic.ttf +0 -0
- package/apps/pwa/public/fonts/JetBrainsMonoNerdFontMono-Italic.ttf +0 -0
- package/apps/pwa/public/fonts/JetBrainsMonoNerdFontMono-Regular.ttf +0 -0
- package/apps/pwa/public/icons/elanous-16.png +0 -0
- package/apps/pwa/public/icons/elanous-180.png +0 -0
- package/apps/pwa/public/icons/elanous-192.png +0 -0
- package/apps/pwa/public/icons/elanous-32.png +0 -0
- package/apps/pwa/public/icons/elanous-512.png +0 -0
- package/apps/pwa/public/manifest.webmanifest +31 -0
- package/apps/pwa/public/offline.html +84 -0
- package/apps/pwa/public/sw-strategies.js +44 -0
- package/apps/pwa/public/sw.js +388 -0
- package/apps/pwa/scripts/publish-static-generation.ts +80 -0
- package/apps/pwa/scripts/static-entry.ts +54 -0
- package/apps/pwa/scripts/static-generation.ts +190 -0
- package/apps/pwa/src/app/apps/page.tsx +135 -0
- package/apps/pwa/src/app/apps/report/page.tsx +50 -0
- package/apps/pwa/src/app/board/page.tsx +12 -0
- package/apps/pwa/src/app/chat/page.tsx +5 -0
- package/apps/pwa/src/app/credentials/CredentialVaultView.tsx +99 -0
- package/apps/pwa/src/app/credentials/page.tsx +15 -0
- package/apps/pwa/src/app/credentials/register/CredentialRegisterView.tsx +123 -0
- package/apps/pwa/src/app/credentials/register/claim/CredentialClaimView.tsx +88 -0
- package/apps/pwa/src/app/credentials/register/claim/page.tsx +35 -0
- package/apps/pwa/src/app/credentials/register/page.tsx +18 -0
- package/apps/pwa/src/app/design-check/page.tsx +17 -0
- package/apps/pwa/src/app/editor/page.tsx +8 -0
- package/apps/pwa/src/app/globals.css +351 -0
- package/apps/pwa/src/app/healthz/route.ts +12 -0
- package/apps/pwa/src/app/layout.tsx +77 -0
- package/apps/pwa/src/app/live-run/adaptive/page.tsx +6 -0
- package/apps/pwa/src/app/live-run/page.tsx +94 -0
- package/apps/pwa/src/app/member/invite/page.tsx +75 -0
- package/apps/pwa/src/app/not-found.tsx +29 -0
- package/apps/pwa/src/app/ops/release/page.tsx +8 -0
- package/apps/pwa/src/app/page.tsx +5 -0
- package/apps/pwa/src/app/settings/page.tsx +13 -0
- package/apps/pwa/src/app/setup/done/SetupNextSteps.tsx +75 -0
- package/apps/pwa/src/app/setup/done/page.tsx +182 -0
- package/apps/pwa/src/app/setup/done/setup-links.ts +55 -0
- package/apps/pwa/src/app/setup/layout.tsx +33 -0
- package/apps/pwa/src/app/setup/page.tsx +501 -0
- package/apps/pwa/src/app/share/received/page.tsx +86 -0
- package/apps/pwa/src/app/signup/complete/page.tsx +92 -0
- package/apps/pwa/src/app/signup/page.tsx +62 -0
- package/apps/pwa/src/app/term/page.tsx +29 -0
- package/apps/pwa/src/app/term/pty-selection-url.ts +8 -0
- package/apps/pwa/src/app/vault/page.tsx +14 -0
- package/apps/pwa/src/components/agent/CollapsibleCodeBlock.tsx +90 -0
- package/apps/pwa/src/components/apps/AppSimLiveView.tsx +161 -0
- package/apps/pwa/src/components/ask-user-question/AskQuestionSheet.tsx +309 -0
- package/apps/pwa/src/components/ask-user-question/use-ask-question.ts +167 -0
- package/apps/pwa/src/components/chat/BudgetPill.tsx +92 -0
- package/apps/pwa/src/components/chat/ChatApprovalsChip.tsx +74 -0
- package/apps/pwa/src/components/chat/ChatConversationList.tsx +190 -0
- package/apps/pwa/src/components/chat/ChatCurrentProject.tsx +239 -0
- package/apps/pwa/src/components/chat/ChatDecisionsChip.tsx +95 -0
- package/apps/pwa/src/components/chat/ChatDropOverlay.tsx +17 -0
- package/apps/pwa/src/components/chat/ChatHistory.tsx +266 -0
- package/apps/pwa/src/components/chat/ChatInput.tsx +1091 -0
- package/apps/pwa/src/components/chat/ChatLayout.tsx +1594 -0
- package/apps/pwa/src/components/chat/ChatMessage.tsx +380 -0
- package/apps/pwa/src/components/chat/ChatPanel.tsx +96 -0
- package/apps/pwa/src/components/chat/ChatPendingDecision.tsx +76 -0
- package/apps/pwa/src/components/chat/ChatProjectSwitcher.tsx +101 -0
- package/apps/pwa/src/components/chat/ChatQueueChips.tsx +20 -0
- package/apps/pwa/src/components/chat/ContextSourcesCard.tsx +14 -0
- package/apps/pwa/src/components/chat/DeployConfirmCard.tsx +13 -0
- package/apps/pwa/src/components/chat/DeployResultCard.tsx +18 -0
- package/apps/pwa/src/components/chat/ElanousCard.tsx +80 -0
- package/apps/pwa/src/components/chat/ElanousProviderChip.tsx +85 -0
- package/apps/pwa/src/components/chat/HarnessAskCard.tsx +61 -0
- package/apps/pwa/src/components/chat/MemberProposalCard.tsx +75 -0
- package/apps/pwa/src/components/chat/MobileChatStatus.tsx +32 -0
- package/apps/pwa/src/components/chat/NowSpeakButton.tsx +78 -0
- package/apps/pwa/src/components/chat/SeatPicker.tsx +27 -0
- package/apps/pwa/src/components/chat/SeatsNowStrip.tsx +43 -0
- package/apps/pwa/src/components/chat/SessionDeleteConfirm.tsx +91 -0
- package/apps/pwa/src/components/chat/SessionIdChip.tsx +120 -0
- package/apps/pwa/src/components/chat/SessionPill.tsx +276 -0
- package/apps/pwa/src/components/chat/VoiceCostPill.tsx +114 -0
- package/apps/pwa/src/components/chat/VoiceOverlay.tsx +181 -0
- package/apps/pwa/src/components/chat/blocks/ChatHud.tsx +165 -0
- package/apps/pwa/src/components/chat/blocks/ChatHudGaugeBar.tsx +90 -0
- package/apps/pwa/src/components/chat/blocks/DebugTapDrawer.tsx +189 -0
- package/apps/pwa/src/components/chat/blocks/DiffBlock.tsx +114 -0
- package/apps/pwa/src/components/chat/blocks/McpAppBlock.tsx +103 -0
- package/apps/pwa/src/components/chat/blocks/McpAppFrame.tsx +81 -0
- package/apps/pwa/src/components/chat/blocks/PerfTickSparkline.tsx +154 -0
- package/apps/pwa/src/components/chat/blocks/PlanBlock.tsx +70 -0
- package/apps/pwa/src/components/chat/blocks/SearchHitList.tsx +122 -0
- package/apps/pwa/src/components/chat/blocks/StatusChip.tsx +63 -0
- package/apps/pwa/src/components/chat/blocks/ThinkingPill.tsx +63 -0
- package/apps/pwa/src/components/chat/blocks/ToolProgressCard.tsx +106 -0
- package/apps/pwa/src/components/chat/budget-pill-view.ts +22 -0
- package/apps/pwa/src/components/chat/context-sources.ts +88 -0
- package/apps/pwa/src/components/chat/seats-now-line.ts +20 -0
- package/apps/pwa/src/components/chat/session-id-utils.ts +22 -0
- package/apps/pwa/src/components/decisions/DecisionCard.tsx +28 -0
- package/apps/pwa/src/components/design/DesignCheckPanel.tsx +318 -0
- package/apps/pwa/src/components/design/DirectionCards.tsx +178 -0
- package/apps/pwa/src/components/design/MakeMySystem.tsx +177 -0
- package/apps/pwa/src/components/editor/GraphCanvasEditor.tsx +853 -0
- package/apps/pwa/src/components/editor/GraphCanvasRunStatus.tsx +88 -0
- package/apps/pwa/src/components/editor/GraphEditor.tsx +357 -0
- package/apps/pwa/src/components/editor/GraphGroupBox.tsx +47 -0
- package/apps/pwa/src/components/editor/GraphRunControl.tsx +127 -0
- package/apps/pwa/src/components/editor/GraphWizardChat.tsx +292 -0
- package/apps/pwa/src/components/editor/graph-canvas-model.ts +570 -0
- package/apps/pwa/src/components/editor/graph-canvas-save.ts +52 -0
- package/apps/pwa/src/components/editor/graph-editor-mode.ts +41 -0
- package/apps/pwa/src/components/editor/graph-groups.ts +139 -0
- package/apps/pwa/src/components/editor/graph-wizard.ts +154 -0
- package/apps/pwa/src/components/editor/use-wizard-canvas.ts +66 -0
- package/apps/pwa/src/components/exec/ExecApprovals.tsx +77 -0
- package/apps/pwa/src/components/fluent-chain/NextFluentChip.tsx +91 -0
- package/apps/pwa/src/components/idle-nudge/IdleNudgeBadge.tsx +79 -0
- package/apps/pwa/src/components/inside/loop-agents-view.ts +75 -0
- package/apps/pwa/src/components/inside/pty-decisions.ts +72 -0
- package/apps/pwa/src/components/inside/public-text.ts +35 -0
- package/apps/pwa/src/components/install-banner.tsx +192 -0
- package/apps/pwa/src/components/intent-panel/IntentButton.tsx +67 -0
- package/apps/pwa/src/components/intent-panel/IntentPanel.tsx +244 -0
- package/apps/pwa/src/components/intent-panel/intent-panel-storage.ts +140 -0
- package/apps/pwa/src/components/intent-panel/use-intent-prediction.ts +269 -0
- package/apps/pwa/src/components/live-run/AdaptiveGraphReplay.tsx +115 -0
- package/apps/pwa/src/components/live-run/GraphInstanceLiveScreen.tsx +95 -0
- package/apps/pwa/src/components/live-run/GraphInstanceRichView.tsx +124 -0
- package/apps/pwa/src/components/live-run/GraphInstanceSimulationScreen.tsx +34 -0
- package/apps/pwa/src/components/live-run/LiveRunAutoFollowPanel.tsx +70 -0
- package/apps/pwa/src/components/live-run/LiveRunGraph.tsx +621 -0
- package/apps/pwa/src/components/live-run/LiveRunPanel.tsx +96 -0
- package/apps/pwa/src/components/live-run/live-run-stage.css +62 -0
- package/apps/pwa/src/components/loops/loop-status.ts +5 -0
- package/apps/pwa/src/components/member-board/MemberMiniBoardView.tsx +163 -0
- package/apps/pwa/src/components/member-board/member-board-model.ts +113 -0
- package/apps/pwa/src/components/nexus/ChannelBotSetupCard.tsx +103 -0
- package/apps/pwa/src/components/notes/NoteFromImageModal.tsx +477 -0
- package/apps/pwa/src/components/notes/SaveAsNoteButton.tsx +71 -0
- package/apps/pwa/src/components/observatory/subject-list.ts +242 -0
- package/apps/pwa/src/components/ops/GateShards.tsx +87 -0
- package/apps/pwa/src/components/ops/OperatorReleaseRoute.tsx +8 -0
- package/apps/pwa/src/components/ops/ReleaseFlow.tsx +143 -0
- package/apps/pwa/src/components/ops/ReleaseGraphRunView.tsx +89 -0
- package/apps/pwa/src/components/ops/ReleaseRunsView.tsx +227 -0
- package/apps/pwa/src/components/provenance/ProvenanceBadge.tsx +15 -0
- package/apps/pwa/src/components/providers/DaemonProvider.tsx +126 -0
- package/apps/pwa/src/components/providers/NewBuildBanner.tsx +55 -0
- package/apps/pwa/src/components/providers/NexusClientProvider.tsx +69 -0
- package/apps/pwa/src/components/providers/OperatorRoleDefault.tsx +16 -0
- package/apps/pwa/src/components/providers/ServiceWorkerRegister.tsx +32 -0
- package/apps/pwa/src/components/providers/ThemeProvider.tsx +93 -0
- package/apps/pwa/src/components/providers/ToastProvider.tsx +12 -0
- package/apps/pwa/src/components/settings/AdvancedSetupMap.tsx +76 -0
- package/apps/pwa/src/components/settings/AnswerDepthCard.tsx +90 -0
- package/apps/pwa/src/components/settings/BudgetGuardWatcher.tsx +125 -0
- package/apps/pwa/src/components/settings/BudgetThresholdModal.tsx +200 -0
- package/apps/pwa/src/components/settings/BuildInfoCard.tsx +70 -0
- package/apps/pwa/src/components/settings/ChannelBotSetupCard.tsx +107 -0
- package/apps/pwa/src/components/settings/ChatRoutingCard.tsx +67 -0
- package/apps/pwa/src/components/settings/ChildLlmPreferenceCard.tsx +224 -0
- package/apps/pwa/src/components/settings/ConnectTokenCard.tsx +117 -0
- package/apps/pwa/src/components/settings/FastReplyCard.tsx +68 -0
- package/apps/pwa/src/components/settings/IntentPanelSettingsCard.tsx +107 -0
- package/apps/pwa/src/components/settings/LlmCatalogCard.tsx +284 -0
- package/apps/pwa/src/components/settings/LlmHostsCard.tsx +399 -0
- package/apps/pwa/src/components/settings/LlmModelTierCard.tsx +246 -0
- package/apps/pwa/src/components/settings/NotesMetricsCard.tsx +192 -0
- package/apps/pwa/src/components/settings/ObsidianSkillsCard.tsx +125 -0
- package/apps/pwa/src/components/settings/OcrPrefsCard.tsx +106 -0
- package/apps/pwa/src/components/settings/PersonaCard.tsx +353 -0
- package/apps/pwa/src/components/settings/PlatformConnectionsCard.tsx +113 -0
- package/apps/pwa/src/components/settings/PresetCardGrid.tsx +194 -0
- package/apps/pwa/src/components/settings/PushcutSettingsCard.tsx +208 -0
- package/apps/pwa/src/components/settings/QuickSetupCard.tsx +256 -0
- package/apps/pwa/src/components/settings/SettingsPanel.tsx +1184 -0
- package/apps/pwa/src/components/settings/TierChangeConfirmModal.tsx +244 -0
- package/apps/pwa/src/components/settings/TtsModelTierCard.tsx +231 -0
- package/apps/pwa/src/components/settings/TtsVoiceIdPickerCard.tsx +445 -0
- package/apps/pwa/src/components/settings/VoiceModelTierCard.tsx +318 -0
- package/apps/pwa/src/components/settings/VoicePrefsCard.tsx +127 -0
- package/apps/pwa/src/components/settings/WelcomeCard.tsx +126 -0
- package/apps/pwa/src/components/settings/persona-card-edits.ts +21 -0
- package/apps/pwa/src/components/shell/AppShell.tsx +126 -0
- package/apps/pwa/src/components/shell/AuthRequiredBanner.tsx +20 -0
- package/apps/pwa/src/components/shell/CompactTopBar.tsx +90 -0
- package/apps/pwa/src/components/shell/MaturityBanner.tsx +15 -0
- package/apps/pwa/src/components/shell/MobileBottomTabs.tsx +131 -0
- package/apps/pwa/src/components/shell/NavSearchProbe.tsx +13 -0
- package/apps/pwa/src/components/shell/PwaRolePicker.tsx +41 -0
- package/apps/pwa/src/components/shell/ShareCaptureButton.tsx +52 -0
- package/apps/pwa/src/components/shell/SidebarNav.tsx +196 -0
- package/apps/pwa/src/components/shell/SkillProblemsBanner.tsx +75 -0
- package/apps/pwa/src/components/shell/TopBar.tsx +269 -0
- package/apps/pwa/src/components/shell/TopBarActivityIndicator.tsx +51 -0
- package/apps/pwa/src/components/shell/activity-snapshot.ts +98 -0
- package/apps/pwa/src/components/shell/fetch-activity-snapshot.ts +43 -0
- package/apps/pwa/src/components/shell/nav-visibility-prefs.ts +16 -0
- package/apps/pwa/src/components/shell/nav-visit.ts +41 -0
- package/apps/pwa/src/components/shell/sidebar-nav-items.ts +122 -0
- package/apps/pwa/src/components/shell/sidebar-nav-private.ts +4 -0
- package/apps/pwa/src/components/shell/use-nav-visit-log.ts +34 -0
- package/apps/pwa/src/components/shell/use-shell-activity.ts +69 -0
- package/apps/pwa/src/components/showroom/ChainForwardGateModal.tsx +161 -0
- package/apps/pwa/src/components/showroom/CostGateModal.tsx +138 -0
- package/apps/pwa/src/components/showroom/HitlBanner.tsx +107 -0
- package/apps/pwa/src/components/showroom/ShowroomCameraIntake.tsx +263 -0
- package/apps/pwa/src/components/showroom/ShowroomHitlToggle.tsx +63 -0
- package/apps/pwa/src/components/showroom/ShowroomInput.tsx +1105 -0
- package/apps/pwa/src/components/showroom/ShowroomLayout.tsx +2166 -0
- package/apps/pwa/src/components/showroom/ShowroomPanel.tsx +722 -0
- package/apps/pwa/src/components/showroom/ShowroomShortcutHelp.tsx +98 -0
- package/apps/pwa/src/components/showroom/ShowroomVoiceIntake.tsx +271 -0
- package/apps/pwa/src/components/showroom/use-hitl-banner.ts +198 -0
- package/apps/pwa/src/components/terminal/CameraAttachButton.tsx +99 -0
- package/apps/pwa/src/components/terminal/CompactTerminalBar.tsx +54 -0
- package/apps/pwa/src/components/terminal/FileAttachButton.tsx +96 -0
- package/apps/pwa/src/components/terminal/LiveCameraControl.tsx +136 -0
- package/apps/pwa/src/components/terminal/ModifierBar.tsx +263 -0
- package/apps/pwa/src/components/terminal/MultiDeviceIndicator.tsx +117 -0
- package/apps/pwa/src/components/terminal/PtyLiveView.lazy.tsx +31 -0
- package/apps/pwa/src/components/terminal/PtyLiveView.tsx +289 -0
- package/apps/pwa/src/components/terminal/PtyWall.tsx +88 -0
- package/apps/pwa/src/components/terminal/TerminalChatDock.lazy.tsx +7 -0
- package/apps/pwa/src/components/terminal/TerminalChatDock.tsx +649 -0
- package/apps/pwa/src/components/terminal/TerminalControls.tsx +311 -0
- package/apps/pwa/src/components/terminal/TerminalDropZone.tsx +142 -0
- package/apps/pwa/src/components/terminal/TerminalPanel.tsx +936 -0
- package/apps/pwa/src/components/terminal/TerminalTabs.tsx +1108 -0
- package/apps/pwa/src/components/terminal/TuiMirrorView.lazy.tsx +8 -0
- package/apps/pwa/src/components/terminal/TuiMirrorView.tsx +129 -0
- package/apps/pwa/src/components/terminal/XtermView.lazy.tsx +30 -0
- package/apps/pwa/src/components/terminal/XtermView.tsx +658 -0
- package/apps/pwa/src/components/terminal/acp-failure.ts +21 -0
- package/apps/pwa/src/components/terminal/initial-terminal-notice.ts +45 -0
- package/apps/pwa/src/components/terminal/pane-layout.ts +132 -0
- package/apps/pwa/src/components/terminal/pane-plan.ts +73 -0
- package/apps/pwa/src/components/terminal/panel-view-state.ts +35 -0
- package/apps/pwa/src/components/terminal/pty-live-poll.ts +57 -0
- package/apps/pwa/src/components/terminal/pty-mouse-forward.ts +22 -0
- package/apps/pwa/src/components/terminal/pty-terminal-list.ts +470 -0
- package/apps/pwa/src/components/terminal/pty-terminal-row-summary.ts +129 -0
- package/apps/pwa/src/components/terminal/pty-wall.ts +46 -0
- package/apps/pwa/src/components/terminal/rename-outcome.ts +22 -0
- package/apps/pwa/src/components/terminal/tab-close-intent.ts +45 -0
- package/apps/pwa/src/components/terminal/terminal-chip-label.ts +78 -0
- package/apps/pwa/src/components/terminal/terminal-clear.ts +3 -0
- package/apps/pwa/src/components/terminal/terminal-input-registry.ts +87 -0
- package/apps/pwa/src/components/terminal/terminal-input-sender.ts +99 -0
- package/apps/pwa/src/components/terminal/terminal-origin-label.ts +22 -0
- package/apps/pwa/src/components/terminal/touch-scroll.ts +86 -0
- package/apps/pwa/src/components/tool-approval/ToolApprovalSheet.tsx +67 -0
- package/apps/pwa/src/components/tool-approval/use-tool-approval.ts +124 -0
- package/apps/pwa/src/components/ui/api-key-field.tsx +154 -0
- package/apps/pwa/src/components/ui/button.tsx +58 -0
- package/apps/pwa/src/components/ui/dialog.tsx +160 -0
- package/apps/pwa/src/components/ui/input.tsx +20 -0
- package/apps/pwa/src/components/ui/scroll-area.tsx +55 -0
- package/apps/pwa/src/components/ui/sheet.tsx +138 -0
- package/apps/pwa/src/components/ui/sonner.tsx +49 -0
- package/apps/pwa/src/components/ui/tabs.tsx +82 -0
- package/apps/pwa/src/components/ui/tooltip.tsx +66 -0
- package/apps/pwa/src/components/vault/MermaidDiagram.tsx +163 -0
- package/apps/pwa/src/components/vault/NewNoteDialog.tsx +73 -0
- package/apps/pwa/src/components/vault/NoteEditor.tsx +196 -0
- package/apps/pwa/src/components/vault/VaultGraph.tsx +77 -0
- package/apps/pwa/src/components/vault/VaultMarkdown.tsx +112 -0
- package/apps/pwa/src/components/vault/VaultPanel.tsx +216 -0
- package/apps/pwa/src/components/vault/VaultTagsPanel.tsx +47 -0
- package/apps/pwa/src/components/vault/mermaid-theme.ts +42 -0
- package/apps/pwa/src/components/voice/TailscaleSecurityBanner.tsx +108 -0
- package/apps/pwa/src/components/workflows/ApprovalModal.tsx +145 -0
- package/apps/pwa/src/components/workflows/ChatPreviewPanel.tsx +144 -0
- package/apps/pwa/src/components/workflows/ExpressionInput.tsx +212 -0
- package/apps/pwa/src/components/workflows/NodeRunPanel.tsx +134 -0
- package/apps/pwa/src/components/workflows/PluginCredentialsField.tsx +131 -0
- package/apps/pwa/src/components/workflows/RunGraphShowcase.tsx +183 -0
- package/apps/pwa/src/components/workflows/RunGraphView.tsx +343 -0
- package/apps/pwa/src/components/workflows/RunsListPanel.tsx +211 -0
- package/apps/pwa/src/components/workflows/SchemaForm.tsx +119 -0
- package/apps/pwa/src/components/workflows/TidyEdge.tsx +44 -0
- package/apps/pwa/src/components/workflows/WorkflowCreateModal.tsx +260 -0
- package/apps/pwa/src/components/workflows/WorkflowGraph.tsx +1151 -0
- package/apps/pwa/src/components/workflows/WorkflowHistoryPanel.tsx +93 -0
- package/apps/pwa/src/components/workflows/WorkflowNLPrompt.tsx +199 -0
- package/apps/pwa/src/components/workflows/WorkflowNodeEditor.tsx +509 -0
- package/apps/pwa/src/components/workflows/WorkflowPublishPanel.tsx +54 -0
- package/apps/pwa/src/components/workflows/WorkflowSynthPreview.tsx +122 -0
- package/apps/pwa/src/components/workflows/WorkflowsPanel.tsx +1226 -0
- package/apps/pwa/src/components/workflows/expression-completion.ts +43 -0
- package/apps/pwa/src/components/workflows/graph-clipboard.ts +78 -0
- package/apps/pwa/src/components/workflows/graph-drop.ts +56 -0
- package/apps/pwa/src/components/workflows/graph-history.ts +40 -0
- package/apps/pwa/src/components/workflows/graph-notes.ts +47 -0
- package/apps/pwa/src/components/workflows/node-run-result.ts +36 -0
- package/apps/pwa/src/components/workflows/node-status-class.ts +14 -0
- package/apps/pwa/src/components/workflows/node-status.css +152 -0
- package/apps/pwa/src/components/workflows/phone-pane.ts +9 -0
- package/apps/pwa/src/components/workflows/run-status-helpers.ts +126 -0
- package/apps/pwa/src/components/workflows/schema-form.ts +222 -0
- package/apps/pwa/src/components/workflows/triggers/ChatTriggerEditor.tsx +170 -0
- package/apps/pwa/src/components/workflows/triggers/DiscordTriggerEditor.tsx +152 -0
- package/apps/pwa/src/components/workflows/triggers/HttpRequestEditor.tsx +287 -0
- package/apps/pwa/src/components/workflows/triggers/ManualTriggerEditor.tsx +94 -0
- package/apps/pwa/src/components/workflows/triggers/ScheduleTriggerEditor.tsx +235 -0
- package/apps/pwa/src/components/workflows/triggers/TelegramTriggerEditor.tsx +160 -0
- package/apps/pwa/src/components/workflows/triggers/TriggerEditorBase.tsx +78 -0
- package/apps/pwa/src/components/workflows/triggers/WebhookTriggerEditor.tsx +197 -0
- package/apps/pwa/src/components/workflows/triggers/cron-preview.ts +81 -0
- package/apps/pwa/src/components/workflows/triggers/trigger-card-preview.ts +125 -0
- package/apps/pwa/src/components/workflows/use-graph-history.ts +32 -0
- package/apps/pwa/src/components/workflows/useKeyboardShortcuts.ts +81 -0
- package/apps/pwa/src/components/workflows/usePanelLayout.ts +135 -0
- package/apps/pwa/src/components/workflows/validation-helpers.ts +122 -0
- package/apps/pwa/src/components/workflows/workflow-file.ts +38 -0
- package/apps/pwa/src/components/workflows/workflow-graph-layout.ts +526 -0
- package/apps/pwa/src/components/workflows/workflow-graph-mutations.ts +415 -0
- package/apps/pwa/src/components/workflows/workflow-publish.ts +50 -0
- package/apps/pwa/src/components/workflows/workflow-save.ts +60 -0
- package/apps/pwa/src/lib/adaptive-graph-replay.ts +57 -0
- package/apps/pwa/src/lib/attachment-content.ts +140 -0
- package/apps/pwa/src/lib/audio-stt-extract.ts +69 -0
- package/apps/pwa/src/lib/auth-required.ts +30 -0
- package/apps/pwa/src/lib/bot-rounds.ts +129 -0
- package/apps/pwa/src/lib/botlab-wall.ts +64 -0
- package/apps/pwa/src/lib/budget-status.ts +114 -0
- package/apps/pwa/src/lib/camera-intake.ts +140 -0
- package/apps/pwa/src/lib/card-followup-client.ts +149 -0
- package/apps/pwa/src/lib/chat-autoscroll.ts +127 -0
- package/apps/pwa/src/lib/chat-deploy.ts +62 -0
- package/apps/pwa/src/lib/chat-fork.ts +31 -0
- package/apps/pwa/src/lib/chat-harness-ask.ts +24 -0
- package/apps/pwa/src/lib/chat-model-commands.ts +104 -0
- package/apps/pwa/src/lib/chat-paste-drop.ts +55 -0
- package/apps/pwa/src/lib/chat-persona.ts +38 -0
- package/apps/pwa/src/lib/chat-queue.ts +24 -0
- package/apps/pwa/src/lib/chat-routing-storage.ts +67 -0
- package/apps/pwa/src/lib/chat-runtime.ts +1956 -0
- package/apps/pwa/src/lib/chat-session-commands.ts +88 -0
- package/apps/pwa/src/lib/chat-status.ts +78 -0
- package/apps/pwa/src/lib/code-block-preview.ts +66 -0
- package/apps/pwa/src/lib/compact-mode.ts +52 -0
- package/apps/pwa/src/lib/control-signals-api.ts +76 -0
- package/apps/pwa/src/lib/daemon-client.ts +2637 -0
- package/apps/pwa/src/lib/daemon-config.ts +129 -0
- package/apps/pwa/src/lib/daemon-session.ts +51 -0
- package/apps/pwa/src/lib/debug.ts +391 -0
- package/apps/pwa/src/lib/decisions-api.ts +71 -0
- package/apps/pwa/src/lib/devices-api.ts +88 -0
- package/apps/pwa/src/lib/dock-attachment-count.ts +4 -0
- package/apps/pwa/src/lib/dock-history-hydrate.ts +149 -0
- package/apps/pwa/src/lib/drop-overlay.ts +14 -0
- package/apps/pwa/src/lib/elanous-ask-extensions.ts +90 -0
- package/apps/pwa/src/lib/elanous-card.ts +92 -0
- package/apps/pwa/src/lib/elanous-feedback-envelope.ts +40 -0
- package/apps/pwa/src/lib/elanous-term-envelope.ts +115 -0
- package/apps/pwa/src/lib/elevenlabs-voices.ts +115 -0
- package/apps/pwa/src/lib/feedback-block-accumulator.ts +567 -0
- package/apps/pwa/src/lib/feedback-envelope.ts +78 -0
- package/apps/pwa/src/lib/field-pick-limits.ts +30 -0
- package/apps/pwa/src/lib/fluent-chain-api.ts +111 -0
- package/apps/pwa/src/lib/graph-approvals-api.ts +112 -0
- package/apps/pwa/src/lib/graph-edge-route.ts +480 -0
- package/apps/pwa/src/lib/graph-run-api.ts +91 -0
- package/apps/pwa/src/lib/graph-wiring.css +9 -0
- package/apps/pwa/src/lib/hosted-chat-runtime.ts +158 -0
- package/apps/pwa/src/lib/hw-keyboard.ts +30 -0
- package/apps/pwa/src/lib/idle-nudge-api.ts +79 -0
- package/apps/pwa/src/lib/inject-attachment-paths.ts +83 -0
- package/apps/pwa/src/lib/inside-events.ts +219 -0
- package/apps/pwa/src/lib/install-banner-state.ts +106 -0
- package/apps/pwa/src/lib/intake-absorb-status.ts +27 -0
- package/apps/pwa/src/lib/intake-front-door-api.ts +127 -0
- package/apps/pwa/src/lib/intake-pipeline-api.ts +192 -0
- package/apps/pwa/src/lib/intake-run-timeline.ts +31 -0
- package/apps/pwa/src/lib/key-sequences.ts +116 -0
- package/apps/pwa/src/lib/live-gate-decision.ts +139 -0
- package/apps/pwa/src/lib/live-public.ts +92 -0
- package/apps/pwa/src/lib/live-run-metrics.ts +56 -0
- package/apps/pwa/src/lib/live-run-scene.ts +120 -0
- package/apps/pwa/src/lib/live-run-stage.ts +175 -0
- package/apps/pwa/src/lib/live-run-view.ts +89 -0
- package/apps/pwa/src/lib/live-signals.ts +341 -0
- package/apps/pwa/src/lib/live-v5.ts +244 -0
- package/apps/pwa/src/lib/markdown-render.ts +8 -0
- package/apps/pwa/src/lib/mcp-app-bridge-host.ts +102 -0
- package/apps/pwa/src/lib/mcp-app-bridge.ts +474 -0
- package/apps/pwa/src/lib/mcp-app-csp.ts +68 -0
- package/apps/pwa/src/lib/mcp-app-resource.ts +90 -0
- package/apps/pwa/src/lib/member-invite-api.ts +39 -0
- package/apps/pwa/src/lib/member-mini-board-api.ts +75 -0
- package/apps/pwa/src/lib/member-signup-intent.ts +20 -0
- package/apps/pwa/src/lib/merge-approvals-api.ts +94 -0
- package/apps/pwa/src/lib/migrate-base-url.ts +64 -0
- package/apps/pwa/src/lib/mini-board-projection.ts +129 -0
- package/apps/pwa/src/lib/model-tier-prefs.ts +115 -0
- package/apps/pwa/src/lib/model-tier-spec.ts +339 -0
- package/apps/pwa/src/lib/model-tier-sync.ts +408 -0
- package/apps/pwa/src/lib/morning-showroom-api.ts +78 -0
- package/apps/pwa/src/lib/new-build.ts +14 -0
- package/apps/pwa/src/lib/notification-target-select.ts +76 -0
- package/apps/pwa/src/lib/ocr-prefs.ts +79 -0
- package/apps/pwa/src/lib/operator-role.ts +40 -0
- package/apps/pwa/src/lib/ops-api.ts +285 -0
- package/apps/pwa/src/lib/outputs-api.ts +20 -0
- package/apps/pwa/src/lib/peer-id.ts +40 -0
- package/apps/pwa/src/lib/preset-catalog.ts +92 -0
- package/apps/pwa/src/lib/projects-api.ts +67 -0
- package/apps/pwa/src/lib/provenance-badge.ts +26 -0
- package/apps/pwa/src/lib/public-app-report.ts +18 -0
- package/apps/pwa/src/lib/public-capture.tsx +19 -0
- package/apps/pwa/src/lib/pushcut-runtime.ts +144 -0
- package/apps/pwa/src/lib/pwa-role.ts +37 -0
- package/apps/pwa/src/lib/quiet-surface.ts +37 -0
- package/apps/pwa/src/lib/register-sw.ts +100 -0
- package/apps/pwa/src/lib/research-fan.ts +93 -0
- package/apps/pwa/src/lib/route-maturity.ts +28 -0
- package/apps/pwa/src/lib/run-graph-flow.ts +144 -0
- package/apps/pwa/src/lib/run-graph-yaml-edit.ts +393 -0
- package/apps/pwa/src/lib/secure-context-guard.ts +112 -0
- package/apps/pwa/src/lib/session-restore.ts +269 -0
- package/apps/pwa/src/lib/sessions-service.ts +294 -0
- package/apps/pwa/src/lib/sessions-store-api.ts +96 -0
- package/apps/pwa/src/lib/setup-link.ts +42 -0
- package/apps/pwa/src/lib/share-capture.ts +119 -0
- package/apps/pwa/src/lib/share-prefill.ts +21 -0
- package/apps/pwa/src/lib/share-scraps.ts +140 -0
- package/apps/pwa/src/lib/share-target-store.ts +234 -0
- package/apps/pwa/src/lib/shared-event-source.ts +158 -0
- package/apps/pwa/src/lib/show-beta.ts +48 -0
- package/apps/pwa/src/lib/showroom/cost-estimator.ts +97 -0
- package/apps/pwa/src/lib/showroom/hitl-toggle.ts +45 -0
- package/apps/pwa/src/lib/showroom/runtime.ts +1386 -0
- package/apps/pwa/src/lib/showroom/storage.ts +260 -0
- package/apps/pwa/src/lib/showroom/types.ts +323 -0
- package/apps/pwa/src/lib/showroom/use-personas.ts +126 -0
- package/apps/pwa/src/lib/showroom/use-resolved-view.ts +179 -0
- package/apps/pwa/src/lib/showroom-keyboard-shortcuts.ts +127 -0
- package/apps/pwa/src/lib/skill-exec-client.ts +54 -0
- package/apps/pwa/src/lib/snapshot.ts +75 -0
- package/apps/pwa/src/lib/swipe-gesture.ts +176 -0
- package/apps/pwa/src/lib/task-api.ts +141 -0
- package/apps/pwa/src/lib/task-card-model.ts +73 -0
- package/apps/pwa/src/lib/term-focus.ts +52 -0
- package/apps/pwa/src/lib/terminal-stream.ts +38 -0
- package/apps/pwa/src/lib/testing/react-hook-harness.ts +269 -0
- package/apps/pwa/src/lib/tui-observe.ts +130 -0
- package/apps/pwa/src/lib/turn-busy.ts +38 -0
- package/apps/pwa/src/lib/upload-attachment.ts +95 -0
- package/apps/pwa/src/lib/use-focus-trap.ts +121 -0
- package/apps/pwa/src/lib/use-live-announcer.ts +79 -0
- package/apps/pwa/src/lib/use-live-camera.ts +289 -0
- package/apps/pwa/src/lib/use-mission-router.ts +126 -0
- package/apps/pwa/src/lib/use-operator.ts +35 -0
- package/apps/pwa/src/lib/use-pointer-capability.ts +53 -0
- package/apps/pwa/src/lib/use-sessions.ts +47 -0
- package/apps/pwa/src/lib/use-wake-lock.ts +104 -0
- package/apps/pwa/src/lib/user-intent-logger.ts +83 -0
- package/apps/pwa/src/lib/utils.ts +6 -0
- package/apps/pwa/src/lib/vault-api.ts +109 -0
- package/apps/pwa/src/lib/vault-helpers.ts +100 -0
- package/apps/pwa/src/lib/vault-tree.ts +22 -0
- package/apps/pwa/src/lib/video-frame-extract.ts +111 -0
- package/apps/pwa/src/lib/voice-intake.ts +232 -0
- package/apps/pwa/src/lib/voice-prefs.ts +81 -0
- package/apps/pwa/src/lib/web-push.ts +213 -0
- package/apps/pwa/src/lib/xterm-capability-filter.ts +50 -0
- package/apps/pwa/src/lib/xterm-resize-controller.ts +162 -0
- package/apps/pwa/src/nexus/client.ts +1719 -0
- package/apps/pwa/src/nexus/components/detail-views/channel-bot-detail.tsx +53 -0
- package/apps/pwa/src/nexus/components/detail-views/chat-detail.tsx +18 -0
- package/apps/pwa/src/nexus/components/detail-views/daemon-detail.tsx +27 -0
- package/apps/pwa/src/nexus/components/detail-views/index.ts +36 -0
- package/apps/pwa/src/nexus/components/detail-views/pwa-host-detail.tsx +33 -0
- package/apps/pwa/src/nexus/components/detail-views/webterm-detail.tsx +16 -0
- package/apps/pwa/src/nexus/components/log-line.tsx +14 -0
- package/apps/pwa/src/nexus/components/mini-term-dock.tsx +83 -0
- package/apps/pwa/src/nexus/components/nexus-sidebar.tsx +77 -0
- package/apps/pwa/src/nexus/components/sidebar-grouping.ts +50 -0
- package/apps/pwa/src/nexus/components/sidebar-tab-item.tsx +54 -0
- package/apps/pwa/src/nexus/components/status-badge.tsx +56 -0
- package/apps/pwa/src/nexus/components/tab-actions.tsx +82 -0
- package/apps/pwa/src/nexus/components/tab-detail.tsx +32 -0
- package/apps/pwa/src/nexus/components/tab-status-panel.tsx +51 -0
- package/apps/pwa/src/nexus/hooks/index.ts +25 -0
- package/apps/pwa/src/nexus/hooks/query-keys.ts +57 -0
- package/apps/pwa/src/nexus/hooks/use-bindings.ts +75 -0
- package/apps/pwa/src/nexus/hooks/use-config.ts +71 -0
- package/apps/pwa/src/nexus/hooks/use-design-check.ts +190 -0
- package/apps/pwa/src/nexus/hooks/use-events.ts +43 -0
- package/apps/pwa/src/nexus/hooks/use-live-signals.ts +71 -0
- package/apps/pwa/src/nexus/hooks/use-nexus-context.tsx +56 -0
- package/apps/pwa/src/nexus/hooks/use-nexus-state.ts +76 -0
- package/apps/pwa/src/nexus/hooks/use-platforms.ts +22 -0
- package/apps/pwa/src/nexus/hooks/use-tab-actions.ts +82 -0
- package/apps/pwa/src/nexus/hooks/use-tab-logs-stream.ts +89 -0
- package/apps/pwa/src/nexus/hooks/use-templates.ts +34 -0
- package/apps/pwa/src/nexus/hooks/use-workflow-pins.ts +34 -0
- package/apps/pwa/src/nexus/hooks/use-workflow-run-modes.ts +18 -0
- package/apps/pwa/src/nexus/hooks/use-workflows.ts +327 -0
- package/apps/pwa/src/nexus/hooks/use-worktrees.ts +76 -0
- package/apps/pwa/src/nexus/runtime-discovery.ts +66 -0
- package/apps/pwa/src/nexus/types.ts +89 -0
- package/apps/pwa/src/test-devices/graph-design-replay.ts +73 -0
- package/apps/pwa/src/voice/barge-in.ts +235 -0
- package/apps/pwa/src/voice/showroom-voice.ts +64 -0
- package/apps/pwa/src/voice/use-showroom-tts.ts +192 -0
- package/apps/pwa/src/voice/use-voice-controller.ts +291 -0
- package/apps/pwa/src/voice/use-voice-tts.ts +169 -0
- package/apps/pwa/src/voice/voice-capture.ts +182 -0
- package/apps/pwa/src/voice/voice-frame-protocol.ts +73 -0
- package/apps/pwa/src/voice/voice-phase-styles.ts +26 -0
- package/apps/pwa/src/voice/voice-playback.ts +73 -0
- package/apps/pwa/src/voice/voice-websocket.ts +191 -0
- package/apps/pwa/tsconfig.json +23 -0
- package/catalog/models/openrouter/onboarding-picks.json +16 -0
- package/catalog/models/openrouter/solar-mini4.yaml +27 -0
- package/catalog/models/openrouter/solar-pro4.yaml +27 -0
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-APP-CONTRACT-SECRET-ENTROPY-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-APP-KILL-SWITCH-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-APP-SCRATCH-BOOTSTRAP-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-APP-UPGRADE-PATH-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-ARG-MACRO-CANVAS-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-ASIDE-FEEDBACK-LOOP-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-AUTHOR-REVIEWER-PRECHECK-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-BACKEND-TIER-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-BOOT-DAEMON-TOOLS-PTY-SHELL-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-BROWSER-HAND-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-BURST-READY-LADDER-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-CENSUS-ORACLE-AXIS-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-CHAIN-LAND-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-CLASSIC-TUI-SEAT-SCENARIOS-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-CLI-CONFIG-AUDIT-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-CODEX-WIRE-CAPTURE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-COMPUTER-USE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-DASHBOARD-EVENT-LOOP-STALL-MONITOR-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-DELETE-IMPACT-SIM-TS.json +4 -0
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-DEVICE-CATALOG-SNAPSHOT-FRAGMENTS-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-DEVICE-FIDELITY-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-DRAFT-INVENTORY-BUILDER-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-EDGE-CREATOR-NIGHTLY-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-EDGE-CREATOR-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-EVENT-MONKEY-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-ABSORB-INGEST-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-ADB-PHONE-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-AGENT-HOOK-HOST-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-ANDROID-CLIENT-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-APP-AUTH-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-APP-DB-BACKUP-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-APP-DB-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-APP-DRIVE-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-APP-FAILURES-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-APP-HOST-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-APP-REALTIME-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-APP-SOURCE-CONCURRENT-WRITER-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-APP-SOURCE-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-APP-STORAGE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-APP-TRAFFIC-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-BIN-ARGS-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-BIN-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-BROWSER-PAGE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-CLOCK-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-CLOUD-BILLING-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-CLOUD-VM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-DATA-GUARD-BOUNDARY-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-DNS-CERT-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-ELEVENLABS-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-FEEDS-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-FETCH-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-FLEET-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-GH-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-GOOGLE-DRIVE-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-HERDR-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-HIGGSFIELD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-KUBECTL-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-LAND-QUEUE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-LINEAR-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-LLM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-MEMBER-OIDC-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-MOBILE-TOOLCHAIN-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-NEXUS-BOARD-SERVER-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-PAYMENT-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-PS-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-RELAY-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-SSH-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-STT-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-TELEGRAM-OUTBOUND-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-TELEGRAM-VIDEO-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAKE-TEMP-CLEANUP-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAULT-CRED-EXPIRY-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAULT-GLM-NO-CREDENTIAL-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAULT-NEEDS-HUMAN-REASON-REPAIR-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAULT-NEXTMOVE-DISPATCH-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAULT-NEXUS-STALL-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAULT-POD-CHILD-RESULT-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAULT-POD-CODEX-503-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAULT-POD-DEATH-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAULT-POD-REUSE-RESIDUE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAULT-POOL-CAP-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAULT-SCOPE-ESCAPE-LIFT-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAULT-SQLITE-BUSY-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FAULT-TUI-400-AUTOHEAL-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FIXTURES-GIT-WORKTREE-ACCEL-LINUX-JSON.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-FLUTTER-DEPLOY-JOURNEY-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GATE-IMAGE-LAYERED-DELTA-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GATE-IMAGE-PREFLIGHT-RUNTIME-IDENTITY-FLOW-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GATE-ROSTER-SECOND-POOL-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GATE-SHARD-HOST-REROUTE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GATE-STEADY-STATE-PROOF-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GCP-ARCHITECT-EXPAND-FAKE-WORLD-TS.json +7 -0
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GCP-ARCHITECT-EXPAND-TIERED-DESIGN-TS.json +6 -0
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GIT-PUSH-TIMEOUT-PARTIAL-OUTCOME-REMOTE-VERIFY-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GOAL-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GOAL-INTERIM-TRACE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GRAPH-DIFF-APPLY-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GRAPH-ENGINE-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GRAPH-EVENT-ENTRY-WORLD-TS.json +5 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GRAPH-PLACEMENT-LEASE-WORLD-TS.json +5 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GRAPH-RUN-LIFECYCLE-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GRAPH-RUNTIME-OVERLAY-EVENT-PATH-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GRAPH-RUNTIME-OVERLAY-EVENT-PATH-WORKER-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GRAPH-TRIGGER-HOOK-DEVICE-TS.json +6 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GRID-CHAOS-DRIVER-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GRID-LEDGER-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-GRID-READY-TIERS-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-HEADLESS-TUI-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-HEAL-REAUTHOR-MATERIALIZED-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-HOTSPOT-FILE-LEASE-WORLD-TS.json +6 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-HQ-MOVE-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-IN-PROCESS-CLI-539-FILE-ADOPTION-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-IN-PROCESS-CLI-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-INPUT-HISTORY-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-INSTALL-CONSENT-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-INTERACTION-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-IOS-CHAT-EDGE-ADAPTER-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-KAIST-APP-QR-SIM-TS.json +7 -0
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-KAIST-CLASSIC-PWA-BROWSER-REPLAY-TS.json +7 -0
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-KAIST-CLASSIC-PWA-REPLAY-WORLD-TS.json +7 -0
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-LINEAR-SECRETARY-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-MAPREDUCE-MULTIHOST-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-MOCK-AUTHORING-FIRST-RUN-CHILD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-MOCK-AUTHORING-FIRST-RUN-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-MOCK-DEVICE-REQUESTS-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-MOCK-SCENARIO-CATALOG-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-MOCK-SEAT-PTY-FRAME-CHILD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-MOCK-SEAT-PTY-FRAME-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-MOCK-SEAT-PTY-SEQUENCE-CHILD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-MOCK-SEAT-PTY-SEQUENCE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-MULTI-ACTOR-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-MULTI-TENANT-RELAY-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-NETWORK-SANDBOX-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-NEXT-TUI-CORE-INPUT-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-NEXT-TUI-PLUGIN-WIZARD-WORLD-TS.json +8 -0
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-NEXT-TUI-ROUTE-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-NEXT-TUI-SEAT-SCENARIOS-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-NL-SCENARIO-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-ONBOARDING-FIRST-RUN-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-OUTBOUND-GUARD-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-PLUGIN-RELEASE-OBSERVE-ROUTE-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-PLUGIN-YAML-GEN-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-POD-FEDERATION-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-POD-PHASE-PREWARM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-POD-REUSE-MATCH-BY-KIND-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-POD-REUSE-SHARED-FAKE-BOUNDARY-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-POD-REUSE-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-PR-LAND-DRIFT-AUTOREPAIR-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-PR-LAND-DRIFT-GATE-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-PTY-KEY-MODIFIERS-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-PUBLIC-AUTH-PROVIDER-CLOUD-VM-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-PWA-PROVENANCE-BADGE-WORLD-TS.json +6 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-PWA-RETAINED-ROUTES-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-READINESS-COUNTDOWN-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-REAL-TARGET-SANDBOX-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-RELEASE-EVENT-TRACE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-RELEASE-PUBLISH-DEVICES-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-RELEASE-SAME-VERSION-RUN-ADOPTION-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-RELEASE-SIM-RIG-SEAT-GUARD-CHILD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-RELEASE-SIM-RIG-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-RENDER-FRAME-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-RESEARCH-DECISION-CHAIN-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-RESUME-PICKER-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-RLA-EVENT-RESPONSE-SCORECARD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-RLA-MACROPHAGE-HEAL-TIMEOUT-STALE-OUTPUT-SIM-TS.json +6 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-SAFE-PUBLIC-COPY-PUBLISH-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-SCENARIO-TARGET-TS.json +6 -0
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-SCENARIO-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-SECRET-CANARY-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-SEMINAR-REHEARSAL-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-SERVICE-KEY-SETUP-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-SESSION-ID-SEED-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-SIM-COVERAGE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-SIM-RECEIPT-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-SKILLS-TOOLS-SHELL-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-SLASH-MENU-FRAMES-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-SMART-MERGE-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-SUBAGENT-TOOLS-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-TA-LAND-COUNT-DISPATCHER-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-TASK-AGENT-PARENT-HOST-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-TASK-AGENT-REJUDGE-ON-HEAD-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-TASK-ORCHESTRATOR-SURFACES-SELF-IMPLEMENT-POD-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-TEMP-GIT-REMOTE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-TEMP-GIT-REPO-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-TERM-SLASH-DEVICE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-TOOL-ASYNC-FAIL-LOOP-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-TOOL-ROUTER-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-TRAIN-MANAGER-DECISION-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-TRAIN-MANAGER-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-TTY-FOREGROUND-STEAL-CHILD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-TURN-STATES-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-TURN-THROW-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-USER-CONFIG-DEFAULT-SPARSE-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-USER-CONFIG-TUI-DIET-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-WARM-POOL-REUSE-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-WARM-POOL-REUSE-SWITCH-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-WARM-SI-REUSE-SIM-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-WORLD-CHAOS-RUNTIME-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-WORLD-HOST-CHAOS-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-WORLD-REGRESSION-SUITE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-WORLD-SCHEMA-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-WORLD-SNAPSHOT-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-WORLD-STORE-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-WORLD-TS.json +4 -1
- package/catalog/sim-world-device-catalog-fragments/devices/MD-UX-SIM-WORLD-WATCH-TS.json +4 -1
- package/catalog/ux-sim/mock-scenario-catalog-fragments/candidates/00670--src-ux-sim-kaist-app-qr-sim-ts-a1e7116f.json +11 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/candidates/00680--src-ux-sim-kaist-app-qr-sim-test-ts-2b726ad2.json +11 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/catalog-additions/00670--src-ux-sim-kaist-app-qr-sim-ts-a1e7116f.json +4 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/catalog-additions/00680--src-ux-sim-kaist-app-qr-sim-test-ts-2b726ad2.json +4 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/devices/00060--fake-llm-4e9d0461.json +4 -2
- package/catalog/ux-sim/mock-scenario-catalog-fragments/devices/00240--world-runtime-d26d02c9.json +2 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/devices/00340--fault-injection-60e2a635.json +1 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/devices/01855--pwa-installed-package-staging.json +31 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/devices/01870--knowledge-pack-auto-select--598a19aa.json +31 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/devices/01880--kaist-app-qr-public-isolation-7dff33f1.json +36 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/devices/01880--kaist-classic-pwa-browser-replay-7ba58169.json +42 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/devices/01880--self-edge-byoc-world.json +27 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/devices/01890--gcp-architect-expand-fake-world-1dc2b194.json +27 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/devices/01890--kaist-pwa-mobile-approval-extension.json +32 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/devices/01891--kcb-integrated-pwa-lap.json +32 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/devices/01892--gcp-architect-tiered-design.json +25 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/devices/02000--delete-impact-sim.json +28 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/metadata.json +1 -1
- package/catalog/ux-sim/mock-scenario-catalog-fragments/omission-required-paths/00670--src-ux-sim-kaist-app-qr-sim-ts-a1e7116f.json +1 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/omission-required-paths/00680--src-ux-sim-kaist-app-qr-sim-test-ts-2b726ad2.json +1 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/reviews/fake-llm--bcb74f41.json +4 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/reviews/gcp-architect-tiered-design--972746e0.json +4 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/reviews/kaist-classic-pwa-browser-replay--978b5da1.json +4 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/reviews/kaist-classic-pwa-browser-replay--c8bdb3ba.json +4 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/reviews/kaist-pwa-mobile-approval-extension--2b700ea3.json +4 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/reviews/kcb-integrated-pwa-lap--b7be4c21.json +4 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/reviews/r-arch-delete-impact-sim--1ba1037a.json +4 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/reviews/tui-interaction--4336bdfe.json +4 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/scenarios/00400--kaist-app-qr-live-c4d9f8a9.json +24 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/source-modules/00360--md-ux-sim-fake-llm-ts-df79e477.json +1 -1
- package/catalog/ux-sim/mock-scenario-catalog-fragments/source-modules/01211--md-ux-sim-scenario-target-ts.json +10 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/source-modules/01880--md-ux-sim-kaist-app-qr-sim-ts-a39fa1af.json +10 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/source-modules/01880--md-ux-sim-kaist-classic-pwa-browser-replay-ts-e5635fd5.json +8 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/source-modules/01880--md-ux-sim-kaist-classic-pwa-replay-world-ts-8dba624f.json +8 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/source-modules/01890--md-ux-sim-gcp-architect-expand-fake-world-ts-50a192ca.json +10 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/source-modules/01892--md-ux-sim-gcp-architect-expand-tiered-design-ts.json +10 -0
- package/catalog/ux-sim/mock-scenario-catalog-fragments/source-modules/02000--md-ux-sim-delete-impact-sim-ts.json +8 -0
- package/docs/profiles/solar-only-demo.json +13 -0
- package/graphs/demo/integrated-ticketing.yaml +40 -0
- package/graphs/demo/recipes.yaml +8 -0
- package/graphs/drafts/recipes.yaml +1 -1
- package/graphs/ops/host-reservation-watch.yaml +18 -0
- package/graphs/ops/placement.yaml +45 -0
- package/graphs/ops/recipes.yaml +19 -0
- package/graphs/ops/silence-watch.yaml +24 -0
- package/graphs/release/node-command-bindings.json +27 -0
- package/graphs/release/plugin.json +123 -12
- package/graphs/release/recipes.yaml +11 -0
- package/graphs/release/release-loop-fanout.yaml +1 -0
- package/graphs/release/release-loop.yaml +25 -4
- package/graphs/release/rla/loop.yaml +2 -1
- package/graphs/work/web-app.yaml +21 -0
- package/package.json +16 -1
- package/packs/gcp-architect-expand/content/decision-table.md +6 -1
- package/packs/system-architecture-public/README.md +17 -0
- package/packs/system-architecture-public/content/cqrs-event-sourcing-01.json +6 -0
- package/packs/system-architecture-public/content/cqrs-event-sourcing-02.json +6 -0
- package/packs/system-architecture-public/content/cqrs-event-sourcing-03.json +6 -0
- package/packs/system-architecture-public/content/cqrs-event-sourcing-04.json +6 -0
- package/packs/system-architecture-public/content/data-pipeline-01.json +6 -0
- package/packs/system-architecture-public/content/data-pipeline-02.json +6 -0
- package/packs/system-architecture-public/content/data-pipeline-03.json +6 -0
- package/packs/system-architecture-public/content/data-pipeline-04.json +6 -0
- package/packs/system-architecture-public/content/event-queue-01.json +6 -0
- package/packs/system-architecture-public/content/event-queue-02.json +6 -0
- package/packs/system-architecture-public/content/event-queue-03.json +6 -0
- package/packs/system-architecture-public/content/event-queue-04.json +6 -0
- package/packs/system-architecture-public/content/file-media-01.json +6 -0
- package/packs/system-architecture-public/content/file-media-02.json +6 -0
- package/packs/system-architecture-public/content/file-media-03.json +6 -0
- package/packs/system-architecture-public/content/file-media-04.json +6 -0
- package/packs/system-architecture-public/content/microservices-mesh-01.json +6 -0
- package/packs/system-architecture-public/content/microservices-mesh-02.json +6 -0
- package/packs/system-architecture-public/content/microservices-mesh-03.json +6 -0
- package/packs/system-architecture-public/content/microservices-mesh-04.json +6 -0
- package/packs/system-architecture-public/content/ml-serving-01.json +6 -0
- package/packs/system-architecture-public/content/ml-serving-02.json +6 -0
- package/packs/system-architecture-public/content/ml-serving-03.json +6 -0
- package/packs/system-architecture-public/content/ml-serving-04.json +6 -0
- package/packs/system-architecture-public/content/multi-tenant-saas-01.json +6 -0
- package/packs/system-architecture-public/content/multi-tenant-saas-02.json +6 -0
- package/packs/system-architecture-public/content/multi-tenant-saas-03.json +6 -0
- package/packs/system-architecture-public/content/multi-tenant-saas-04.json +6 -0
- package/packs/system-architecture-public/content/realtime-chat-notify-01.json +6 -0
- package/packs/system-architecture-public/content/realtime-chat-notify-02.json +6 -0
- package/packs/system-architecture-public/content/realtime-chat-notify-03.json +6 -0
- package/packs/system-architecture-public/content/realtime-chat-notify-04.json +6 -0
- package/packs/system-architecture-public/content/search-01.json +6 -0
- package/packs/system-architecture-public/content/search-02.json +6 -0
- package/packs/system-architecture-public/content/search-03.json +6 -0
- package/packs/system-architecture-public/content/search-04.json +6 -0
- package/packs/system-architecture-public/content/serverless-01.json +6 -0
- package/packs/system-architecture-public/content/serverless-02.json +6 -0
- package/packs/system-architecture-public/content/serverless-03.json +6 -0
- package/packs/system-architecture-public/content/serverless-04.json +6 -0
- package/packs/system-architecture-public/content/shared-patterns-01.json +6 -0
- package/packs/system-architecture-public/content/shared-patterns-02.json +6 -0
- package/packs/system-architecture-public/content/shared-patterns-03.json +6 -0
- package/packs/system-architecture-public/content/shared-patterns-04.json +6 -0
- package/packs/system-architecture-public/content/shared-patterns-05.json +6 -0
- package/packs/system-architecture-public/content/shared-patterns-06.json +6 -0
- package/packs/system-architecture-public/content/shared-patterns-07.json +6 -0
- package/packs/system-architecture-public/content/three-tier-01.json +6 -0
- package/packs/system-architecture-public/content/three-tier-02.json +6 -0
- package/packs/system-architecture-public/content/three-tier-03.json +6 -0
- package/packs/system-architecture-public/content/three-tier-04.json +6 -0
- package/packs/system-architecture-public/knowledge-pack.json +219 -0
- package/packs/ticketing-architecture-public/README.md +23 -0
- package/packs/ticketing-architecture-public/content/01-scope.json +6 -0
- package/packs/ticketing-architecture-public/content/02-seat.json +6 -0
- package/packs/ticketing-architecture-public/content/03-unique.json +7 -0
- package/packs/ticketing-architecture-public/content/04-queue.json +6 -0
- package/packs/ticketing-architecture-public/content/05-redis.json +6 -0
- package/packs/ticketing-architecture-public/content/06-payment.json +6 -0
- package/packs/ticketing-architecture-public/content/07-idempotency.json +7 -0
- package/packs/ticketing-architecture-public/content/08-webhook.json +6 -0
- package/packs/ticketing-architecture-public/content/09-outbox.json +12 -0
- package/packs/ticketing-architecture-public/content/10-kafka.json +6 -0
- package/packs/ticketing-architecture-public/content/11-edge.json +6 -0
- package/packs/ticketing-architecture-public/content/12-hpa.json +6 -0
- package/packs/ticketing-architecture-public/content/13-probe.json +6 -0
- package/packs/ticketing-architecture-public/content/14-decisions.json +6 -0
- package/packs/ticketing-architecture-public/content/15-primer.json +6 -0
- package/packs/ticketing-architecture-public/content/16-slo.json +6 -0
- package/packs/ticketing-architecture-public/content/17-aws.json +6 -0
- package/packs/ticketing-architecture-public/content/18-azure.json +6 -0
- package/packs/ticketing-architecture-public/content/19-lease.json +6 -0
- package/packs/ticketing-architecture-public/content/20-twelve-factor.json +6 -0
- package/packs/ticketing-architecture-public/knowledge-pack.json +95 -0
- package/plugins/README.md +7 -0
- package/plugins/absorb/graph/absorb-build.yaml +83 -5
- package/plugins/absorb/handlers/board-approval.ts +4 -2
- package/plugins/absorb/plugin.json +11 -0
- package/plugins/absorb/plugin.yaml +6 -2
- package/plugins/absorb/sims/absorb-demo-world.yaml +3 -1
- package/plugins/absorb/skills/absorb/build/SKILL.md +5 -1
- package/plugins/architecture-deliverables/README.md +47 -0
- package/plugins/architecture-deliverables/examples/input-sample.json +5 -0
- package/plugins/architecture-deliverables/examples/legacy-finished-input.json +5 -0
- package/plugins/architecture-deliverables/examples/structured-general.json +204 -0
- package/plugins/architecture-deliverables/examples/structured-ticketing-gcp.json +210 -0
- package/plugins/architecture-deliverables/graphs/architecture-deliverables.yaml +19 -0
- package/plugins/architecture-deliverables/graphs/recipes.yaml +12 -0
- package/plugins/architecture-deliverables/plugin.json +108 -0
- package/plugins/architecture-deliverables/references/official-gcp-icon-data.json +1 -0
- package/plugins/architecture-deliverables/references/official-gcp-icons.json +193 -0
- package/plugins/architecture-deliverables/references/structured-design.schema.json +375 -0
- package/plugins/architecture-deliverables/references/structured-template.css +1 -0
- package/plugins/demo-brief-to-requirements/README.md +20 -0
- package/plugins/demo-brief-to-requirements/examples/absorb-ticketing-records.json +20 -0
- package/plugins/demo-brief-to-requirements/examples/ticketing-brief.json +20 -0
- package/plugins/demo-brief-to-requirements/graphs/brief-to-requirements.yaml +10 -0
- package/plugins/demo-brief-to-requirements/graphs/recipes.yaml +3 -0
- package/plugins/demo-brief-to-requirements/graphs/scene4-architecture.yaml +15 -0
- package/plugins/demo-brief-to-requirements/plugin.json +31 -0
- package/plugins/demo-brief-to-requirements/references/input-contract.md +5 -0
- package/plugins/gcp-architect-expand/README.md +23 -3
- package/plugins/gcp-architect-expand/demo/BOARD-HANDOFF.md +17 -0
- package/plugins/gcp-architect-expand/demo/KCB-SCENE5-RECORDING-SCRIPT.md +30 -0
- package/plugins/gcp-architect-expand/demo/SOLAR-HANDOFF.md +93 -0
- package/plugins/gcp-architect-expand/demo/brief-3-lines.ko.txt +3 -0
- package/plugins/gcp-architect-expand/demo/classic-pty-live-ab56-receipt.json +52 -0
- package/plugins/gcp-architect-expand/demo/classic-pty-seam-receipt.json +21 -0
- package/plugins/gcp-architect-expand/demo/classic-pty-toolsearch-stack-receipt.json +24 -0
- package/plugins/gcp-architect-expand/demo/fixtures/advanced-requirement.json +19 -0
- package/plugins/gcp-architect-expand/demo/fixtures/pressure.json +8 -0
- package/plugins/gcp-architect-expand/demo/fixtures/ticketing-design.json +21 -0
- package/plugins/gcp-architect-expand/demo/graph-direct-test-world-receipt.json +114 -0
- package/plugins/gcp-architect-expand/demo/scene4-json-bridge-test-receipt.json +119 -0
- package/plugins/gcp-architect-expand/demo/security-defaults.json +6 -0
- package/plugins/gcp-architect-expand/demo/solar-original-retest-receipt.json +182 -0
- package/plugins/gcp-architect-expand/demo/structured-assumption-regression-receipt.json +182 -0
- package/plugins/gcp-architect-expand/graph.yaml +52 -20
- package/plugins/gcp-architect-expand/output-contract.json +31 -0
- package/plugins/gcp-architect-expand/plugin.json +77 -2
- package/plugins/gcp-architect-expand/recipes.yaml +12 -6
- package/plugins/gcp-architect-expand/sim/assets/README.md +12 -0
- package/plugins/gcp-architect-expand/sim/assets/cloud-storage.png +0 -0
- package/plugins/gcp-architect-expand/sim/assets/compute-engine.png +0 -0
- package/plugins/gcp-architect-expand/sim/assets/observability.png +0 -0
- package/plugins/gcp-architect-expand/sim/assets/security-identity.png +0 -0
- package/plugins/gcp-architect-expand/sim/sample-output/architecture-design.html +46 -0
- package/plugins/gcp-architect-expand/sim/sample-output/architecture-design.pdf +0 -0
- package/plugins/gcp-architect-expand/sim/sample-output/architecture.excalidraw +2638 -0
- package/plugins/gcp-architect-expand/sim/sample-output/architecture.png +0 -0
- package/plugins/gcp-architect-expand/sim/sample-output/board-attachments.json +45 -0
- package/plugins/gcp-architect-expand/sim/sample-output/demo-result.json +22 -0
- package/plugins/gcp-architect-expand/sim/sample-output/fake-world.json +46 -0
- package/plugins/gcp-architect-expand/sim/sample-output/icon-provenance.json +14 -0
- package/plugins/gcp-architect-expand/sim/sample-output/proposal.json +97 -0
- package/plugins/gcp-architect-expand/tiered-graph.yaml +39 -0
- package/plugins/graph-instance-view/evidence/pty-resource-screen.txt +31 -0
- package/plugins/graph-instance-view/handlers/http-get.ts +22 -0
- package/plugins/graph-instance-view/handlers/project-ledgers.ts +216 -0
- package/plugins/graph-instance-view/handlers/render-terminal.ts +109 -0
- package/plugins/graph-instance-view/handlers/view-model.ts +49 -0
- package/plugins/graph-instance-view/plugin.yaml +16 -0
- package/plugins/graph-instance-view/skills/read/SKILL.md +6 -0
- package/plugins/invest-arg/recipes/notes-to-pack.yaml +10 -0
- package/plugins/kr-flow-composites/plugin.json +1 -0
- package/plugins/release-win-smoke/graphs/release-win-smoke.yaml +19 -0
- package/plugins/release-win-smoke/plugin.json +46 -0
- package/plugins/release-win-smoke/plugin.yaml +11 -0
- package/plugins/release-win-smoke/sims/release-win-smoke.yaml +9 -0
- package/plugins/release-win-smoke/skills/install/SKILL.md +3 -0
- package/scenarios/dashboard-default.yaml +53 -0
- package/scenarios/heap-graph.yaml +46 -0
- package/scenarios/iul-timeline-viewer.yaml +46 -0
- package/scenarios/ux-sim/app-demo-1114.yaml +22 -0
- package/scenarios/ux-sim/arg-macro-canvas.yaml +78 -0
- package/scenarios/ux-sim/author-reviewer-precheck-applied.yaml +27 -0
- package/scenarios/ux-sim/author-reviewer-precheck-rejected-unprovable.yaml +27 -0
- package/scenarios/ux-sim/burst-ready-ladder.yaml +47 -0
- package/scenarios/ux-sim/demo1104-research-arg-graph.yaml +32 -0
- package/scenarios/ux-sim/draft-inventory-200.yaml +44 -0
- package/scenarios/ux-sim/fixtures/phone-pwa-selfheal-broken.html +19 -0
- package/scenarios/ux-sim/fixtures/release-cut-0306-shards.json +7023 -0
- package/scenarios/ux-sim/gate-deps-root-bake.yaml +17 -0
- package/scenarios/ux-sim/gate-receipt-carry-any-run.yaml +31 -0
- package/scenarios/ux-sim/gate-roster-second-pool-world.yaml +9 -0
- package/scenarios/ux-sim/gate-roster-second-pool.yaml +26 -0
- package/scenarios/ux-sim/gate-shard-receipt-payload-corrupt.yaml +14 -0
- package/scenarios/ux-sim/google-drive-files-list-readonly.yaml +21 -0
- package/scenarios/ux-sim/graph-runtime-overlay-event-stream.yaml +27 -0
- package/scenarios/ux-sim/kaist-lecture-scrap-app.yaml +14 -0
- package/scenarios/ux-sim/kaist-selfheal-stage.yaml +14 -0
- package/scenarios/ux-sim/knowhow-pack-release-heal-1107.md +39 -0
- package/scenarios/ux-sim/macro-chain-e2e.yaml +14 -0
- package/scenarios/ux-sim/macrophage-attribution-integration-1107.yaml +86 -0
- package/scenarios/ux-sim/n30-old-graph-measured-waiver.yaml +15 -0
- package/scenarios/ux-sim/night-train-dead-pid-lock.yaml +19 -0
- package/scenarios/ux-sim/night-train-world.yaml +13 -0
- package/scenarios/ux-sim/novice-versioning-scenario.ts +150 -0
- package/scenarios/ux-sim/novice-versioning-world.yaml +6 -0
- package/scenarios/ux-sim/phone-pwa-selfheal-trace.json +30 -0
- package/scenarios/ux-sim/provider-4xx-no-provider.yaml +26 -0
- package/scenarios/ux-sim/pwa-formal-update-world.yaml +5 -0
- package/scenarios/ux-sim/pwa-formal-update.yaml +8 -0
- package/scenarios/ux-sim/rehearsal-hard-2h-mandatory.yaml +37 -0
- package/scenarios/ux-sim/release-cut-preflight-regressions.yaml +31 -0
- package/scenarios/ux-sim/release-day-0307-replay.yaml +138 -0
- package/scenarios/ux-sim/release-gate-fanout.yaml +48 -0
- package/scenarios/ux-sim/release-heal-macrophage-bus.yaml +37 -0
- package/scenarios/ux-sim/release-incident-events-execution.yaml +114 -0
- package/scenarios/ux-sim/release-incident-events.yaml +98 -0
- package/scenarios/ux-sim/release-introduced-repair.yaml +40 -0
- package/scenarios/ux-sim/release-receipt-inheritance.yaml +24 -0
- package/scenarios/ux-sim/release-sim-chain-remaining.yaml +46 -0
- package/scenarios/ux-sim/release-sim-rig.yaml +266 -0
- package/scenarios/ux-sim/rla-arg-adaptive-heal.yaml +45 -0
- package/scenarios/ux-sim/rla-incident-policy-host-lost.yaml +17 -0
- package/scenarios/ux-sim/rla-postland-recovery-hitl.yaml +17 -0
- package/scenarios/ux-sim/rla-rehearsal-cloud-resume-sim.yaml +36 -0
- package/scenarios/ux-sim/rla-rehearsal-incident-sim-b.yaml +29 -0
- package/scenarios/ux-sim/sim-hq-move-world.yaml +9 -0
- package/scenarios/ux-sim/sim-hq-move.yaml +14 -0
- package/scenarios/ux-sim/tui-selfimplement-retry-loop.yaml +29 -0
- package/scenarios/ux-sim/warm-pool-reuse-world.yaml +117 -0
- package/scripts/cycle-fired-judge.ts +8 -7
- package/scripts/gcp-architect-expand/demo/design-result.ts +96 -0
- package/scripts/gcp-architect-expand/demo/export-local-pressure.ts +15 -0
- package/scripts/gcp-architect-expand/demo/pressure-input.ts +37 -0
- package/scripts/gcp-architect-expand/demo/propose.ts +60 -0
- package/scripts/gcp-architect-expand/demo/render-scene5-fallback.py +234 -0
- package/scripts/gcp-architect-expand/demo/run-graph-test-world.ts +141 -0
- package/scripts/gcp-architect-expand/demo/run.py +97 -0
- package/scripts/gcp-architect-expand/demo/tui.py +153 -0
- package/scripts/gcp-architect-expand/sim/build-sample.py +336 -0
- package/scripts/gcp-architect-expand/sim/fake-world.ts +95 -0
- package/scripts/gcp-architect-expand/sim/run-tiered-design.ts +91 -0
- package/scripts/guardian-placement-shadow.ts +23 -0
- package/scripts/heal/run-role.ts +21 -20
- package/scripts/hq/cron-git-credential-audit.ts +200 -0
- package/scripts/hq/hq-runaway-watch.ts +117 -0
- package/scripts/lib/front-route-measurement.ts +1 -4
- package/scripts/llm-cost-ledger.ts +9 -10
- package/scripts/load/members-signup-burst.ts +5 -4
- package/scripts/measure-key-arrival.ts +2 -4
- package/scripts/measure-nl-routing-corpus.ts +1 -1
- package/scripts/next-tui-default-sim.ts +43 -0
- package/scripts/plugin-only-ratchet.ts +39 -14
- package/scripts/release-loop/adaptive-gate-heal-adapter.ts +8 -7
- package/scripts/release-loop/adaptive-gate-heal.ts +13 -7
- package/scripts/release-loop/cloud-elastic-node.ts +454 -0
- package/scripts/release-loop/cloud-lease-deadline.ts +14 -0
- package/scripts/release-loop/cut-branch.ts +6 -0
- package/scripts/release-loop/gate-closure.ts +12 -22
- package/scripts/release-loop/gate-contract-surfaces.json +2 -0
- package/scripts/release-loop/gate-cutover-switch-node.ts +12 -2
- package/scripts/release-loop/gate-file-receipts.ts +10 -2
- package/scripts/release-loop/gate-image-pin.ts +31 -3
- package/scripts/release-loop/gate-node-sim.ts +5 -3
- package/scripts/release-loop/gate-repair-node.ts +24 -0
- package/scripts/release-loop/gate-runtime.ts +62 -14
- package/scripts/release-loop/gate-shard-artifacts.ts +3 -1
- package/scripts/release-loop/gate-shard-dispatch.ts +6 -2
- package/scripts/release-loop/gate-triage-node.ts +1 -0
- package/scripts/release-loop/resume.ts +6 -0
- package/scripts/release-loop/runner-release-node-commands.ts +60 -0
- package/scripts/release-loop/unattended-release.ts +10 -34
- package/scripts/release-loop/version-node.ts +26 -99
- package/scripts/solar-optimize-measure.ts +131 -0
- package/scripts/ux/kcb-phone-rehearsal.ts +90 -0
- package/scripts/ux-sim/openrouter-bare-first-run-no-network.ts +12 -0
- package/scripts/ux-sim/openrouter-bare-first-run-pty.exp +35 -0
- package/scripts/ux-sim/openrouter-first-run-pty.ts +32 -0
- package/skills/diagram-master/references/engines/excalidraw/render_template.html +1 -1
- package/skills/diagram-master/references/uv.lock +11 -8
- package/skills/lecture-note-digitizer/references/convert_to_pdf.py +1 -0
- package/src/agent/autonomous-tools.ts +5 -30
- package/src/agent/self-ambient.ts +2 -2
- package/src/agent-mission/cli-consumer.ts +165 -0
- package/src/agent-substrate/review-cap-policy.ts +78 -0
- package/src/agent-substrate/review-round-design-trigger.ts +89 -0
- package/src/agent-substrate/self-review-cli.ts +158 -43
- package/src/auth/setup-link-tokens.ts +12 -1
- package/src/auto-research/auto-mode/context-keys-bridge.ts +2 -2
- package/src/boot/daemon-prompt-turn.ts +2 -0
- package/src/boot/daemon-tools/index.ts +2 -12
- package/src/boot/daemon-tools/tool-catalog-observability.ts +21 -0
- package/src/cft/andon-context-bridge.ts +2 -2
- package/src/chat/internal-turn-contract.ts +20 -0
- package/src/chat/solar-scene5-context.ts +1 -4
- package/src/cli/agent-cli.ts +3 -1
- package/src/cli/app-cli.ts +24 -2
- package/src/cli/first-run/onboarding-pty-fixture.ts +34 -0
- package/src/cli/first-run/openrouter-key-supply.ts +139 -0
- package/src/cli/first-run/openrouter-picker.ts +19 -0
- package/src/cli/msg-cli.ts +42 -4
- package/src/cli/pr-cli.ts +199 -11
- package/src/cli/release-cli.ts +39 -18
- package/src/cli/release-manual-seat-claim.ts +108 -0
- package/src/cli/resource-ledger-cli.ts +11 -4
- package/src/cli/root-tui-entry.ts +4 -4
- package/src/cli/seat-cli.ts +2 -2
- package/src/cli/self-update.ts +25 -5
- package/src/cli/setup-cli.ts +3 -1
- package/src/cli/setup-keys.ts +68 -5
- package/src/cli/sim-cli.ts +21 -8
- package/src/cli/task-plugin-wizard-host.ts +2 -2
- package/src/context-bus/context-now.ts +28 -15
- package/src/context-bus/long-term-memory.ts +4 -1
- package/src/context-bus/release-tui-status.ts +9 -0
- package/src/conv-substrate/surface-detail.ts +19 -0
- package/src/core-turn/provider-stop-reason.ts +6 -0
- package/src/core-turn/run-core-turn.ts +7 -1
- package/src/core-turn/types.ts +2 -0
- package/src/dashboard/boot-timing.ts +1 -35
- package/src/dashboard/classic-sidetab-mission-job.ts +3 -308
- package/src/dashboard/classic-sidetab-mission-reconcile.ts +3 -212
- package/src/dashboard/classic-sidetab-mission.ts +3 -20
- package/src/dashboard/event-loop-stall-monitor.ts +1 -58
- package/src/dashboard/index.ts +56 -86
- package/src/dashboard/input/chat-main-plain-turn-runtime.ts +15 -0
- package/src/dashboard/input/chat-main-submit-route.ts +0 -17
- package/src/dashboard/input/goal-continue.ts +18 -220
- package/src/dashboard/input/internal-turn.ts +19 -255
- package/src/dashboard/input/turn-typeahead-prompt.ts +7 -31
- package/src/dashboard/mission-cli-consumer.ts +2 -165
- package/src/dashboard/seat-boot-preamble.ts +15 -428
- package/src/dashboard/setup-inline.ts +14 -147
- package/src/dashboard/sidetab-runtime.ts +2 -1
- package/src/dashboard/skill-catalog-preamble.ts +6 -101
- package/src/dashboard/slash-runtime/dashboard-handlers.ts +2 -3
- package/src/dashboard/slash-runtime/registry.ts +1 -160
- package/src/dashboard/term-slash-runtime.ts +1 -277
- package/src/dashboard/terminal/session.ts +7 -35
- package/src/dashboard/tui-400-runtime-adapter.ts +11 -0
- package/src/dashboard/turn-start-segments.ts +16 -222
- package/src/debug/log.ts +20 -4
- package/src/display/dashboard-frame.ts +74 -0
- package/src/display/essential-frame-cursor.ts +26 -0
- package/src/display/events.ts +2 -4
- package/src/esc-abort-gate.ts +1 -13
- package/src/esc-shell-timing.ts +14 -0
- package/src/event-loop-stall-monitor.ts +58 -0
- package/src/exec-requests/planner.ts +10 -6
- package/src/graph-runner/architecture-deliverables.ts +43 -0
- package/src/graph-runner/architecture-output/pdf-body.ts +14 -0
- package/src/graph-runner/architecture-output/run-step.ts +321 -0
- package/src/graph-runner/architecture-output/structured-design.ts +201 -0
- package/src/graph-runner/arg-feedback-consumer.ts +58 -0
- package/src/graph-runner/arg-feedback-lifecycle.ts +312 -0
- package/src/graph-runner/arg-open-proposal.ts +1 -4
- package/src/graph-runner/arg-supervisor.ts +225 -78
- package/src/graph-runner/briefing-requirements/convert.ts +79 -0
- package/src/graph-runner/briefing-requirements/run-step.ts +20 -0
- package/src/graph-runner/capabilities.ts +91 -2
- package/src/graph-runner/capability-providers/architecture-deliverables.ts +51 -0
- package/src/graph-runner/graph-cli.ts +76 -1
- package/src/graph-runner/graph-events.ts +66 -2
- package/src/graph-runner/graph-run-event-ledger.ts +102 -0
- package/src/graph-runner/graph-run-msg-subscriptions.ts +84 -0
- package/src/graph-runner/graph-subscriptions.ts +2 -2
- package/src/graph-runner/in-process-registry.ts +2 -0
- package/src/graph-runner/runner-types.ts +12 -0
- package/src/graph-runner/runner.ts +343 -105
- package/src/graph-runner/scene4-turn-policy.ts +68 -0
- package/src/graph-runner/ticketing-scene4.ts +150 -0
- package/src/graph-v2/input-bindings.ts +81 -0
- package/src/graph-v2/lower.ts +2 -1
- package/src/guardian/placement-shadow.ts +332 -0
- package/src/harness/harness-cli-command.ts +2 -2
- package/src/hq/promote.ts +1 -0
- package/src/index.ts +37 -15
- package/src/input-core/mode-context-bridge.ts +2 -2
- package/src/instance/spawn-elanous.ts +10 -0
- package/src/intelligence-map/budget-context-bridge.ts +2 -2
- package/src/intelligence-map/model-catalog.ts +36 -0
- package/src/intelligence-map/types.ts +1 -0
- package/src/knowledge/notes-to-pack.ts +117 -0
- package/src/knowledge/query.ts +88 -1
- package/src/knowledge/tools/knowledge-query.ts +77 -10
- package/src/llm.ts +99 -20
- package/src/loops/graph-trigger-dispatch.ts +77 -3
- package/src/loops/host-reservation-watch.ts +196 -0
- package/src/loops/loop-scheduler.ts +72 -0
- package/src/loops/loops-table.ts +77 -0
- package/src/loops/msg-address.ts +5 -1
- package/src/loops/msg-wake.ts +8 -2
- package/src/loops/observe.ts +15 -2
- package/src/loops/orchestrator/ready-queue.ts +113 -0
- package/src/loops/orchestrator/tick.ts +31 -4
- package/src/maturity/feature-maturity.ts +2 -2
- package/src/mcp/server.ts +15 -3
- package/src/memory.ts +17 -15
- package/src/model-tier/llm-tier-map.ts +12 -0
- package/src/msg/msg-store.ts +40 -18
- package/src/msg/outbound-guard-world.ts +14 -0
- package/src/mss/logging/record.ts +3 -0
- package/src/native-tool-catalog.ts +15 -32
- package/src/nexus/api/board-api.ts +2 -1
- package/src/nexus/api/graph-run-events.ts +68 -0
- package/src/nexus/api/http-server.ts +34 -2
- package/src/nexus/api/meta-api.ts +2 -0
- package/src/nexus/api/public-routes.ts +8 -0
- package/src/nexus/api/resource-ledger.ts +29 -3
- package/src/nexus/api/setup-child-llm.ts +1 -1
- package/src/nexus/api/setup-credentials.ts +2 -4
- package/src/nexus/api/setup-llm-provider.ts +1 -1
- package/src/nexus/apps/app-api-contract-check.ts +45 -0
- package/src/nexus/apps/app-storage.ts +39 -0
- package/src/nexus/config/secrets/cred-owner.ts +15 -7
- package/src/nexus/index.ts +0 -50
- package/src/nexus/members/kcb-try-deadline.ts +20 -0
- package/src/nexus/members/kcb-try.ts +55 -0
- package/src/nexus/members/member-store.ts +151 -7
- package/src/nexus/members/members-api.ts +69 -5
- package/src/oauth/codex-owner-mirror.ts +49 -16
- package/src/oauth/codex.ts +15 -22
- package/src/onboarding/first-run.ts +64 -7
- package/src/onboarding/non-interactive.ts +1 -0
- package/src/onboarding/openrouter-model-picker.ts +78 -0
- package/src/onboarding.ts +66 -23
- package/src/plan-mode/context-bridge.ts +2 -2
- package/src/plugins/core/declared-handler.ts +38 -0
- package/src/plugins/core/feature-entitlements.ts +24 -0
- package/src/plugins/core/host.ts +51 -3
- package/src/plugins/core/manifest.ts +38 -2
- package/src/plugins/core/plugin-yaml.ts +2 -1
- package/src/plugins/install/plugin-install.ts +340 -13
- package/src/prompt-library/providers/solar.ts +17 -0
- package/src/prompt-library/registry.ts +3 -1
- package/src/provenance/provenance.ts +111 -0
- package/src/pwa/touch-input-mapper.ts +1 -1
- package/src/release-loop/checklist.ts +42 -3
- package/src/release-loop/cloud-elastic.ts +179 -0
- package/src/release-loop/gate-shards.ts +11 -2
- package/src/release-loop/macrophage-safe-cleanup.ts +12 -2
- package/src/release-loop/outbound-guard-world.ts +16 -0
- package/src/release-loop/rehearsal.ts +4 -2
- package/src/release-loop/release-schedule.ts +28 -0
- package/src/repl/index.ts +39 -10
- package/src/resource-ledger/host-readiness.ts +82 -5
- package/src/resource-ledger/resource-ledger.ts +143 -3
- package/src/seat/seat-boot-preamble.ts +428 -0
- package/src/seat-loop/seat-loop.ts +9 -4
- package/src/selector.ts +1 -1
- package/src/self-dev/entrance-registry.ts +1 -2
- package/src/self-dev/shard-run.ts +4 -3
- package/src/self-implement/gate-remote.ts +7 -6
- package/src/self-implement/goal-author.ts +4 -6
- package/src/self-implement/graph-yaml.ts +23 -2
- package/src/session/chat.ts +13 -21
- package/src/session/index.ts +6 -0
- package/src/session-runtime/tier-flip.ts +7 -0
- package/src/setup/provider-options.ts +150 -0
- package/src/shell-runner/terminal-host-facade.ts +1 -1
- package/src/sidetab-core/classic-sidetab-mission-job.ts +308 -0
- package/src/sidetab-core/classic-sidetab-mission-reconcile.ts +212 -0
- package/src/sidetab-core/classic-sidetab-mission-result.ts +20 -0
- package/src/sidetab-core/mission-cli-consumer.ts +2 -0
- package/src/sidetab-core/model.ts +3 -0
- package/src/sidetab-core/workspace-input.ts +135 -0
- package/src/sim-world-device-catalog-history.json +601 -0
- package/src/skills/runner.ts +4 -5
- package/src/skills/skill-catalog-preamble.ts +101 -0
- package/src/skills/tools/acp-session.ts +3 -3
- package/src/skills/tools/agent.ts +34 -12
- package/src/skills/tools/dashboard-state.ts +1 -1
- package/src/skills/tools/dev-harness.ts +1 -1
- package/src/skills/tools/msg-inbox.ts +43 -0
- package/src/skills/tools/schedule-wakeup.ts +8 -2
- package/src/skills/tools/terminal-modal-inject.ts +1 -1
- package/src/skills/tools/terminal-modal.ts +1 -1
- package/src/skills/url-router.ts +19 -2
- package/src/slash/registry.ts +160 -0
- package/src/steward/triage.ts +5 -1
- package/src/supervision/incident-claim.ts +253 -0
- package/src/supervision/silence-watch.ts +221 -0
- package/src/surface/terminal-surface-intent.ts +125 -0
- package/src/telegram-commands.ts +0 -58
- package/src/telegram.ts +0 -39
- package/src/term-slash-runtime.ts +277 -0
- package/src/terminal/coding-agent.ts +1 -0
- package/src/terminal/session-access.ts +31 -0
- package/src/terminal/session-registry.ts +1 -1
- package/src/terminal/tty-required.ts +16 -0
- package/src/tool-hints/gate.ts +1 -0
- package/src/tool-hints/signals.ts +7 -0
- package/src/tool-hints/types.ts +1 -1
- package/src/tool-runtime/dashboard-state-runtime.ts +1 -1
- package/src/tool-runtime/dashboard-state-snapshot.ts +196 -0
- package/src/tool-runtime/index.ts +0 -2
- package/src/tool-runtime/ops-ledger-runtimes.ts +35 -3
- package/src/tool-runtime/types.ts +2 -0
- package/src/tui/boot-timing.ts +35 -0
- package/src/tui/branches/now.ts +50 -9
- package/src/tui/branches/remaining.ts +49 -0
- package/src/tui/branches/sidetab/route.ts +23 -2
- package/src/tui/chat/error-card.ts +10 -0
- package/src/tui/chat/log-view.ts +11 -1
- package/src/tui/chat/status-line.ts +133 -0
- package/src/tui/chat/status-model.ts +16 -0
- package/src/tui/core/agents.ts +33 -5
- package/src/tui/core/entry-render.ts +46 -0
- package/src/tui/core/registry.ts +13 -2
- package/src/tui/core/render.ts +2 -1
- package/src/tui/entry.ts +182 -68
- package/src/tui/input/goal-continue.ts +220 -0
- package/src/tui/input/internal-turn.ts +230 -0
- package/src/tui/input-lag-probe.ts +1 -1
- package/src/tui/persistent-user-memory.ts +11 -4
- package/src/tui/sidetab/attach.ts +28 -5
- package/src/tui/turn-start-segments.ts +222 -0
- package/src/tui-client/fast-repl-child.ts +36 -0
- package/src/tui-client/local-chat-turn.ts +14 -2
- package/src/tui-client/next-dashboard-runtime.ts +3 -3
- package/src/tui-client/next-loop-command.ts +2 -2
- package/src/tui-client/next-wakeup.ts +1 -1
- package/src/tui-client/sidetab-agent-pty.ts +50 -0
- package/src/user-config/read.ts +3 -1
- package/src/user-config/sparse-config.ts +2 -4
- package/src/user-config/write.ts +2 -0
- package/src/user-config.ts +28 -25
- package/src/ux-sim/absorb-v2-runGraph-sim.ts +131 -38
- package/src/ux-sim/architecture-deliverables/run-step.ts +156 -0
- package/src/ux-sim/classic-tui-seat-scenarios.ts +3 -3
- package/src/ux-sim/dashboard-event-loop-stall-monitor-device.ts +1 -1
- package/src/ux-sim/delete-impact-sim.ts +205 -0
- package/src/ux-sim/fake-bin.ts +26 -6
- package/src/ux-sim/fake-cloud-vm.ts +72 -0
- package/src/ux-sim/fake-llm.ts +69 -5
- package/src/ux-sim/fake-member-oidc-world.ts +2 -0
- package/src/ux-sim/fault-pod-codex-503.ts +16 -3
- package/src/ux-sim/fault-tui-400-autoheal.ts +24 -15
- package/src/ux-sim/fixtures/kaist-classic-pty-receipt.json +260 -0
- package/src/ux-sim/fixtures/kcb-ticket-classic-pty-receipt.json +270 -0
- package/src/ux-sim/fixtures/kcb-ticket-requirements-mapping.json +60 -0
- package/src/ux-sim/gcp-architect-expand/architecture-input.ts +45 -0
- package/src/ux-sim/gcp-architect-expand/consumer.ts +18 -0
- package/src/ux-sim/gcp-architect-expand/detect-step.ts +16 -0
- package/src/ux-sim/gcp-architect-expand/local-signals.ts +41 -0
- package/src/ux-sim/gcp-architect-expand/output-contract.ts +100 -0
- package/src/ux-sim/gcp-architect-expand/scene5-fake-provider.ts +191 -0
- package/src/ux-sim/gcp-architect-expand/shared-deliverables.ts +39 -0
- package/src/ux-sim/gcp-architect-expand/tiered-design.ts +211 -0
- package/src/ux-sim/gcp-architect-expand/unimplemented.ts +6 -0
- package/src/ux-sim/gcp-architect-expand/verify-step.ts +8 -0
- package/src/ux-sim/goal-interim-trace.ts +2 -2
- package/src/ux-sim/graph-event-entry-world.ts +28 -20
- package/src/ux-sim/graph-trigger-hook-device.ts +1 -1
- package/src/ux-sim/headless-tui.ts +1 -1
- package/src/ux-sim/kaist-app-qr-sim.ts +53 -0
- package/src/ux-sim/kaist-classic-pwa-browser-replay.ts +568 -0
- package/src/ux-sim/kaist-classic-pwa-replay-world.ts +244 -0
- package/src/ux-sim/kcb-phone-rehearsal.ts +38 -0
- package/src/ux-sim/knowledge-pack-auto-select.ts +144 -0
- package/src/ux-sim/next-tui-seat-scenarios.ts +167 -99
- package/src/ux-sim/onboarding-first-run-device.ts +1 -1
- package/src/ux-sim/outbound-guard-sim.ts +43 -10
- package/src/ux-sim/pty-key-modifiers-device.ts +6 -4
- package/src/ux-sim/release-day-0307-replay.ts +140 -43
- package/src/ux-sim/rla-context-release-status-arrival-event.ts +2 -5
- package/src/ux-sim/scenario-target.ts +143 -0
- package/src/ux-sim/self-edge-byoc-sim.ts +216 -0
- package/src/ux-sim/ta-land-count-dispatcher-sim.ts +5 -5
- package/src/ux-sim/term-slash-device.ts +2 -2
- package/src/ux-sim/tui-400-runtime-contract.ts +8 -0
- package/src/ux-sim/world-regression-suite.ts +2 -0
- package/src/version/packed-revision.json +1 -1
- package/src/voice/intent-router/voice-to-surface-intent.ts +1 -1
- package/src/workflow-runtime/daemon.ts +4 -0
- package/src/workflow-runtime/nodes/bash.ts +6 -1
- package/test/helpers/dashboard-source.ts +110 -0
|
@@ -0,0 +1,2637 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified daemon client — REST + WS multiplex.
|
|
3
|
+
*
|
|
4
|
+
* REST : POST /v1/prompt/stream (SSE fallback) · GET /v1/health
|
|
5
|
+
* WS : /v1/acp (ACP multiplex) · /v1/voice/ws (voice frame protocol)
|
|
6
|
+
*
|
|
7
|
+
* The WS surfaces are wrapped behind connectAcp() / connectVoice() so callers
|
|
8
|
+
* never touch raw WebSocket lifecycle. Reconnect / backoff is the connection's
|
|
9
|
+
* job, not the consumer's.
|
|
10
|
+
*
|
|
11
|
+
* Chat turns prefer ACP session/prompt; REST streaming is the fallback.
|
|
12
|
+
* Voice connection is a thin wrapper around the existing voice-websocket.ts
|
|
13
|
+
* frame protocol so the / page keeps working unchanged.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { reportAuthRequired } from './auth-required';
|
|
17
|
+
import { buildAcpWsUrl, buildVoiceWsUrl, type DaemonConfig } from './daemon-config';
|
|
18
|
+
import { debugLog } from './debug';
|
|
19
|
+
import type { AttachmentMeta } from './upload-attachment';
|
|
20
|
+
import {
|
|
21
|
+
isFeedbackEnvelopeWire,
|
|
22
|
+
type FeedbackEnvelopeWire,
|
|
23
|
+
} from './feedback-envelope';
|
|
24
|
+
|
|
25
|
+
/** P-3 §6.9 (2026-05-07) — multi-part user content. Mirrors the
|
|
26
|
+
* daemon's `DaemonPromptBody.userContent` (see
|
|
27
|
+
* `src/boot/daemon-prompt-request.ts`). When present and non-empty, the
|
|
28
|
+
* daemon routes through `appendUserPromptBlocksAndBuildMessages` so
|
|
29
|
+
* image / resource blocks reach the LLM intact. PWA composer uses this
|
|
30
|
+
* to wire `pendingAttachments[]` into the active turn instead of the
|
|
31
|
+
* legacy "[attached] <path>" text injection.
|
|
32
|
+
*
|
|
33
|
+
* Shape mirrors @agentclientprotocol/sdk's `ContentBlock` union — we
|
|
34
|
+
* type it loosely here so the PWA wire layer doesn't need to import
|
|
35
|
+
* the SDK on the client. The daemon validates that each block has a
|
|
36
|
+
* `type` string before dispatching. */
|
|
37
|
+
export type PromptUserContentBlock = { type: string; [key: string]: unknown };
|
|
38
|
+
|
|
39
|
+
/** §3.6 (2026-05-10) — multi-host LLM resolver shape (FU.A1 / FU.A3).
|
|
40
|
+
* Mirrors `LlmHostConfig` in `src/nexus/api/llm-hosts.ts` so the PWA
|
|
41
|
+
* Settings card can render + edit the same JSON the daemon stores in
|
|
42
|
+
* its in-memory override slot. `apiKey` is plaintext on the wire (PUT)
|
|
43
|
+
* and `[redacted]` on the wire (GET) — the redacted marker is a
|
|
44
|
+
* daemon-side guard against accidental exposure in the browser
|
|
45
|
+
* DevTools / shared screenshots. */
|
|
46
|
+
// RFC #2161 Phase 4 (2026-05-11) — `'anthropic'` kind renamed to
|
|
47
|
+
// `'anthropic-openai-wrap'`. The daemon still accepts the legacy alias
|
|
48
|
+
// for one release; this client type now reflects only the canonical id.
|
|
49
|
+
export type LlmHostKind = 'lm-studio' | 'vllm' | 'ollama' | 'anthropic-openai-wrap';
|
|
50
|
+
|
|
51
|
+
export interface LlmHostConfig {
|
|
52
|
+
name: string;
|
|
53
|
+
kind: LlmHostKind;
|
|
54
|
+
endpoint: string;
|
|
55
|
+
apiKey?: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface LlmHostsResponse {
|
|
59
|
+
ok: boolean;
|
|
60
|
+
source: 'override' | 'env' | 'legacy';
|
|
61
|
+
count: number;
|
|
62
|
+
hosts: LlmHostConfig[];
|
|
63
|
+
/** RFC #2161 Phase 4 — server-side deprecation warnings (e.g. legacy
|
|
64
|
+
* `'anthropic'` kind alias). Card surfaces these as a yellow banner
|
|
65
|
+
* so the user knows to migrate before the alias is removed in the
|
|
66
|
+
* next release. */
|
|
67
|
+
deprecations?: string[];
|
|
68
|
+
parseError?: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface ConsultRequest {
|
|
72
|
+
name: string;
|
|
73
|
+
org?: string;
|
|
74
|
+
kind: 'company' | 'personal';
|
|
75
|
+
interest: 'A' | 'B';
|
|
76
|
+
contact: string;
|
|
77
|
+
consent: true;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export type ConsultRequestResult =
|
|
81
|
+
| { receiptId: string; receivedAt: string }
|
|
82
|
+
| { error: 'bad_request'; field: string };
|
|
83
|
+
|
|
84
|
+
export interface SeatSummary { id: string; title: string }
|
|
85
|
+
export interface SeatRequestItem {
|
|
86
|
+
receiptId: string;
|
|
87
|
+
seat: string;
|
|
88
|
+
text: string;
|
|
89
|
+
queuedAt: string;
|
|
90
|
+
status: 'queued';
|
|
91
|
+
}
|
|
92
|
+
export interface SeatRequestsResponse {
|
|
93
|
+
items: SeatRequestItem[];
|
|
94
|
+
seats: SeatSummary[];
|
|
95
|
+
}
|
|
96
|
+
export interface SeatRequestReceipt { receiptId: string; seat: string; queuedAt: string; attachments?: number; channel?: string }
|
|
97
|
+
|
|
98
|
+
export type ExecRequestStatus = 'planning' | 'running' | 'done' | 'failed';
|
|
99
|
+
export type ExecSeatStatus = 'waiting' | 'running' | 'done' | 'failed';
|
|
100
|
+
export interface ExecRequestSeat {
|
|
101
|
+
seat: string;
|
|
102
|
+
title: string;
|
|
103
|
+
status: ExecSeatStatus;
|
|
104
|
+
graphId?: string;
|
|
105
|
+
runId?: string;
|
|
106
|
+
reason?: string;
|
|
107
|
+
}
|
|
108
|
+
export interface ExecRequestItem {
|
|
109
|
+
id: string;
|
|
110
|
+
text: string;
|
|
111
|
+
createdAt: string;
|
|
112
|
+
status: ExecRequestStatus;
|
|
113
|
+
seats: ExecRequestSeat[];
|
|
114
|
+
resultCount: number;
|
|
115
|
+
}
|
|
116
|
+
export interface ExecRequestDetail extends Omit<ExecRequestItem, 'resultCount'> {
|
|
117
|
+
summary: string;
|
|
118
|
+
results: Array<{
|
|
119
|
+
seat: string;
|
|
120
|
+
kind: 'report' | 'pdf' | 'video' | 'image' | 'text' | 'link';
|
|
121
|
+
title: string;
|
|
122
|
+
url: string;
|
|
123
|
+
sources?: Array<{ title: string; url: string }>;
|
|
124
|
+
}>;
|
|
125
|
+
approvals: Array<{ graphId: string; runId: string; message: string }>;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export type SeatRequestErrorCode = 'unknown-seat' | 'unknown-attachment' | 'attachments-unsupported' | (string & {});
|
|
129
|
+
|
|
130
|
+
export class SeatRequestError extends Error {
|
|
131
|
+
constructor(public readonly status: number, public readonly code: SeatRequestErrorCode, public readonly seats: SeatSummary[] = []) {
|
|
132
|
+
super(code);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export interface PromptRequest {
|
|
137
|
+
sessionId?: string;
|
|
138
|
+
userText: string;
|
|
139
|
+
/** P-3 §6.9 (2026-05-07) — see {@link PromptUserContentBlock}. */
|
|
140
|
+
userContent?: PromptUserContentBlock[];
|
|
141
|
+
provider?: string;
|
|
142
|
+
personaId?: string;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export interface PromptResponse {
|
|
146
|
+
sessionId: string;
|
|
147
|
+
text: string;
|
|
148
|
+
stopReason: string;
|
|
149
|
+
/** 실제 답한 LLM(백엔드 활성 provider+model) — PWA 메시지 태깅용. */
|
|
150
|
+
provider?: string;
|
|
151
|
+
model?: string;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** One row returned by GET /v1/terminals. A PTY registry row may contain
|
|
155
|
+
* only its id; `hasPty: false` identifies an agent execution which shares
|
|
156
|
+
* the endpoint but has no terminal PTY. */
|
|
157
|
+
export interface DaemonTerminalSummary {
|
|
158
|
+
id: string;
|
|
159
|
+
alive: boolean;
|
|
160
|
+
correlationId: string;
|
|
161
|
+
hasPty?: boolean;
|
|
162
|
+
instance: string;
|
|
163
|
+
name?: string;
|
|
164
|
+
sessionId: string;
|
|
165
|
+
sourceRoot?: { name: string; dbPath: string };
|
|
166
|
+
startedAt: number;
|
|
167
|
+
status?: string;
|
|
168
|
+
/** PTY metadata already serialized by GET /v1/terminals. */
|
|
169
|
+
kind?: string;
|
|
170
|
+
/** 실행 명령. 데몬이 보유한 웹 셸은 `'web-terminal'` — 터미널 탭(XtermView)이 «붙을 수 있는» 유일한 종류다. */
|
|
171
|
+
cmd?: string;
|
|
172
|
+
nickname?: string;
|
|
173
|
+
/** Terminal creation requester serialized by current daemons; absent from legacy responses. */
|
|
174
|
+
origin?: 'human' | 'system' | 'unknown';
|
|
175
|
+
/** Canonical manifest/CLI provenance, optional so legacy daemon responses remain compatible. */
|
|
176
|
+
terminalOriginCategory?: 'direct-human' | 'elanous' | 'external-tool' | 'unknown';
|
|
177
|
+
terminalOriginReason?: string;
|
|
178
|
+
externalToolName?: string;
|
|
179
|
+
/** Omitted when no controller was recorded; an empty string is preserved when explicitly sent. */
|
|
180
|
+
controller?: string;
|
|
181
|
+
/** Epoch-millisecond time of the most recent terminal control, absent when the daemon did not provide it. */
|
|
182
|
+
lastControlAt?: number;
|
|
183
|
+
/** `null` means this manifest-only row cannot know the owner-process access mode. */
|
|
184
|
+
accessMode: 'read' | 'write' | 'auto' | null;
|
|
185
|
+
workdir?: string;
|
|
186
|
+
treeName?: string;
|
|
187
|
+
worktreeName?: string;
|
|
188
|
+
runId?: string;
|
|
189
|
+
/** Owner run usage state serialized by GET /v1/terminals; absent from legacy responses. */
|
|
190
|
+
ownerRunUsage?: 'running' | 'terminated-live-owner' | 'no-run-id' | 'unknown';
|
|
191
|
+
exitCode?: number | null;
|
|
192
|
+
/** Direct parent screen identifier already serialized by GET /v1/terminals. */
|
|
193
|
+
parentPtyId?: string;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/** Scope metadata returned alongside terminal rows. The daemon may add fields
|
|
197
|
+
* without requiring the PWA to know them in advance. */
|
|
198
|
+
export interface DaemonTerminalsScope {
|
|
199
|
+
roots?: number;
|
|
200
|
+
federated?: boolean;
|
|
201
|
+
hiddenDead?: number;
|
|
202
|
+
domain?: string;
|
|
203
|
+
[field: string]: unknown;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export interface DaemonTerminalsResponse {
|
|
207
|
+
terminals: DaemonTerminalSummary[];
|
|
208
|
+
scope?: DaemonTerminalsScope;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
export interface DaemonTerminalListOptions {
|
|
212
|
+
all?: true;
|
|
213
|
+
includeTest?: true;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export interface DaemonTerminalDetailOptions {
|
|
217
|
+
sourceRoot?: string;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** One screen in a daemon-provided terminal lineage group. */
|
|
221
|
+
export interface DaemonTerminalLineageRow {
|
|
222
|
+
ptyId: string;
|
|
223
|
+
kind: string;
|
|
224
|
+
instance: string;
|
|
225
|
+
alive: boolean;
|
|
226
|
+
startedAt: number;
|
|
227
|
+
closed?: boolean;
|
|
228
|
+
closedAt?: number;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/** Terminal lineage returned by GET /v1/terminals/lineage. `joinedBy` remains
|
|
232
|
+
* open so a new daemon grouping strategy reaches the PWA without a release. */
|
|
233
|
+
export interface DaemonTerminalLineageGroup {
|
|
234
|
+
joinedBy: string;
|
|
235
|
+
key: string;
|
|
236
|
+
rows: DaemonTerminalLineageRow[];
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export interface DaemonTerminalLineageResponse {
|
|
240
|
+
key: string;
|
|
241
|
+
groups: DaemonTerminalLineageGroup[];
|
|
242
|
+
unreadablePayloads?: number;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** One serialized row returned from GET /v1/logs. */
|
|
246
|
+
export interface DaemonLogEntry {
|
|
247
|
+
id: number;
|
|
248
|
+
ts: string;
|
|
249
|
+
level: string;
|
|
250
|
+
surface: string;
|
|
251
|
+
category: string;
|
|
252
|
+
event: string;
|
|
253
|
+
sessionId?: string;
|
|
254
|
+
data?: unknown;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
export interface DaemonLogsResponse {
|
|
258
|
+
ok: boolean;
|
|
259
|
+
logs: DaemonLogEntry[];
|
|
260
|
+
count: number;
|
|
261
|
+
ts: string;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/** Phase B-1 (PWA chat streaming · 2026-05-06) — handler set passed to
|
|
265
|
+
* `DaemonClient.promptStream`. All callbacks are optional; the
|
|
266
|
+
* returned `PromptResponse` includes the final result even when callers ignore deltas. */
|
|
267
|
+
export interface PromptStreamErrorPayload {
|
|
268
|
+
error: string;
|
|
269
|
+
message?: string;
|
|
270
|
+
holder?: string;
|
|
271
|
+
[field: string]: unknown;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface PromptStreamHandlers {
|
|
275
|
+
/** Fires once at stream start with the daemon-assigned sessionId
|
|
276
|
+
* (PWA may have submitted with no sessionId — the daemon mints one
|
|
277
|
+
* before any LLM call). */
|
|
278
|
+
onTurnBegin?: (info: { sessionId: string }) => void;
|
|
279
|
+
/** Fires per LLM text delta. `delta` is the new fragment; `full` is
|
|
280
|
+
* the cumulative assistant text up to and including it. */
|
|
281
|
+
onTextDelta?: (info: { delta: string; full: string }) => void;
|
|
282
|
+
/** Phase B-2 (2026-05-06) — fires when the daemon emits an
|
|
283
|
+
* `image-block` event (e.g. tool_result with image content). `src`
|
|
284
|
+
* is a renderable URL — typically a `data:` URI in the current
|
|
285
|
+
* daemon implementation but the type allows remote URLs so future
|
|
286
|
+
* attachment-store-backed flows can reuse the same wire. */
|
|
287
|
+
onImageBlock?: (info: { src: string; mediaType: string; alt?: string }) => void;
|
|
288
|
+
/** Phase B-3 (2026-05-06) — tool lifecycle hooks. `onToolCall` fires
|
|
289
|
+
* pre-dispatch (status pill flips to running); `onToolResult`
|
|
290
|
+
* fires once the dispatcher returns (status flips to done/error +
|
|
291
|
+
* optional summary line). `id` ties the two events together — PWA
|
|
292
|
+
* consumers find the matching block by id. */
|
|
293
|
+
onToolCall?: (info: {
|
|
294
|
+
id: string;
|
|
295
|
+
name: string;
|
|
296
|
+
args: Record<string, unknown>;
|
|
297
|
+
}) => void;
|
|
298
|
+
onToolResult?: (info: {
|
|
299
|
+
id: string;
|
|
300
|
+
name: string;
|
|
301
|
+
ok: boolean;
|
|
302
|
+
summary?: string;
|
|
303
|
+
/** 툴 결과 «원본» — 발신 쪽 이름은 `result` 이고 여기서는 `rawOutput` 으로 준다. */
|
|
304
|
+
rawOutput?: unknown;
|
|
305
|
+
/** 결과가 화면을 가진다면 그 주소(MCP Apps · `_meta.ui.resourceUri`). */
|
|
306
|
+
resourceUri?: string;
|
|
307
|
+
/** 원본이 «빠진» 이유 — 발신 쪽이 아는 사실만. 없으면 그 칸도 없다. */
|
|
308
|
+
resultOmittedReason?: 'too_large' | 'unserializable';
|
|
309
|
+
}) => void;
|
|
310
|
+
/** M1 PR 2 (PLAN-rich-dev-feedback-multi-surface · 2026-05-13) —
|
|
311
|
+
* carrier-agnostic `feedback` envelope channel. Daemon emits an SSE
|
|
312
|
+
* `feedback` event per envelope (search-hit / diff / agent.status /
|
|
313
|
+
* agent.thinking / debug.line / etc — see `FeedbackKind` for the
|
|
314
|
+
* full 8-way union). Wire validation (`isFeedbackEnvelopeWire`)
|
|
315
|
+
* runs before dispatch — malformed envelopes are silently dropped
|
|
316
|
+
* to keep the chat tab resilient to daemon-side schema drift.
|
|
317
|
+
*
|
|
318
|
+
* Per-kind renderer wiring (collapsible diff · search-hit jump-to-
|
|
319
|
+
* file · thinking pill · debug drawer) lands in M3/M4/M5; this PR
|
|
320
|
+
* only defines the transport so handlers can opt-in early. */
|
|
321
|
+
onFeedback?: (env: FeedbackEnvelopeWire) => void;
|
|
322
|
+
/** Fires once on terminal `turn-end` event. The promise also
|
|
323
|
+
* resolves with the same payload. */
|
|
324
|
+
onTurnEnd?: (info: PromptResponse) => void;
|
|
325
|
+
/** Fires on terminal `error` event (e.g. `turn_preempted` /
|
|
326
|
+
* `turn_failed`). The promise rejects with the same message. */
|
|
327
|
+
onError?: (info: PromptStreamErrorPayload) => void;
|
|
328
|
+
/** Optional fetch abort signal — same semantics as `fetch(input,
|
|
329
|
+
* { signal })`. */
|
|
330
|
+
signal?: AbortSignal;
|
|
331
|
+
/** M6 PR 2 (PLAN-rich-dev-feedback-multi-surface · 2026-05-13) —
|
|
332
|
+
* opt-in debug-tap. When true the request URL gains a `?debug-tap=
|
|
333
|
+
* on` query so daemon's debug-bridge activates and mirrors
|
|
334
|
+
* `debug.log` events back as `debug.line` envelopes. Default false
|
|
335
|
+
* keeps the wire identical to the legacy chat client. */
|
|
336
|
+
debugTap?: boolean;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export interface AcpFrame {
|
|
340
|
+
jsonrpc?: '2.0';
|
|
341
|
+
id?: string | number;
|
|
342
|
+
method?: string;
|
|
343
|
+
params?: unknown;
|
|
344
|
+
result?: unknown;
|
|
345
|
+
error?: { code: number; message: string; data?: unknown };
|
|
346
|
+
// elanous-specific notification kinds.
|
|
347
|
+
kind?: 'output' | 'exit' | 'snapshot' | 'sessionUpdate' | 'error';
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export type AcpFrameHandler = (frame: AcpFrame) => void;
|
|
351
|
+
export type AcpConnectionState = 'CONNECTING' | 'OPEN' | 'FAILED' | 'CLOSED';
|
|
352
|
+
export type AcpStateHandler = (state: AcpConnectionState, error?: Error) => void;
|
|
353
|
+
|
|
354
|
+
/** M4 of PLAN-ask-user-question-cross-surface-2026-05-13 — inbound
|
|
355
|
+
* JSON-RPC request handler. Returning the result resolves the server's
|
|
356
|
+
* `sendRequest` Promise via a JSON-RPC `result` frame; throwing falls
|
|
357
|
+
* through to a `-32603 internal error` response (handler-side guard
|
|
358
|
+
* · wire error already covers decode failures upstream). */
|
|
359
|
+
export type AcpRequestHandler = (params: unknown) => Promise<unknown> | unknown;
|
|
360
|
+
|
|
361
|
+
export interface AcpConnection {
|
|
362
|
+
send(method: string, params: unknown): Promise<unknown>;
|
|
363
|
+
on(kind: NonNullable<AcpFrame['kind']>, cb: AcpFrameHandler): () => void;
|
|
364
|
+
onAny(cb: AcpFrameHandler): () => void;
|
|
365
|
+
/** M4 — register an inbound request handler for a specific method
|
|
366
|
+
* (e.g. `elanous/ask/request`). Each lease keeps an independent binding.
|
|
367
|
+
* The latest active binding owns the one JSON-RPC response; disposing it
|
|
368
|
+
* restores the preceding binding. Returns a disposer that removes only
|
|
369
|
+
* this binding. Notifications (method without id) still flow via `on()` /
|
|
370
|
+
* `onAny()`. */
|
|
371
|
+
onRequest(method: string, handler: AcpRequestHandler): () => void;
|
|
372
|
+
onState(cb: AcpStateHandler): () => void;
|
|
373
|
+
readonly state: AcpConnectionState;
|
|
374
|
+
/** Releases this consumer lease; shared transport closes after the last lease. */
|
|
375
|
+
close(): void;
|
|
376
|
+
readonly readyState: number; // mirrors WebSocket.readyState
|
|
377
|
+
/** WT-S-1.5 — resolves to the daemon-issued sessionId after the auto
|
|
378
|
+
* handshake completes (`initialize` + `session/new`). PWA peers
|
|
379
|
+
* attach to this id so daemon broadcasts reach them. */
|
|
380
|
+
readonly ready: Promise<string>;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export type DaemonTerminalControlResult = {
|
|
384
|
+
status: 'success' | 'unknown-pty' | 'denied' | 'failed' | 'owner-unreachable';
|
|
385
|
+
reason?: string;
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
export type DaemonTerminalSnapshotResult = DaemonTerminalControlResult & { screen?: string };
|
|
389
|
+
|
|
390
|
+
export type DaemonTerminalRenameResult =
|
|
391
|
+
| { status: 'success'; id: string; name: string }
|
|
392
|
+
| { status: 'invalid-name' | 'unknown-pty' | 'denied' | 'failed' | 'owner-unreachable' };
|
|
393
|
+
|
|
394
|
+
export type CodexLoginStatus =
|
|
395
|
+
| { state: 'idle' }
|
|
396
|
+
| { state: 'pending'; mode: 'browser' | 'device'; authorizeUrl?: string; userCode?: string; verificationUrl?: string }
|
|
397
|
+
| { state: 'ok'; mode: 'browser' | 'device' }
|
|
398
|
+
| { state: 'error'; mode: 'browser' | 'device'; error: string };
|
|
399
|
+
|
|
400
|
+
export class DaemonClient {
|
|
401
|
+
private readonly acpConnections = new Map<string, AcpConnectionImpl>();
|
|
402
|
+
|
|
403
|
+
constructor(private cfg: DaemonConfig) {}
|
|
404
|
+
|
|
405
|
+
updateConfig(cfg: DaemonConfig): void {
|
|
406
|
+
const previousIdentity = `${buildAcpWsUrl(this.cfg)}\u0000${this.cfg.token}`;
|
|
407
|
+
const nextIdentity = `${buildAcpWsUrl(cfg)}\u0000${cfg.token}`;
|
|
408
|
+
this.cfg = cfg;
|
|
409
|
+
if (previousIdentity === nextIdentity) return;
|
|
410
|
+
|
|
411
|
+
// A session key alone cannot identify a daemon transport after its URL or
|
|
412
|
+
// bearer credential changes. Retire every old core so future leases use
|
|
413
|
+
// only the new configuration; existing consumers observe CLOSED.
|
|
414
|
+
this.acpConnections.forEach((connection) => connection.dispose());
|
|
415
|
+
this.acpConnections.clear();
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// --- REST -----------------------------------------------------------
|
|
419
|
+
|
|
420
|
+
/** Generic authenticated fetch wrapper — used by intake/control surfaces
|
|
421
|
+
* that hit many small endpoints. JSON-decoded by default; pass
|
|
422
|
+
* rawResponse:true to get the Response object. */
|
|
423
|
+
/** ⛔⭐ 응답을 «그대로» 준다 — 본문만 필요한 곳은 `fetchJson` 을 쓴다.
|
|
424
|
+
*
|
|
425
|
+
* 📏 2026-08-21: 위젯 리소스 응답이 CSP 허용 출처를 «머리»로 나르는데, 본문만 돌려주는
|
|
426
|
+
* helper 밖에 없어서 그 목록이 통째로 버려졌고 위젯이 죽은 껍데기가 됐다.
|
|
427
|
+
* ⇒ URL 조립과 인증은 여전히 «이 한 집»에 있고, 머리를 읽어야 하는 쪽만 이 문으로 온다. */
|
|
428
|
+
async fetchResponse(path: string, init?: RequestInit): Promise<Response> {
|
|
429
|
+
const res = await fetch(this.url(path), {
|
|
430
|
+
...init,
|
|
431
|
+
headers: { ...this.authHeaders(), ...(init?.headers ?? {}) },
|
|
432
|
+
});
|
|
433
|
+
if (res.status === 401) reportAuthRequired(path);
|
|
434
|
+
return res;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
/** TERM1 · 10-02 — concurrent GETs of the terminal list share one request (several panels ask at once). */
|
|
438
|
+
private readonly inflightTerminals = new Map<string, Promise<unknown>>();
|
|
439
|
+
|
|
440
|
+
async fetchJson<T = unknown>(path: string, init?: RequestInit): Promise<T> {
|
|
441
|
+
if (path.startsWith('/v1/terminals') && !path.startsWith('/v1/terminals/') && (!init || ((init.method ?? 'GET') === 'GET' && init.body === undefined))) {
|
|
442
|
+
const shared = this.inflightTerminals.get(path);
|
|
443
|
+
if (shared) return shared as Promise<T>;
|
|
444
|
+
const request = this.fetchJsonOnce<T>(path, init).finally(() => { this.inflightTerminals.delete(path); });
|
|
445
|
+
this.inflightTerminals.set(path, request);
|
|
446
|
+
return request;
|
|
447
|
+
}
|
|
448
|
+
return this.fetchJsonOnce<T>(path, init);
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
private async fetchJsonOnce<T = unknown>(path: string, init?: RequestInit): Promise<T> {
|
|
452
|
+
const res = await this.fetchResponse(path, init);
|
|
453
|
+
const ctype = res.headers.get('content-type') ?? '';
|
|
454
|
+
const body = ctype.includes('application/json')
|
|
455
|
+
? await res.json()
|
|
456
|
+
: await res.text();
|
|
457
|
+
if (!res.ok) {
|
|
458
|
+
const msg =
|
|
459
|
+
typeof body === 'string'
|
|
460
|
+
? body
|
|
461
|
+
: (body?.reason ?? body?.error ?? `${res.status}`);
|
|
462
|
+
throw new Error(String(msg));
|
|
463
|
+
}
|
|
464
|
+
return body as T;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
getCodexLogin(): Promise<CodexLoginStatus> {
|
|
468
|
+
return this.fetchJson<CodexLoginStatus>('/v1/setup/codex-login');
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
startCodexLogin(mode: 'browser' | 'device'): Promise<CodexLoginStatus> {
|
|
472
|
+
return this.fetchJson<CodexLoginStatus>('/v1/setup/codex-login', {
|
|
473
|
+
method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ mode }),
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
async health(): Promise<{ ok: boolean }> {
|
|
478
|
+
return this.fetchJson<{ ok: boolean }>('/v1/health');
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
async submitConsultRequest(request: ConsultRequest): Promise<ConsultRequestResult> {
|
|
482
|
+
const path = '/v1/consult-requests';
|
|
483
|
+
const res = await this.fetchResponse(path, {
|
|
484
|
+
method: 'POST',
|
|
485
|
+
headers: { 'content-type': 'application/json' },
|
|
486
|
+
body: JSON.stringify(request),
|
|
487
|
+
});
|
|
488
|
+
if (res.status === 202) return (await res.json()) as { receiptId: string; receivedAt: string };
|
|
489
|
+
if (res.status === 400) return (await res.json()) as { error: 'bad_request'; field: string };
|
|
490
|
+
throw new Error(`consult-requests ${res.status}`);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
async listExecRequests(): Promise<{ items: ExecRequestItem[] }> {
|
|
494
|
+
return this.fetchJson('/v1/exec-requests');
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
async getExecRequest(id: string): Promise<ExecRequestDetail> {
|
|
498
|
+
return this.fetchJson(`/v1/exec-requests/${encodeURIComponent(id)}`);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
async submitExecRequest(text: string): Promise<{ id: string; status: 'planning' }> {
|
|
502
|
+
const path = '/v1/exec-requests';
|
|
503
|
+
const res = await this.fetchResponse(path, {
|
|
504
|
+
method: 'POST',
|
|
505
|
+
headers: { 'content-type': 'application/json' },
|
|
506
|
+
body: JSON.stringify({ text }),
|
|
507
|
+
});
|
|
508
|
+
if (res.status !== 202) throw new Error(`exec-requests ${res.status}`);
|
|
509
|
+
return (await res.json()) as { id: string; status: 'planning' };
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
async listSeatRequests(options: { seat?: string; limit?: number } = {}): Promise<SeatRequestsResponse> {
|
|
513
|
+
const query = new URLSearchParams();
|
|
514
|
+
if (options.seat !== undefined) query.set('seat', options.seat);
|
|
515
|
+
if (options.limit !== undefined) query.set('limit', String(options.limit));
|
|
516
|
+
const suffix = query.size ? `?${query}` : '';
|
|
517
|
+
return this.fetchJson<SeatRequestsResponse>(`/v1/seat-requests${suffix}`);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
async listSeatAskAnswers(clientId: string): Promise<{ items: Array<{ id: string; text: string; status: 'answered' | 'expired' }> }> {
|
|
521
|
+
return this.fetchJson('/v1/seat-requests?answers=1', { headers: { 'x-seat-ask-client': clientId } });
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
async acknowledgeSeatAskAnswers(clientId: string, ids: string[]): Promise<void> {
|
|
525
|
+
await this.fetchJson('/v1/seat-requests?answers=ack', {
|
|
526
|
+
method: 'POST', headers: { 'content-type': 'application/json', 'x-seat-ask-client': clientId },
|
|
527
|
+
body: JSON.stringify({ ids }),
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
async submitSeatAsk(text: string, clientId: string): Promise<{ reply: string }> {
|
|
532
|
+
const response = await this.fetchResponse('/v1/seat-requests', {
|
|
533
|
+
method: 'POST', headers: { 'content-type': 'application/json', 'x-seat-ask-client': clientId },
|
|
534
|
+
body: JSON.stringify({ seat: 'TC', text }),
|
|
535
|
+
});
|
|
536
|
+
if (!response.ok) throw new Error(`seat ask ${response.status}`);
|
|
537
|
+
return response.json() as Promise<{ reply: string }>;
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
async submitSeatRequest(request: { seat?: string; text: string; attachments?: AttachmentMeta[] }, idempotencyKey: string): Promise<SeatRequestReceipt> {
|
|
541
|
+
const path = '/v1/seat-requests';
|
|
542
|
+
const { seat, text, attachments } = request;
|
|
543
|
+
const response = await this.fetchResponse(path, {
|
|
544
|
+
method: 'POST',
|
|
545
|
+
headers: { 'content-type': 'application/json', 'Idempotency-Key': idempotencyKey },
|
|
546
|
+
body: JSON.stringify({ ...(seat !== undefined ? { seat } : {}), text,
|
|
547
|
+
...(attachments?.length ? { attachments: attachments.map(({ id, filename, mediaType, size }) => ({
|
|
548
|
+
id, name: filename, mediaType, bytes: size,
|
|
549
|
+
})) } : {}),
|
|
550
|
+
}),
|
|
551
|
+
});
|
|
552
|
+
const body = await response.json() as SeatRequestReceipt | { error?: string; seats?: SeatSummary[] };
|
|
553
|
+
if (!response.ok) {
|
|
554
|
+
const error = body as { error?: string; seats?: SeatSummary[] };
|
|
555
|
+
throw new SeatRequestError(response.status, error.error ?? `http-${response.status}`, error.seats ?? []);
|
|
556
|
+
}
|
|
557
|
+
return body as SeatRequestReceipt;
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
/** Phase B-4 follow-up (2026-05-06) — long-lived observer SSE for a
|
|
561
|
+
* given `sessionId`. Re-emits the same wire shape `promptStream`
|
|
562
|
+
* consumes, fanned out from the in-process chat-event bus on the
|
|
563
|
+
* daemon side (see `src/nexus/api/chat-event-bus.ts`). Returns a
|
|
564
|
+
* disposer the caller MUST invoke on unmount / sessionId change to
|
|
565
|
+
* release the daemon-side listener slot. The disposer aborts the
|
|
566
|
+
* underlying fetch, which Bun.serve translates into the bus
|
|
567
|
+
* unsubscribe via the ReadableStream `cancel` callback.
|
|
568
|
+
*
|
|
569
|
+
* Differences from `promptStream`:
|
|
570
|
+
* - never resolves on `turn-end` (multi-turn lifetime)
|
|
571
|
+
* - never rejects on `error` event (re-emitted to onError; the
|
|
572
|
+
* stream stays open for the next turn)
|
|
573
|
+
* - emits a synthetic `subscribed` log on the first event the
|
|
574
|
+
* daemon ships (signals the bus subscription is live)
|
|
575
|
+
*
|
|
576
|
+
* Consumers (ChatLayout.useEffect) should treat each `turn-begin`
|
|
577
|
+
* as a remote turn boundary and synthesize a fresh assistant
|
|
578
|
+
* placeholder, just as `promptStream` callers do for the local
|
|
579
|
+
* turn — the same placeholder semantics extend across tabs. */
|
|
580
|
+
subscribeChatEvents(
|
|
581
|
+
sessionId: string,
|
|
582
|
+
handlers: PromptStreamHandlers = {},
|
|
583
|
+
): () => void {
|
|
584
|
+
const ac = new AbortController();
|
|
585
|
+
const init: RequestInit = {
|
|
586
|
+
method: 'GET',
|
|
587
|
+
headers: { accept: 'text/event-stream', ...this.authHeaders() },
|
|
588
|
+
signal: ac.signal,
|
|
589
|
+
};
|
|
590
|
+
const url = `${this.url('/v1/chat/events')}?sessionId=${encodeURIComponent(sessionId)}`;
|
|
591
|
+
debugLog('webterm.chat.observer.subscribe', { sessionId });
|
|
592
|
+
// Fire-and-forget: the lifetime is owned by the disposer the
|
|
593
|
+
// caller stores. Errors from the long-lived fetch (network drop,
|
|
594
|
+
// daemon restart) surface via handlers.onError but do NOT throw
|
|
595
|
+
// synchronously — same shape as ACP WS reconnect would have.
|
|
596
|
+
void (async () => {
|
|
597
|
+
try {
|
|
598
|
+
const res = await fetch(url, init);
|
|
599
|
+
if (res.status === 401) reportAuthRequired('/v1/chat/events');
|
|
600
|
+
if (!res.ok || !res.body) {
|
|
601
|
+
handlers.onError?.({
|
|
602
|
+
error: 'observer_failed',
|
|
603
|
+
message: `${res.status}: ${await res.text()}`,
|
|
604
|
+
});
|
|
605
|
+
return;
|
|
606
|
+
}
|
|
607
|
+
await consumeObserverSse(res.body, handlers);
|
|
608
|
+
} catch (err) {
|
|
609
|
+
// Aborted via disposer is the expected exit path on unmount /
|
|
610
|
+
// sessionId change — don't re-emit as an error.
|
|
611
|
+
if (ac.signal.aborted) return;
|
|
612
|
+
handlers.onError?.({
|
|
613
|
+
error: 'observer_disconnected',
|
|
614
|
+
message: err instanceof Error ? err.message : String(err),
|
|
615
|
+
});
|
|
616
|
+
}
|
|
617
|
+
debugLog('webterm.chat.observer.end', { sessionId });
|
|
618
|
+
})();
|
|
619
|
+
return () => {
|
|
620
|
+
debugLog('webterm.chat.observer.dispose', { sessionId });
|
|
621
|
+
try { ac.abort(); } catch { /* swallow */ }
|
|
622
|
+
};
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
/** Rich-dev-feedback opportunistic followup §6.2 #3 (2026-05-13) —
|
|
626
|
+
* subscribe to daemon `agent.status` NexusEvents on `/v1/events`
|
|
627
|
+
* and synthesize FeedbackEnvelope shapes so the existing
|
|
628
|
+
* accumulator + `<StatusChip>` renderer (M3 PR #2483) hydrates
|
|
629
|
+
* without ad-hoc per-renderer plumbing.
|
|
630
|
+
*
|
|
631
|
+
* Why synthesize on the client (not server)? `/v1/events` carries
|
|
632
|
+
* the broad NexusEvent contract and a single SSE serves many
|
|
633
|
+
* surfaces; envelope-shape data only matters to chat consumers.
|
|
634
|
+
* Keeping the translation here keeps the bus generic.
|
|
635
|
+
*
|
|
636
|
+
* Status enum mapping (AgentStatusStore `SessionStatus` →
|
|
637
|
+
* FeedbackEnvelope `AgentStatusPayload.status`):
|
|
638
|
+
* working → running
|
|
639
|
+
* awaiting → queued
|
|
640
|
+
* done → done
|
|
641
|
+
* err → error
|
|
642
|
+
* idle → skipped (no envelope emitted)
|
|
643
|
+
*
|
|
644
|
+
* Caller passes the chat session id; the synthesized envelope's
|
|
645
|
+
* `sessionId` adopts it so the accumulator merges the
|
|
646
|
+
* `<StatusChip>` block into the current chat — same surface as
|
|
647
|
+
* the M2 ThinkingBridge envelopes.
|
|
648
|
+
*
|
|
649
|
+
* Returns a disposer the caller MUST invoke on unmount / session
|
|
650
|
+
* change so the long-lived fetch aborts and the daemon-side bus
|
|
651
|
+
* subscriber releases. */
|
|
652
|
+
subscribeAgentStatusEvents(
|
|
653
|
+
sessionId: string,
|
|
654
|
+
handlers: AgentStatusEventHandlers,
|
|
655
|
+
): () => void {
|
|
656
|
+
const ac = new AbortController();
|
|
657
|
+
const url = `${this.url('/v1/events')}?topics=agent.status`;
|
|
658
|
+
debugLog('webterm.agent-status.subscribe', { sessionId });
|
|
659
|
+
void (async () => {
|
|
660
|
+
try {
|
|
661
|
+
const res = await fetch(url, {
|
|
662
|
+
method: 'GET',
|
|
663
|
+
headers: { accept: 'text/event-stream', ...this.authHeaders() },
|
|
664
|
+
signal: ac.signal,
|
|
665
|
+
});
|
|
666
|
+
if (res.status === 401) reportAuthRequired('/v1/events');
|
|
667
|
+
if (!res.ok || !res.body) {
|
|
668
|
+
handlers.onError?.({
|
|
669
|
+
error: 'agent_status_failed',
|
|
670
|
+
message: `${res.status}: ${await res.text()}`,
|
|
671
|
+
});
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
await consumeAgentStatusSse(res.body, sessionId, handlers);
|
|
675
|
+
} catch (err) {
|
|
676
|
+
if (ac.signal.aborted) return;
|
|
677
|
+
handlers.onError?.({
|
|
678
|
+
error: 'agent_status_disconnected',
|
|
679
|
+
message: err instanceof Error ? err.message : String(err),
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
debugLog('webterm.agent-status.end', { sessionId });
|
|
683
|
+
})();
|
|
684
|
+
return () => {
|
|
685
|
+
debugLog('webterm.agent-status.dispose', { sessionId });
|
|
686
|
+
try { ac.abort(); } catch { /* swallow */ }
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
/** PLAN-chat-hud-multi-surface-port-2026-05-13 §4 M4 — long-lived
|
|
691
|
+
* SSE subscriber for `/v1/events?topics=hud.segment`. Mirrors
|
|
692
|
+
* subscribeAgentStatusEvents 1:1; each `hud.segment` NexusEvent
|
|
693
|
+
* becomes a synthesized FeedbackEnvelopeWire that flows through
|
|
694
|
+
* the M1 `applyHudSegmentEnvelope` accumulator (routed via the
|
|
695
|
+
* chat-runtime onFeedback path).
|
|
696
|
+
*
|
|
697
|
+
* Disposer aborts the long-lived fetch. */
|
|
698
|
+
subscribeHudSegmentEvents(
|
|
699
|
+
sessionId: string,
|
|
700
|
+
handlers: HudSegmentEventHandlers,
|
|
701
|
+
): () => void {
|
|
702
|
+
const ac = new AbortController();
|
|
703
|
+
const url = `${this.url('/v1/events')}?topics=hud.segment`;
|
|
704
|
+
debugLog('webterm.hud-segment.subscribe', { sessionId });
|
|
705
|
+
void (async () => {
|
|
706
|
+
try {
|
|
707
|
+
const res = await fetch(url, {
|
|
708
|
+
method: 'GET',
|
|
709
|
+
headers: { accept: 'text/event-stream', ...this.authHeaders() },
|
|
710
|
+
signal: ac.signal,
|
|
711
|
+
});
|
|
712
|
+
if (res.status === 401) reportAuthRequired('/v1/events');
|
|
713
|
+
if (!res.ok || !res.body) {
|
|
714
|
+
handlers.onError?.({
|
|
715
|
+
error: 'hud_segment_failed',
|
|
716
|
+
message: `${res.status}: ${await res.text()}`,
|
|
717
|
+
});
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
720
|
+
await consumeHudSegmentSse(res.body, sessionId, handlers);
|
|
721
|
+
} catch (err) {
|
|
722
|
+
if (ac.signal.aborted) return;
|
|
723
|
+
handlers.onError?.({
|
|
724
|
+
error: 'hud_segment_disconnected',
|
|
725
|
+
message: err instanceof Error ? err.message : String(err),
|
|
726
|
+
});
|
|
727
|
+
}
|
|
728
|
+
debugLog('webterm.hud-segment.end', { sessionId });
|
|
729
|
+
})();
|
|
730
|
+
return () => {
|
|
731
|
+
debugLog('webterm.hud-segment.dispose', { sessionId });
|
|
732
|
+
try { ac.abort(); } catch { /* swallow */ }
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
/** ⛔⭐⭐⭐⭐ **두 구독을 «한 연결»로 합친다** — 19차 `[F]` · 2026-08-22.
|
|
737
|
+
*
|
|
738
|
+
* 📏 왜: `subscribeAgentStatusEvents` 와 `subscribeHudSegmentEvents` 는 각각
|
|
739
|
+
* ***끝나지 않는 fetch 를 하나씩*** 연다. 채팅 탭 한 장이 그런 연결을 여럿 열면
|
|
740
|
+
* ***브라우저의 HTTP/1.1 호스트당 한도(6)***에 닿고, 그 순간 죽는 것은 SSE 가 아니라
|
|
741
|
+
* ***「나머지 전부」***다 — 관측 업로드 · 위젯 데이터 · 심지어 문서 요청.
|
|
742
|
+
* (실측: 그 상태에서 PWA 로그 8분 0건 · 탭 리로드 불가.)
|
|
743
|
+
*
|
|
744
|
+
* ⭐ 서버는 이미 `?topics=a,b` **콤마 다중 토픽**을 지원한다(`nexus/api/events.ts`).
|
|
745
|
+
* ⇒ 한 번만 열고 **`ReadableStream.tee()`** 로 갈라 두 소비자에게 준다.
|
|
746
|
+
* ⭐⭐ 소비자는 «자기 이벤트 이름이 아니면 무시»하도록 이미 짜여 있어 **수정이 필요 없다**
|
|
747
|
+
* (`parsed.event !== 'agent.status'` / `!== 'hud.segment'` continue).
|
|
748
|
+
*
|
|
749
|
+
* ⚠️ `tee()` 는 한쪽이 느리면 다른 쪽 버퍼가 는다 — 둘 다 프레임당 상수 시간이라 문제 없다.
|
|
750
|
+
* ⚠️ 기존 두 메서드는 «남겨 둔다» — 다른 화면이 하나만 쓸 수 있고, 그때는 합칠 것이 없다. */
|
|
751
|
+
subscribeChatFeedbackEvents(
|
|
752
|
+
sessionId: string,
|
|
753
|
+
handlers: {
|
|
754
|
+
agentStatus: AgentStatusEventHandlers;
|
|
755
|
+
hudSegment: HudSegmentEventHandlers;
|
|
756
|
+
},
|
|
757
|
+
): () => void {
|
|
758
|
+
const ac = new AbortController();
|
|
759
|
+
const topics = ['agent.status', 'hud.segment'];
|
|
760
|
+
const url = `${this.url('/v1/events')}?topics=${topics.join(',')}`;
|
|
761
|
+
debugLog('webterm.chat-feedback.subscribe', { sessionId, topics });
|
|
762
|
+
void (async () => {
|
|
763
|
+
try {
|
|
764
|
+
const res = await fetch(url, {
|
|
765
|
+
method: 'GET',
|
|
766
|
+
headers: { accept: 'text/event-stream', ...this.authHeaders() },
|
|
767
|
+
signal: ac.signal,
|
|
768
|
+
});
|
|
769
|
+
if (res.status === 401) reportAuthRequired('/v1/events');
|
|
770
|
+
if (!res.ok || !res.body) {
|
|
771
|
+
const message = `${res.status}: ${await res.text()}`;
|
|
772
|
+
handlers.agentStatus.onError?.({ error: 'agent_status_failed', message });
|
|
773
|
+
handlers.hudSegment.onError?.({ error: 'hud_segment_failed', message });
|
|
774
|
+
return;
|
|
775
|
+
}
|
|
776
|
+
const [forStatus, forHud] = res.body.tee();
|
|
777
|
+
await Promise.all([
|
|
778
|
+
consumeAgentStatusSse(forStatus, sessionId, handlers.agentStatus),
|
|
779
|
+
consumeHudSegmentSse(forHud, sessionId, handlers.hudSegment),
|
|
780
|
+
]);
|
|
781
|
+
} catch (err) {
|
|
782
|
+
if (ac.signal.aborted) return;
|
|
783
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
784
|
+
handlers.agentStatus.onError?.({ error: 'agent_status_disconnected', message });
|
|
785
|
+
handlers.hudSegment.onError?.({ error: 'hud_segment_disconnected', message });
|
|
786
|
+
}
|
|
787
|
+
debugLog('webterm.chat-feedback.end', { sessionId });
|
|
788
|
+
})();
|
|
789
|
+
return () => {
|
|
790
|
+
debugLog('webterm.chat-feedback.dispose', { sessionId });
|
|
791
|
+
try { ac.abort(); } catch { /* swallow */ }
|
|
792
|
+
};
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
/** Phase B-1 (PWA chat streaming) — SSE fallback consumes `text/event-stream` from
|
|
796
|
+
* `/v1/prompt/stream` and dispatches per-event into `handlers`.
|
|
797
|
+
* Resolves with the final `turn-end` payload or rejects on `error`
|
|
798
|
+
* event / non-200 status. */
|
|
799
|
+
async promptStream(
|
|
800
|
+
req: PromptRequest,
|
|
801
|
+
handlers: PromptStreamHandlers = {},
|
|
802
|
+
): Promise<PromptResponse> {
|
|
803
|
+
debugLog('webterm.rest.prompt.stream', {
|
|
804
|
+
sessionId: req.sessionId,
|
|
805
|
+
len: req.userText.length,
|
|
806
|
+
});
|
|
807
|
+
const init: RequestInit = {
|
|
808
|
+
method: 'POST',
|
|
809
|
+
headers: {
|
|
810
|
+
'content-type': 'application/json',
|
|
811
|
+
accept: 'text/event-stream',
|
|
812
|
+
...this.authHeaders(),
|
|
813
|
+
},
|
|
814
|
+
body: JSON.stringify({
|
|
815
|
+
...(req.sessionId !== undefined ? { sessionId: req.sessionId } : {}),
|
|
816
|
+
userText: req.userText,
|
|
817
|
+
...(req.userContent !== undefined ? { userContent: req.userContent } : {}),
|
|
818
|
+
...(req.provider !== undefined ? { provider: req.provider } : {}),
|
|
819
|
+
...(req.personaId !== undefined ? { personaId: req.personaId } : {}),
|
|
820
|
+
}),
|
|
821
|
+
};
|
|
822
|
+
if (handlers.signal) init.signal = handlers.signal;
|
|
823
|
+
const path = handlers.debugTap === true
|
|
824
|
+
? '/v1/prompt/stream?debug-tap=on'
|
|
825
|
+
: '/v1/prompt/stream';
|
|
826
|
+
const res = await fetch(this.url(path), init);
|
|
827
|
+
if (res.status === 401) reportAuthRequired(path);
|
|
828
|
+
if (!res.ok || !res.body) {
|
|
829
|
+
throw new Error(`prompt/stream ${res.status}: ${await res.text()}`);
|
|
830
|
+
}
|
|
831
|
+
return parsePromptSseStream(res.body, handlers);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
// --- WS -------------------------------------------------------------
|
|
835
|
+
|
|
836
|
+
connectAcp(opts: { sessionId?: string; onSession?: (id: string) => void } = {}): AcpConnection {
|
|
837
|
+
const url = buildAcpWsUrl(this.cfg);
|
|
838
|
+
if (!url) throw new Error('daemon baseUrl not configured');
|
|
839
|
+
|
|
840
|
+
// Only an explicit daemon session is a stable identity suitable for
|
|
841
|
+
// transport sharing. Calls that ask the daemon to mint a new session
|
|
842
|
+
// must remain independent rather than being merged by a synthetic key.
|
|
843
|
+
if (!opts.sessionId) {
|
|
844
|
+
return new AcpConnectionImpl(url, this.cfg.token).acquire(opts.onSession);
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
const key = opts.sessionId;
|
|
848
|
+
const existing = this.acpConnections.get(key);
|
|
849
|
+
if (existing && !existing.isTerminal) return existing.acquire(opts.onSession);
|
|
850
|
+
|
|
851
|
+
let connection: AcpConnectionImpl;
|
|
852
|
+
connection = new AcpConnectionImpl(url, this.cfg.token, opts.sessionId, () => {
|
|
853
|
+
// A delayed close event from an old failed connection must not erase a
|
|
854
|
+
// newer connection that has already claimed this session key.
|
|
855
|
+
if (this.acpConnections.get(key) === connection) this.acpConnections.delete(key);
|
|
856
|
+
});
|
|
857
|
+
this.acpConnections.set(key, connection);
|
|
858
|
+
return connection.acquire(opts.onSession);
|
|
859
|
+
}
|
|
860
|
+
|
|
861
|
+
voiceWsUrl(): string {
|
|
862
|
+
return buildVoiceWsUrl(this.cfg);
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
/** Voice 일원화 FU PP-V-2 (2026-05-07) — month-to-date STT/TTS cost
|
|
866
|
+
* summary. PWA 헤더의 VoiceCostPill 가 1분 polling 으로 호출. 응답은
|
|
867
|
+
* daemon `voice-rest-handler.handleCost()` 의 shape (monthYYYYMM,
|
|
868
|
+
* sttUsd, ttsUsd, totalUsd, sttDurationSec, ttsCharCount). */
|
|
869
|
+
async voiceCost(): Promise<{
|
|
870
|
+
monthYYYYMM: string;
|
|
871
|
+
sttUsd: number;
|
|
872
|
+
ttsUsd: number;
|
|
873
|
+
totalUsd: number;
|
|
874
|
+
sttDurationSec: number;
|
|
875
|
+
ttsCharCount: number;
|
|
876
|
+
}> {
|
|
877
|
+
return this.fetchJson('/v1/voice/cost');
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
/** CV-3 P4.2 — list active PTY terminals registered in the daemon's
|
|
881
|
+
* pty-shell registry. Backs the Showroom "pin from terminal" picker
|
|
882
|
+
* (replaces pure paste minimum from P4.1). Returns terminals sorted
|
|
883
|
+
* by startedAt asc. Empty list = no PTY currently registered. */
|
|
884
|
+
async listTerminals(options: DaemonTerminalListOptions = {}): Promise<DaemonTerminalsResponse> {
|
|
885
|
+
// The endpoint's current rows are registry/agent summaries; legacy
|
|
886
|
+
// cmd, exitCode, and outputBytes fields are absent from this response.
|
|
887
|
+
const query = options.all === true && options.includeTest === true
|
|
888
|
+
? '?all=true&includeTest=true'
|
|
889
|
+
: '';
|
|
890
|
+
return this.fetchJson<DaemonTerminalsResponse>(`/v1/terminals${query}`);
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
/** Fetch the daemon's lineage groups for one selected PTY. */
|
|
894
|
+
async fetchTerminalLineage(key: string): Promise<DaemonTerminalLineageResponse> {
|
|
895
|
+
return this.fetchJson<DaemonTerminalLineageResponse>(`/v1/terminals/lineage?key=${encodeURIComponent(key)}`);
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
/** CV-3 P4.2 — fetch trailing N lines of a PTY's scrollback. Default
|
|
899
|
+
* lines = 50 (matches Showroom RFC v4 D14 frozen-snapshot default).
|
|
900
|
+
* Returns the raw concatenated text (last N lines joined by `\n`)
|
|
901
|
+
* along with metadata so callers can detect truncation. Throws when
|
|
902
|
+
* the id is unknown or `lines` is invalid (server-side 400/404). */
|
|
903
|
+
async fetchTerminalScrollback(
|
|
904
|
+
id: string,
|
|
905
|
+
lines: number = 50,
|
|
906
|
+
options: DaemonTerminalDetailOptions = {},
|
|
907
|
+
): Promise<{
|
|
908
|
+
id: string;
|
|
909
|
+
lines: number;
|
|
910
|
+
totalLines: number;
|
|
911
|
+
scrollback: string;
|
|
912
|
+
}> {
|
|
913
|
+
const safe = encodeURIComponent(id);
|
|
914
|
+
const query = new URLSearchParams({ lines: String(lines) });
|
|
915
|
+
if (options.sourceRoot) query.set('sourceRoot', options.sourceRoot);
|
|
916
|
+
return this.fetchJson(`/v1/terminals/${safe}/scrollback?${query}`);
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
/** 웹 터미널 실시간(`GET /v1/terminals/:id/stream` · SSE). 데몬이 가진 PTY 는 바이트, 남의 PTY 는 바뀐 화면만 온다.
|
|
920
|
+
* 연결이 안 되면(옛 데몬 404 · 네트워크) `onFail` — 호출자는 800ms 폴링으로 돌아간다. 반환값 = 끊기. */
|
|
921
|
+
streamTerminal(
|
|
922
|
+
id: string,
|
|
923
|
+
options: { sourceRoot?: string },
|
|
924
|
+
onEvent: (ev: import('./terminal-stream').TerminalStreamEvent) => void,
|
|
925
|
+
onFail: (reason: string) => void,
|
|
926
|
+
): () => void {
|
|
927
|
+
const ac = new AbortController();
|
|
928
|
+
const q = options.sourceRoot ? `?sourceRoot=${encodeURIComponent(options.sourceRoot)}` : '';
|
|
929
|
+
const url = this.url(`/v1/terminals/${encodeURIComponent(id)}/stream${q}`);
|
|
930
|
+
void (async () => {
|
|
931
|
+
try {
|
|
932
|
+
const res = await fetch(url, { method: 'GET', headers: { accept: 'text/event-stream', ...this.authHeaders() }, signal: ac.signal });
|
|
933
|
+
if (res.status === 401) reportAuthRequired('/v1/terminals/stream');
|
|
934
|
+
if (!res.ok || !res.body) { onFail(`stream ${res.status}`); return; }
|
|
935
|
+
const { parseTerminalSse } = await import('./terminal-stream');
|
|
936
|
+
const reader = res.body.getReader();
|
|
937
|
+
const dec = new TextDecoder();
|
|
938
|
+
let buf = '';
|
|
939
|
+
for (;;) {
|
|
940
|
+
const r = await reader.read();
|
|
941
|
+
if (r.done) break;
|
|
942
|
+
buf += dec.decode(r.value, { stream: true });
|
|
943
|
+
const parsed = parseTerminalSse(buf);
|
|
944
|
+
buf = parsed.rest;
|
|
945
|
+
for (const ev of parsed.events) onEvent(ev);
|
|
946
|
+
}
|
|
947
|
+
} catch (err) {
|
|
948
|
+
if (ac.signal.aborted) return;
|
|
949
|
+
onFail(err instanceof Error ? err.message : String(err));
|
|
950
|
+
}
|
|
951
|
+
})();
|
|
952
|
+
return () => { try { ac.abort(); } catch { /* swallow */ } };
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
async snapshotTerminal(id: string, options: { ansi: boolean; sourceRoot?: string }): Promise<DaemonTerminalSnapshotResult> {
|
|
956
|
+
return this.requestTerminalControl(id, { action: 'snapshot', ansi: options.ansi }, options);
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
async sendTerminalText(id: string, text: string, options: DaemonTerminalDetailOptions = {}): Promise<DaemonTerminalControlResult> {
|
|
960
|
+
return this.requestTerminalControl(id, { action: 'input-text', chars: text }, options);
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
async sendTerminalKey(id: string, key: string, options: DaemonTerminalDetailOptions = {}): Promise<DaemonTerminalControlResult> {
|
|
964
|
+
return this.requestTerminalControl(id, { action: 'input-key', chars: key }, options);
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
/** 사람이 takeover 한 PTY 에 마우스(1 기반 셀 · 서버가 SGR 로 인코딩 · 앱이 마우스 모드가 아니면 거절 — 🅢 #21609). */
|
|
968
|
+
async sendTerminalMouse(id: string, mouse: { x: number; y: number; kind: 'click' | 'scroll-up' | 'scroll-down'; button?: 'left' | 'middle' | 'right' }, options: DaemonTerminalDetailOptions = {}): Promise<DaemonTerminalControlResult> {
|
|
969
|
+
return this.requestTerminalControl(id, { action: 'input-mouse', ...mouse }, options);
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
/** Request ownership control for a PTY. The daemon's five outcomes remain
|
|
973
|
+
* distinct so callers can choose a different recovery path for each one. */
|
|
974
|
+
async controlTerminal(
|
|
975
|
+
id: string,
|
|
976
|
+
action: 'takeover' | 'release',
|
|
977
|
+
options: DaemonTerminalDetailOptions = {},
|
|
978
|
+
): Promise<DaemonTerminalControlResult> {
|
|
979
|
+
return this.requestTerminalControl(id, { action }, options);
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
private async requestTerminalControl(
|
|
983
|
+
id: string,
|
|
984
|
+
request: { action: 'takeover' | 'release' | 'snapshot' | 'input-text' | 'input-key' | 'input-mouse'; ansi?: boolean; chars?: string; x?: number; y?: number; kind?: string; button?: string },
|
|
985
|
+
options: DaemonTerminalDetailOptions = {},
|
|
986
|
+
): Promise<DaemonTerminalSnapshotResult> {
|
|
987
|
+
const expectedStatus: Record<DaemonTerminalControlResult['status'], number> = {
|
|
988
|
+
success: 200,
|
|
989
|
+
'unknown-pty': 404,
|
|
990
|
+
denied: 409,
|
|
991
|
+
failed: 502,
|
|
992
|
+
'owner-unreachable': 504,
|
|
993
|
+
};
|
|
994
|
+
const safe = encodeURIComponent(id);
|
|
995
|
+
const query = options.sourceRoot ? `?sourceRoot=${encodeURIComponent(options.sourceRoot)}` : '';
|
|
996
|
+
const res = await fetch(this.url(`/v1/terminals/${safe}/control${query}`), {
|
|
997
|
+
method: 'POST',
|
|
998
|
+
headers: { 'content-type': 'application/json', ...this.authHeaders() },
|
|
999
|
+
body: JSON.stringify(request),
|
|
1000
|
+
});
|
|
1001
|
+
if (res.status === 401) reportAuthRequired(`/v1/terminals/${safe}/control`);
|
|
1002
|
+
let body: unknown;
|
|
1003
|
+
try {
|
|
1004
|
+
body = await res.json();
|
|
1005
|
+
} catch {
|
|
1006
|
+
throw new Error(`terminal control ${res.status}: invalid JSON response`);
|
|
1007
|
+
}
|
|
1008
|
+
const status = body && typeof body === 'object'
|
|
1009
|
+
? (body as { status?: unknown }).status
|
|
1010
|
+
: undefined;
|
|
1011
|
+
const normalized = status === 'write-failed' ? 'failed' : status;
|
|
1012
|
+
if (
|
|
1013
|
+
(normalized !== 'success' && normalized !== 'unknown-pty' && normalized !== 'denied'
|
|
1014
|
+
&& normalized !== 'failed' && normalized !== 'owner-unreachable')
|
|
1015
|
+
|| res.status !== expectedStatus[normalized]
|
|
1016
|
+
) {
|
|
1017
|
+
const detail = body && typeof body === 'object'
|
|
1018
|
+
? ((body as { reason?: unknown; error?: unknown }).reason ?? (body as { error?: unknown }).error)
|
|
1019
|
+
: undefined;
|
|
1020
|
+
throw new Error(`terminal control ${res.status}: ${String(detail ?? 'unexpected response')}`);
|
|
1021
|
+
}
|
|
1022
|
+
const payload = body as { screen?: unknown; reason?: unknown };
|
|
1023
|
+
if (request.action === 'snapshot' && normalized === 'success' && typeof payload.screen !== 'string') {
|
|
1024
|
+
throw new Error(`terminal control ${res.status}: missing screen`);
|
|
1025
|
+
}
|
|
1026
|
+
return {
|
|
1027
|
+
status: normalized,
|
|
1028
|
+
...(typeof payload.reason === 'string' ? { reason: payload.reason } : {}),
|
|
1029
|
+
...(request.action === 'snapshot' && typeof payload.screen === 'string' ? { screen: payload.screen } : {}),
|
|
1030
|
+
};
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/** Rename a PTY while preserving the daemon's caller-visible outcome distinctions. */
|
|
1034
|
+
async renameTerminal(id: string, name: string): Promise<DaemonTerminalRenameResult> {
|
|
1035
|
+
const expectedStatus: Record<DaemonTerminalRenameResult['status'], number> = {
|
|
1036
|
+
success: 200,
|
|
1037
|
+
'invalid-name': 400,
|
|
1038
|
+
'unknown-pty': 404,
|
|
1039
|
+
denied: 409,
|
|
1040
|
+
failed: 502,
|
|
1041
|
+
'owner-unreachable': 504,
|
|
1042
|
+
};
|
|
1043
|
+
const safe = encodeURIComponent(id);
|
|
1044
|
+
const res = await fetch(this.url(`/v1/terminals/${safe}/rename`), {
|
|
1045
|
+
method: 'POST',
|
|
1046
|
+
headers: { 'content-type': 'application/json', ...this.authHeaders() },
|
|
1047
|
+
body: JSON.stringify({ name }),
|
|
1048
|
+
});
|
|
1049
|
+
if (res.status === 401) reportAuthRequired(`/v1/terminals/${safe}/rename`);
|
|
1050
|
+
let body: unknown;
|
|
1051
|
+
try {
|
|
1052
|
+
body = await res.json();
|
|
1053
|
+
} catch {
|
|
1054
|
+
throw new Error(`terminal rename ${res.status}: invalid JSON response`);
|
|
1055
|
+
}
|
|
1056
|
+
const result = body && typeof body === 'object' ? body as {
|
|
1057
|
+
status?: unknown;
|
|
1058
|
+
error?: unknown;
|
|
1059
|
+
id?: unknown;
|
|
1060
|
+
name?: unknown;
|
|
1061
|
+
reason?: unknown;
|
|
1062
|
+
} : {};
|
|
1063
|
+
const status = result.status === 'write-failed' ? 'failed'
|
|
1064
|
+
: result.status === 'unknown-pty' || result.status === 'denied'
|
|
1065
|
+
|| result.status === 'failed' || result.status === 'owner-unreachable'
|
|
1066
|
+
? result.status
|
|
1067
|
+
: result.status === 'success'
|
|
1068
|
+
? 'success'
|
|
1069
|
+
: result.error === 'invalid-name'
|
|
1070
|
+
? 'invalid-name'
|
|
1071
|
+
: undefined;
|
|
1072
|
+
if (
|
|
1073
|
+
status === undefined
|
|
1074
|
+
|| res.status !== expectedStatus[status]
|
|
1075
|
+
|| (status === 'success' && (typeof result.id !== 'string' || typeof result.name !== 'string'))
|
|
1076
|
+
) {
|
|
1077
|
+
throw new Error(`terminal rename ${res.status}: ${String(result.reason ?? result.error ?? 'unexpected response')}`);
|
|
1078
|
+
}
|
|
1079
|
+
return status === 'success'
|
|
1080
|
+
? { status, id: result.id as string, name: result.name as string }
|
|
1081
|
+
: { status };
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
/** Fetch a rendered terminal grid snapshot. `frameSource` stays open because
|
|
1085
|
+
* the daemon can introduce sources without a client release. */
|
|
1086
|
+
async fetchTerminalFrame(id: string, options: DaemonTerminalDetailOptions = {}): Promise<{
|
|
1087
|
+
id: string;
|
|
1088
|
+
frame: string;
|
|
1089
|
+
frameAt: number;
|
|
1090
|
+
frameSource: string;
|
|
1091
|
+
}> {
|
|
1092
|
+
const safe = encodeURIComponent(id);
|
|
1093
|
+
const query = options.sourceRoot ? `?sourceRoot=${encodeURIComponent(options.sourceRoot)}` : '';
|
|
1094
|
+
const response = await this.fetchJson<{
|
|
1095
|
+
id: string;
|
|
1096
|
+
frame: string;
|
|
1097
|
+
frameAt: number;
|
|
1098
|
+
frameSource: string;
|
|
1099
|
+
kind: string;
|
|
1100
|
+
instance: string;
|
|
1101
|
+
remote: boolean;
|
|
1102
|
+
}>(`/v1/terminals/${safe}/frame${query}`);
|
|
1103
|
+
return {
|
|
1104
|
+
id: response.id,
|
|
1105
|
+
frame: response.frame,
|
|
1106
|
+
frameAt: response.frameAt,
|
|
1107
|
+
frameSource: response.frameSource,
|
|
1108
|
+
};
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
/** CV-3 P5.x — create a new agent CLI session backed by a real
|
|
1112
|
+
* codex/claude/gemini sub-process via globalDualRoleManager.
|
|
1113
|
+
* Returns the namespaced sessionId Showroom uses for subsequent
|
|
1114
|
+
* prompt + cancel + close calls. cwd default = daemon's
|
|
1115
|
+
* process.cwd() (typically the monad-agent repo). */
|
|
1116
|
+
async createAgentCliSession(
|
|
1117
|
+
backend: 'codex-app-server' | 'claude' | 'gemini',
|
|
1118
|
+
cwd?: string,
|
|
1119
|
+
opts?: {
|
|
1120
|
+
/** Round 3 PR2 (β-2) — when 'off', append ?hitl=off so the
|
|
1121
|
+
* daemon skips wiring the global HITL approver chain for this
|
|
1122
|
+
* session. The Showroom toggle reads `localStorage` and the
|
|
1123
|
+
* caller forwards the flag. Default 'on' (legacy behaviour). */
|
|
1124
|
+
hitl?: 'on' | 'off';
|
|
1125
|
+
},
|
|
1126
|
+
): Promise<{
|
|
1127
|
+
sessionId: string;
|
|
1128
|
+
backendId: string;
|
|
1129
|
+
backendSessionId: string;
|
|
1130
|
+
cwd: string;
|
|
1131
|
+
createdAt: number;
|
|
1132
|
+
}> {
|
|
1133
|
+
const path = opts?.hitl === 'off'
|
|
1134
|
+
? '/v1/agent-cli/sessions?hitl=off'
|
|
1135
|
+
: '/v1/agent-cli/sessions';
|
|
1136
|
+
return this.fetchJson(path, {
|
|
1137
|
+
method: 'POST',
|
|
1138
|
+
headers: { 'content-type': 'application/json' },
|
|
1139
|
+
body: JSON.stringify({
|
|
1140
|
+
backend,
|
|
1141
|
+
...(cwd ? { cwd } : {}),
|
|
1142
|
+
}),
|
|
1143
|
+
});
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
/** CV-3 P5.x — stream agent CLI prompt response via SSE. Mirrors
|
|
1147
|
+
* promptStream's handler shape (onTextDelta · onStop · onError) so
|
|
1148
|
+
* callers can compose the same UI rendering pipeline.
|
|
1149
|
+
*
|
|
1150
|
+
* P5.x.+ (#1982) — `userContent` 으로 image/file 첨부 forward.
|
|
1151
|
+
* daemon 이 ContentBlock[] 으로 받아 CLI sub-process 에 ACP 형태
|
|
1152
|
+
* 로 전달. plain `message` 와 같이 사용 시 daemon 가 message 를
|
|
1153
|
+
* trailing text block 으로 append. */
|
|
1154
|
+
async agentCliPromptStream(
|
|
1155
|
+
req: {
|
|
1156
|
+
sessionId: string;
|
|
1157
|
+
message: string;
|
|
1158
|
+
userContent?: PromptUserContentBlock[];
|
|
1159
|
+
},
|
|
1160
|
+
handlers: {
|
|
1161
|
+
onTextDelta?: (evt: { delta: string; full: string }) => void;
|
|
1162
|
+
onStop?: (evt: { stopReason: string; sessionId: string }) => void;
|
|
1163
|
+
onError?: (evt: { error: string }) => void;
|
|
1164
|
+
/** P5.x.+ tool call viz (#1985) — fires for each tool_call /
|
|
1165
|
+
* tool_call_update SSE event. UI can collapse by toolCallId
|
|
1166
|
+
* for status lifecycle visualization (codex bash · file edit ·
|
|
1167
|
+
* MCP tool calls). */
|
|
1168
|
+
onToolCall?: (evt: {
|
|
1169
|
+
kind: 'tool_call' | 'tool_call_update';
|
|
1170
|
+
toolCallId?: string;
|
|
1171
|
+
title?: string;
|
|
1172
|
+
toolKind?: string;
|
|
1173
|
+
status?: string;
|
|
1174
|
+
contentText?: string;
|
|
1175
|
+
rawOutput?: unknown;
|
|
1176
|
+
resourceUri?: string;
|
|
1177
|
+
}) => void;
|
|
1178
|
+
/** P5.x.+ activity pill (#1985) — turn-level metrics emitted at
|
|
1179
|
+
* end of stream (turnDurationMs · toolCallCount · textBytes).
|
|
1180
|
+
* CLI cost is external to elanous so we surface activity rather
|
|
1181
|
+
* than $ — useful for "which agent is doing more work". */
|
|
1182
|
+
onUsage?: (evt: {
|
|
1183
|
+
turnDurationMs: number;
|
|
1184
|
+
toolCallCount: number;
|
|
1185
|
+
textBytes: number;
|
|
1186
|
+
}) => void;
|
|
1187
|
+
signal?: AbortSignal;
|
|
1188
|
+
} = {},
|
|
1189
|
+
): Promise<{ sessionId: string; text: string; stopReason: string }> {
|
|
1190
|
+
const initHeaders: Record<string, string> = {
|
|
1191
|
+
'content-type': 'application/json',
|
|
1192
|
+
...this.authHeaders(),
|
|
1193
|
+
};
|
|
1194
|
+
const init: RequestInit = {
|
|
1195
|
+
method: 'POST',
|
|
1196
|
+
headers: initHeaders,
|
|
1197
|
+
body: JSON.stringify(req),
|
|
1198
|
+
};
|
|
1199
|
+
if (handlers.signal) init.signal = handlers.signal;
|
|
1200
|
+
const res = await fetch(this.url('/v1/agent-cli/prompt'), init);
|
|
1201
|
+
if (res.status === 401) reportAuthRequired('/v1/agent-cli/prompt');
|
|
1202
|
+
if (!res.ok) {
|
|
1203
|
+
const detail = await res.text().catch(() => '');
|
|
1204
|
+
throw new Error(`agent-cli/prompt ${res.status}: ${detail}`);
|
|
1205
|
+
}
|
|
1206
|
+
if (!res.body) throw new Error('agent-cli/prompt: no body');
|
|
1207
|
+
const reader = res.body.getReader();
|
|
1208
|
+
const decoder = new TextDecoder();
|
|
1209
|
+
let buf = '';
|
|
1210
|
+
let full = '';
|
|
1211
|
+
let stopReason = 'end_turn';
|
|
1212
|
+
let sessionId = req.sessionId;
|
|
1213
|
+
let errored: string | null = null;
|
|
1214
|
+
// SSE parser — mirrors promptStream's logic but inlined here so
|
|
1215
|
+
// P5.x can ship without modifying the existing chat path.
|
|
1216
|
+
while (true) {
|
|
1217
|
+
const { value, done } = await reader.read();
|
|
1218
|
+
if (done) break;
|
|
1219
|
+
buf += decoder.decode(value, { stream: true });
|
|
1220
|
+
// Split events on `\n\n` boundary (one event = N `name: value\n` lines).
|
|
1221
|
+
let sepIdx = buf.indexOf('\n\n');
|
|
1222
|
+
while (sepIdx !== -1) {
|
|
1223
|
+
const eventBlock = buf.slice(0, sepIdx);
|
|
1224
|
+
buf = buf.slice(sepIdx + 2);
|
|
1225
|
+
const lines = eventBlock.split('\n');
|
|
1226
|
+
let event = 'message';
|
|
1227
|
+
const dataParts: string[] = [];
|
|
1228
|
+
for (const line of lines) {
|
|
1229
|
+
if (line.startsWith('event: ')) event = line.slice(7).trim();
|
|
1230
|
+
else if (line.startsWith('data: ')) dataParts.push(line.slice(6));
|
|
1231
|
+
}
|
|
1232
|
+
const dataStr = dataParts.join('\n');
|
|
1233
|
+
if (event === 'chunk') {
|
|
1234
|
+
try {
|
|
1235
|
+
const parsed = JSON.parse(dataStr) as { text?: string };
|
|
1236
|
+
if (typeof parsed.text === 'string') {
|
|
1237
|
+
full += parsed.text;
|
|
1238
|
+
handlers.onTextDelta?.({ delta: parsed.text, full });
|
|
1239
|
+
}
|
|
1240
|
+
} catch { /* skip malformed */ }
|
|
1241
|
+
} else if (event === 'stop') {
|
|
1242
|
+
try {
|
|
1243
|
+
const parsed = JSON.parse(dataStr) as {
|
|
1244
|
+
sessionId?: string;
|
|
1245
|
+
stopReason?: string;
|
|
1246
|
+
};
|
|
1247
|
+
if (parsed.stopReason) stopReason = parsed.stopReason;
|
|
1248
|
+
if (parsed.sessionId) sessionId = parsed.sessionId;
|
|
1249
|
+
handlers.onStop?.({ stopReason, sessionId });
|
|
1250
|
+
} catch { /* skip */ }
|
|
1251
|
+
} else if (event === 'tool_call' || event === 'tool_call_update') {
|
|
1252
|
+
try {
|
|
1253
|
+
const parsed = JSON.parse(dataStr) as {
|
|
1254
|
+
toolCallId?: string;
|
|
1255
|
+
title?: string;
|
|
1256
|
+
kind?: string;
|
|
1257
|
+
status?: string;
|
|
1258
|
+
contentText?: string;
|
|
1259
|
+
rawOutput?: unknown;
|
|
1260
|
+
};
|
|
1261
|
+
const rawOutput = parsed.rawOutput;
|
|
1262
|
+
const rawOutputObject = rawOutput !== null
|
|
1263
|
+
&& typeof rawOutput === 'object'
|
|
1264
|
+
&& !Array.isArray(rawOutput)
|
|
1265
|
+
? rawOutput as Record<string, unknown>
|
|
1266
|
+
: undefined;
|
|
1267
|
+
const meta = rawOutputObject?._meta;
|
|
1268
|
+
const metaUi = meta !== null && typeof meta === 'object' && !Array.isArray(meta)
|
|
1269
|
+
? (meta as Record<string, unknown>).ui
|
|
1270
|
+
: undefined;
|
|
1271
|
+
const nestedResourceUri = metaUi !== null && typeof metaUi === 'object' && !Array.isArray(metaUi)
|
|
1272
|
+
? (metaUi as Record<string, unknown>).resourceUri
|
|
1273
|
+
: undefined;
|
|
1274
|
+
const flatResourceUri = rawOutputObject?.['ui/resourceUri'];
|
|
1275
|
+
const resourceUri = typeof nestedResourceUri === 'string'
|
|
1276
|
+
? nestedResourceUri
|
|
1277
|
+
: typeof flatResourceUri === 'string'
|
|
1278
|
+
? flatResourceUri
|
|
1279
|
+
: undefined;
|
|
1280
|
+
handlers.onToolCall?.({
|
|
1281
|
+
kind: event,
|
|
1282
|
+
...(parsed.toolCallId ? { toolCallId: parsed.toolCallId } : {}),
|
|
1283
|
+
...(parsed.title ? { title: parsed.title } : {}),
|
|
1284
|
+
...(parsed.kind ? { toolKind: parsed.kind } : {}),
|
|
1285
|
+
...(parsed.status ? { status: parsed.status } : {}),
|
|
1286
|
+
...(parsed.contentText ? { contentText: parsed.contentText } : {}),
|
|
1287
|
+
...(rawOutput !== undefined ? { rawOutput } : {}),
|
|
1288
|
+
...(resourceUri !== undefined ? { resourceUri } : {}),
|
|
1289
|
+
});
|
|
1290
|
+
} catch { /* skip malformed */ }
|
|
1291
|
+
} else if (event === 'usage') {
|
|
1292
|
+
try {
|
|
1293
|
+
const parsed = JSON.parse(dataStr) as {
|
|
1294
|
+
turnDurationMs?: number;
|
|
1295
|
+
toolCallCount?: number;
|
|
1296
|
+
textBytes?: number;
|
|
1297
|
+
};
|
|
1298
|
+
if (
|
|
1299
|
+
typeof parsed.turnDurationMs === 'number'
|
|
1300
|
+
&& typeof parsed.toolCallCount === 'number'
|
|
1301
|
+
&& typeof parsed.textBytes === 'number'
|
|
1302
|
+
) {
|
|
1303
|
+
handlers.onUsage?.({
|
|
1304
|
+
turnDurationMs: parsed.turnDurationMs,
|
|
1305
|
+
toolCallCount: parsed.toolCallCount,
|
|
1306
|
+
textBytes: parsed.textBytes,
|
|
1307
|
+
});
|
|
1308
|
+
}
|
|
1309
|
+
} catch { /* skip */ }
|
|
1310
|
+
} else if (event === 'error') {
|
|
1311
|
+
try {
|
|
1312
|
+
const parsed = JSON.parse(dataStr) as { error?: string };
|
|
1313
|
+
errored = parsed.error ?? 'unknown';
|
|
1314
|
+
handlers.onError?.({ error: errored });
|
|
1315
|
+
} catch { errored = 'parse-error'; }
|
|
1316
|
+
}
|
|
1317
|
+
sepIdx = buf.indexOf('\n\n');
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
if (errored) throw new Error(errored);
|
|
1321
|
+
return { sessionId, text: full, stopReason };
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
/** CV-3 P5.x — cancel an in-flight agent CLI prompt. Best-effort —
|
|
1325
|
+
* underlying AcpAgent.cancel signals the sub-process; per-brand
|
|
1326
|
+
* semantics vary (codex SIGINT · claude/gemini may take a beat). */
|
|
1327
|
+
async cancelAgentCliSession(sessionId: string): Promise<{ ok: boolean }> {
|
|
1328
|
+
return this.fetchJson('/v1/agent-cli/cancel', {
|
|
1329
|
+
method: 'POST',
|
|
1330
|
+
headers: { 'content-type': 'application/json' },
|
|
1331
|
+
body: JSON.stringify({ sessionId }),
|
|
1332
|
+
});
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
/** CV-3 P5.x — close an agent CLI session. Releases the per-session
|
|
1336
|
+
* record · sub-process stays alive (managed by globalAcpAgentManager
|
|
1337
|
+
* for re-use). */
|
|
1338
|
+
async closeAgentCliSession(sessionId: string): Promise<{ ok: boolean }> {
|
|
1339
|
+
const safe = encodeURIComponent(sessionId);
|
|
1340
|
+
return this.fetchJson(`/v1/agent-cli/sessions/${safe}`, { method: 'DELETE' });
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
/** CV-3 FP-B — Showroom named layout daemon-side store (cross-device
|
|
1344
|
+
* sync · ~/.elanous/showroom-layouts.json). vision Q3: auto-migrate
|
|
1345
|
+
* on first daemon save · localStorage stays as cache fallback. */
|
|
1346
|
+
async listShowroomLayouts(): Promise<{
|
|
1347
|
+
layouts: Array<{
|
|
1348
|
+
name: string;
|
|
1349
|
+
savedAt: number;
|
|
1350
|
+
panels: Array<{
|
|
1351
|
+
id: string;
|
|
1352
|
+
kind: 'chat' | 'agent';
|
|
1353
|
+
provider: string;
|
|
1354
|
+
agentBrand?: 'codex' | 'claude' | 'gemini';
|
|
1355
|
+
state: 'live' | 'mute' | 'freeze';
|
|
1356
|
+
}>;
|
|
1357
|
+
layoutMode?: 'horizontal' | 'vertical';
|
|
1358
|
+
}>;
|
|
1359
|
+
}> {
|
|
1360
|
+
return this.fetchJson('/v1/showroom/layouts');
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
async getShowroomLayout(name: string): Promise<{
|
|
1364
|
+
layout: {
|
|
1365
|
+
name: string;
|
|
1366
|
+
savedAt: number;
|
|
1367
|
+
panels: Array<{
|
|
1368
|
+
id: string;
|
|
1369
|
+
kind: 'chat' | 'agent';
|
|
1370
|
+
provider: string;
|
|
1371
|
+
agentBrand?: 'codex' | 'claude' | 'gemini';
|
|
1372
|
+
state: 'live' | 'mute' | 'freeze';
|
|
1373
|
+
}>;
|
|
1374
|
+
layoutMode?: 'horizontal' | 'vertical';
|
|
1375
|
+
};
|
|
1376
|
+
}> {
|
|
1377
|
+
const safe = encodeURIComponent(name);
|
|
1378
|
+
return this.fetchJson(`/v1/showroom/layouts/${safe}`);
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
async saveShowroomLayout(
|
|
1382
|
+
name: string,
|
|
1383
|
+
layout: {
|
|
1384
|
+
savedAt?: number;
|
|
1385
|
+
panels: Array<{
|
|
1386
|
+
id: string;
|
|
1387
|
+
kind: 'chat' | 'agent';
|
|
1388
|
+
provider: string;
|
|
1389
|
+
agentBrand?: 'codex' | 'claude' | 'gemini';
|
|
1390
|
+
state: 'live' | 'mute' | 'freeze';
|
|
1391
|
+
}>;
|
|
1392
|
+
layoutMode?: 'horizontal' | 'vertical';
|
|
1393
|
+
},
|
|
1394
|
+
): Promise<{ ok: boolean; layout: unknown }> {
|
|
1395
|
+
const safe = encodeURIComponent(name);
|
|
1396
|
+
return this.fetchJson(`/v1/showroom/layouts/${safe}`, {
|
|
1397
|
+
method: 'PUT',
|
|
1398
|
+
headers: { 'content-type': 'application/json' },
|
|
1399
|
+
body: JSON.stringify(layout),
|
|
1400
|
+
});
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
async deleteShowroomLayout(name: string): Promise<{ ok: boolean; name: string }> {
|
|
1404
|
+
const safe = encodeURIComponent(name);
|
|
1405
|
+
return this.fetchJson(`/v1/showroom/layouts/${safe}`, { method: 'DELETE' });
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
/** §6.3 — fetch URL → text body via daemon (HTML strip · 50KB cap). */
|
|
1409
|
+
async fetchUrlContext(url: string): Promise<{
|
|
1410
|
+
ok: true;
|
|
1411
|
+
url: string;
|
|
1412
|
+
title?: string;
|
|
1413
|
+
text: string;
|
|
1414
|
+
bytes: number;
|
|
1415
|
+
}> {
|
|
1416
|
+
return this.fetchJson('/v1/context/fetch-url', {
|
|
1417
|
+
method: 'POST',
|
|
1418
|
+
headers: { 'content-type': 'application/json' },
|
|
1419
|
+
body: JSON.stringify({ url }),
|
|
1420
|
+
});
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
/** micro.3 (2026-05-09) — list deployed LLM models.
|
|
1424
|
+
* FU.A1 (2026-05-09 night) — multi-host fan-out (LM Studio · vLLM ·
|
|
1425
|
+
* Ollama). Each model carries `host` + `hostKind` so the dropdown
|
|
1426
|
+
* can group by host. The PWA Showroom header dropdown calls this so
|
|
1427
|
+
* users can pick a non-default model without DevTools editing.
|
|
1428
|
+
* Returns an empty array on transport failure (caller surfaces
|
|
1429
|
+
* the error state in the dropdown). */
|
|
1430
|
+
async listLlmModels(): Promise<{
|
|
1431
|
+
ok?: boolean;
|
|
1432
|
+
endpoint?: string;
|
|
1433
|
+
count?: number;
|
|
1434
|
+
models: Array<{ id: string; ownedBy?: string; host?: string; hostKind?: string }>;
|
|
1435
|
+
hosts?: Array<{
|
|
1436
|
+
name: string;
|
|
1437
|
+
kind: string;
|
|
1438
|
+
endpoint: string;
|
|
1439
|
+
count: number;
|
|
1440
|
+
error?: string;
|
|
1441
|
+
}>;
|
|
1442
|
+
error?: string;
|
|
1443
|
+
detail?: string;
|
|
1444
|
+
configWarning?: string;
|
|
1445
|
+
}> {
|
|
1446
|
+
const res = await fetch(this.url('/v1/llm/models'), {
|
|
1447
|
+
method: 'GET',
|
|
1448
|
+
headers: { ...this.authHeaders() },
|
|
1449
|
+
});
|
|
1450
|
+
if (res.status === 401) reportAuthRequired('/v1/llm/models');
|
|
1451
|
+
if (!res.ok) {
|
|
1452
|
+
return { models: [], error: `http-${res.status}` };
|
|
1453
|
+
}
|
|
1454
|
+
return (await res.json()) as Awaited<ReturnType<DaemonClient['listLlmModels']>>;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
/** §3.6 (2026-05-10) — multi-host hot-reload GUI consumer for FU.A3
|
|
1458
|
+
* endpoint (#2118). The Settings · LlmHostsCard renders the result,
|
|
1459
|
+
* letting users add/remove Anthropic/Gemini/vLLM/Ollama hosts at
|
|
1460
|
+
* runtime without editing `ELANOUS_LLM_HOSTS` JSON or restarting the
|
|
1461
|
+
* daemon. Override is in-memory only — env/legacy reverts on
|
|
1462
|
+
* restart (intentional · permanent change still goes via .zshrc). */
|
|
1463
|
+
async getLlmHosts(): Promise<LlmHostsResponse> {
|
|
1464
|
+
return this.fetchJson<LlmHostsResponse>('/v1/llm/hosts');
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
async setLlmHosts(hosts: LlmHostConfig[]): Promise<LlmHostsResponse> {
|
|
1468
|
+
return this.fetchJson<LlmHostsResponse>('/v1/llm/hosts', {
|
|
1469
|
+
method: 'PUT',
|
|
1470
|
+
headers: { 'content-type': 'application/json' },
|
|
1471
|
+
body: JSON.stringify(hosts),
|
|
1472
|
+
});
|
|
1473
|
+
}
|
|
1474
|
+
|
|
1475
|
+
async clearLlmHosts(): Promise<LlmHostsResponse & { cleared: boolean }> {
|
|
1476
|
+
return this.fetchJson<LlmHostsResponse & { cleared: boolean }>(
|
|
1477
|
+
'/v1/llm/hosts',
|
|
1478
|
+
{ method: 'DELETE' },
|
|
1479
|
+
);
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
/** R6 FU.2 · §6.3 audio bridge — POST audio file to daemon
|
|
1483
|
+
* `/v1/audio/stt` for transcription. Daemon picks the configured
|
|
1484
|
+
* STT provider (default OpenAI Whisper · same as elanous TUI). The
|
|
1485
|
+
* PWA's audio context source uses this to auto-fill the
|
|
1486
|
+
* transcript field on file pick.
|
|
1487
|
+
*
|
|
1488
|
+
* Throws on non-2xx; the caller (showroom/audio-stt-extract)
|
|
1489
|
+
* catches and falls back to the manual transcript prompt so the
|
|
1490
|
+
* flow is still usable when daemon STT is unavailable / unconfigured. */
|
|
1491
|
+
async transcribeAudio(file: File, language?: string): Promise<{
|
|
1492
|
+
text: string;
|
|
1493
|
+
language?: string;
|
|
1494
|
+
durationMs?: number;
|
|
1495
|
+
providerId?: string;
|
|
1496
|
+
}> {
|
|
1497
|
+
const form = new FormData();
|
|
1498
|
+
form.append('file', file, file.name);
|
|
1499
|
+
if (language) form.append('language', language);
|
|
1500
|
+
const res = await fetch(this.url('/v1/audio/stt'), {
|
|
1501
|
+
method: 'POST',
|
|
1502
|
+
headers: { ...this.authHeaders() },
|
|
1503
|
+
body: form,
|
|
1504
|
+
});
|
|
1505
|
+
if (res.status === 401) reportAuthRequired('/v1/audio/stt');
|
|
1506
|
+
if (!res.ok) {
|
|
1507
|
+
let detail = '';
|
|
1508
|
+
try { detail = await res.text(); } catch { /* ignore */ }
|
|
1509
|
+
throw new Error(`audio-stt http ${res.status}: ${detail.slice(0, 200)}`);
|
|
1510
|
+
}
|
|
1511
|
+
return (await res.json()) as Awaited<ReturnType<DaemonClient['transcribeAudio']>>;
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1514
|
+
/** R6 Task 5 · §6.1 LLM-judge — call the daemon's hybrid classifier.
|
|
1515
|
+
* PWA only invokes this when its own local keyword classifier
|
|
1516
|
+
* returned null AND the user has opted in to the local-llm
|
|
1517
|
+
* backend (default = keyword-only). Returns the role label or null
|
|
1518
|
+
* on judge fallback. The caller treats null as "broadcast". */
|
|
1519
|
+
async judgeRole(
|
|
1520
|
+
prompt: string,
|
|
1521
|
+
opts: { backend?: 'keyword' | 'local-llm'; model?: string } = {},
|
|
1522
|
+
): Promise<{
|
|
1523
|
+
role: 'plan' | 'exec' | 'review' | 'reflect' | null;
|
|
1524
|
+
source: 'keyword' | 'local-llm' | 'fallback';
|
|
1525
|
+
backend?: string;
|
|
1526
|
+
model?: string;
|
|
1527
|
+
llm?: { ok: boolean; latencyMs: number; reason?: string; detail?: string };
|
|
1528
|
+
}> {
|
|
1529
|
+
const body: { prompt: string; backend?: string; model?: string } = { prompt };
|
|
1530
|
+
if (opts.backend) body.backend = opts.backend;
|
|
1531
|
+
if (opts.model) body.model = opts.model;
|
|
1532
|
+
const res = await fetch(this.url('/v1/showroom/role-judge'), {
|
|
1533
|
+
method: 'POST',
|
|
1534
|
+
headers: { 'content-type': 'application/json', ...this.authHeaders() },
|
|
1535
|
+
body: JSON.stringify(body),
|
|
1536
|
+
});
|
|
1537
|
+
if (res.status === 401) reportAuthRequired('/v1/showroom/role-judge');
|
|
1538
|
+
if (!res.ok) {
|
|
1539
|
+
throw new Error(`role-judge http ${res.status}`);
|
|
1540
|
+
}
|
|
1541
|
+
return (await res.json()) as Awaited<ReturnType<DaemonClient['judgeRole']>>;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
/** R6 FU.3 (§6.5 sidebar SSE) — return the EventSource URL for the
|
|
1545
|
+
* showroom layouts change stream. Sidebar widget subscribes here
|
|
1546
|
+
* to refresh its list on cross-device save/delete. Null when the
|
|
1547
|
+
* daemon base URL hasn't been configured. */
|
|
1548
|
+
showroomLayoutsEventsUrl(): string | null {
|
|
1549
|
+
if (!this.cfg.baseUrl) return null;
|
|
1550
|
+
return this.url('/v1/showroom/layouts/events');
|
|
1551
|
+
}
|
|
1552
|
+
|
|
1553
|
+
/** R6 Task 3 (§6.4 SSE) — return the EventSource URL for the persona
|
|
1554
|
+
* registry's reload-event stream. Caller (`use-personas` hook)
|
|
1555
|
+
* passes this to `new EventSource(...)` to subscribe; null when the
|
|
1556
|
+
* daemon base URL hasn't been configured yet. */
|
|
1557
|
+
personasEventsUrl(): string | null {
|
|
1558
|
+
if (!this.cfg.baseUrl) return null;
|
|
1559
|
+
return this.url('/v1/personas/events');
|
|
1560
|
+
}
|
|
1561
|
+
|
|
1562
|
+
/** 라이브 세션 SSE(S3a) — on-disk 세션 생성/갱신 push. topics=session. 로
|
|
1563
|
+
* session.created / session.updated 만 수신(session-decision 은 제외). */
|
|
1564
|
+
sessionStoreEventsUrl(): string | null {
|
|
1565
|
+
if (!this.cfg.baseUrl) return null;
|
|
1566
|
+
return `${this.url('/v1/events')}?topics=session.`;
|
|
1567
|
+
}
|
|
1568
|
+
|
|
1569
|
+
/** Fetch a bounded page of unified-log rows, optionally filtered by event. */
|
|
1570
|
+
async listLogs(params: Record<string, string> = {}): Promise<DaemonLogsResponse> {
|
|
1571
|
+
const qs = new URLSearchParams(params).toString();
|
|
1572
|
+
return this.fetchJson<DaemonLogsResponse>(`/v1/logs${qs ? `?${qs}` : ''}`);
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
/** Fetch the progress frames emitted by a headless self-implement PTY. */
|
|
1576
|
+
async listProgressFrames(limit: number = 200): Promise<DaemonLogsResponse> {
|
|
1577
|
+
return this.listLogs({ event: 'headless.progress-frame', limit: String(limit) });
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
/** 통합 로그 패브릭 SSE tail (LF4) — /v1/logs/stream 에 서버측 필터를
|
|
1581
|
+
* 쿼리로 실어 연결. EventSource 는 헤더 불가 → same-origin auth 통과
|
|
1582
|
+
* (sessionStoreEventsUrl 동형). */
|
|
1583
|
+
logsStreamUrl(params: Record<string, string> = {}): string | null {
|
|
1584
|
+
if (!this.cfg.baseUrl) return null;
|
|
1585
|
+
const qs = new URLSearchParams(params).toString();
|
|
1586
|
+
return `${this.url('/v1/logs/stream')}${qs ? `?${qs}` : ''}`;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
/** §6.4 — list loaded personas (read-only · disk yaml authoritative).
|
|
1590
|
+
* Mirrors `src/nexus/api/personas.ts` PersonaWire shape. PWA Showroom
|
|
1591
|
+
* consumes for the per-panel persona picker. */
|
|
1592
|
+
async listPersonas(): Promise<{
|
|
1593
|
+
personas: Array<{
|
|
1594
|
+
personaId: string;
|
|
1595
|
+
displayName: string;
|
|
1596
|
+
description?: string;
|
|
1597
|
+
brand?: string;
|
|
1598
|
+
primaryModel?: string;
|
|
1599
|
+
systemPrompt?: string;
|
|
1600
|
+
avatarUrl?: string;
|
|
1601
|
+
brandColor?: string;
|
|
1602
|
+
mentionPatterns?: readonly string[];
|
|
1603
|
+
}>;
|
|
1604
|
+
count: number;
|
|
1605
|
+
}> {
|
|
1606
|
+
return this.fetchJson('/v1/personas');
|
|
1607
|
+
}
|
|
1608
|
+
|
|
1609
|
+
/** RFC #2161 Phase 3 — Layer A static catalog snapshot. Used by the
|
|
1610
|
+
* Showroom dropdown to drive provider options off the registry
|
|
1611
|
+
* source-of-truth. Phase 5 sibling endpoint `/v1/registry/resolved`
|
|
1612
|
+
* layers live (apiKey + health) state on top. */
|
|
1613
|
+
async getRegistryCatalog(): Promise<{
|
|
1614
|
+
catalogVersion: number;
|
|
1615
|
+
providers: Array<{
|
|
1616
|
+
id: string;
|
|
1617
|
+
displayName: string;
|
|
1618
|
+
aliases: string[];
|
|
1619
|
+
modelPrefixes: string[];
|
|
1620
|
+
apiKeyEnv: string;
|
|
1621
|
+
endpointPattern: string;
|
|
1622
|
+
defaultStreaming: 'sse' | 'ws' | 'polling';
|
|
1623
|
+
toolCallingFormat:
|
|
1624
|
+
| 'native-anthropic'
|
|
1625
|
+
| 'native-openai'
|
|
1626
|
+
| 'native-gemini'
|
|
1627
|
+
| 'none';
|
|
1628
|
+
capabilities: Record<string, boolean>;
|
|
1629
|
+
builtIn: boolean;
|
|
1630
|
+
}>;
|
|
1631
|
+
models: Array<{
|
|
1632
|
+
id: string;
|
|
1633
|
+
provider: string;
|
|
1634
|
+
displayName: string;
|
|
1635
|
+
family?: string;
|
|
1636
|
+
familyShortcut?: string;
|
|
1637
|
+
contextSize?: number;
|
|
1638
|
+
outputMaxTokens?: number;
|
|
1639
|
+
vision?: 'images' | 'video' | 'pdf' | null;
|
|
1640
|
+
reasoning?: 'off' | 'low' | 'medium' | 'high' | null;
|
|
1641
|
+
toolCalling?:
|
|
1642
|
+
| 'native-anthropic'
|
|
1643
|
+
| 'native-openai'
|
|
1644
|
+
| 'native-gemini'
|
|
1645
|
+
| 'none';
|
|
1646
|
+
pricing?: {
|
|
1647
|
+
inputPerMTok: number;
|
|
1648
|
+
outputPerMTok: number;
|
|
1649
|
+
cachedInputPerMTok?: number;
|
|
1650
|
+
};
|
|
1651
|
+
deprecated?: string | null;
|
|
1652
|
+
releaseDate?: string;
|
|
1653
|
+
kind?: 'chat' | 'embedding' | 'image' | 'audio';
|
|
1654
|
+
}>;
|
|
1655
|
+
patterns: Array<{
|
|
1656
|
+
provider: string;
|
|
1657
|
+
prefixes: Array<{ prefix: string; fallback: Record<string, unknown> }>;
|
|
1658
|
+
}>;
|
|
1659
|
+
manifest: {
|
|
1660
|
+
builtinSource: string;
|
|
1661
|
+
globalSource: string;
|
|
1662
|
+
fileCount: number;
|
|
1663
|
+
loadedAt: string;
|
|
1664
|
+
};
|
|
1665
|
+
}> {
|
|
1666
|
+
return this.fetchJson('/v1/registry/catalog');
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1669
|
+
// --- internals ------------------------------------------------------
|
|
1670
|
+
|
|
1671
|
+
private url(path: string): string {
|
|
1672
|
+
const base = this.cfg.baseUrl.replace(/\/$/, '');
|
|
1673
|
+
return `${base}${path}`;
|
|
1674
|
+
}
|
|
1675
|
+
|
|
1676
|
+
private authHeaders(): Record<string, string> {
|
|
1677
|
+
return this.cfg.token ? { authorization: `Bearer ${this.cfg.token}` } : {};
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
/** WebSocket error 의 사람 말 — 사유가 없는 이벤트에서 «언제·어디»만 적는다(토큰은 서브프로토콜이라 URL 에 없다). */
|
|
1682
|
+
export function describeSocketError(readyState: number, url: string): string {
|
|
1683
|
+
let host = 'unknown-host';
|
|
1684
|
+
try { host = new URL(url).host; } catch { /* 모르면 모른다 */ }
|
|
1685
|
+
return readyState === 0
|
|
1686
|
+
? `socket error before open — daemon unreachable or refused (${host})`
|
|
1687
|
+
: `socket error while open — connection dropped (${host})`;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1690
|
+
class AcpConnectionImpl implements AcpConnection {
|
|
1691
|
+
private ws: WebSocket;
|
|
1692
|
+
private nextId = 1;
|
|
1693
|
+
private pending = new Map<string | number, { resolve: (v: unknown) => void; reject: (e: unknown) => void }>();
|
|
1694
|
+
private kindHandlers = new Map<string, Set<AcpFrameHandler>>();
|
|
1695
|
+
private anyHandlers = new Set<AcpFrameHandler>();
|
|
1696
|
+
/** Inbound JSON-RPC request handlers keyed by method and registration
|
|
1697
|
+
* token. A shared core serves many consumer leases, so a lease disposer
|
|
1698
|
+
* must remove only the handler it registered. */
|
|
1699
|
+
private requestHandlers = new Map<string, Map<symbol, AcpRequestHandler>>();
|
|
1700
|
+
private readyPromise: Promise<string>;
|
|
1701
|
+
private readonly sessionHandlers = new Set<(id: string) => void>();
|
|
1702
|
+
private readonly stateHandlers = new Set<AcpStateHandler>();
|
|
1703
|
+
private leases = 0;
|
|
1704
|
+
private stateValue: AcpConnectionState = 'CONNECTING';
|
|
1705
|
+
private stateError?: Error;
|
|
1706
|
+
/** True only after initialize plus session/load or session/new succeeds. */
|
|
1707
|
+
private handshakeComplete = false;
|
|
1708
|
+
private terminalNotified = false;
|
|
1709
|
+
private readonly onTerminal?: () => void;
|
|
1710
|
+
|
|
1711
|
+
get ready(): Promise<string> {
|
|
1712
|
+
return this.readyPromise;
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
constructor(url: string, token: string, sessionId?: string, onTerminal?: () => void) {
|
|
1716
|
+
const wsUrl = sessionId ? `${url}?session=${encodeURIComponent(sessionId)}` : url;
|
|
1717
|
+
debugLog('webterm.acp.connect', { url: wsUrl, hasToken: !!token, sessionId });
|
|
1718
|
+
// Browser WebSocket can't send custom headers — bearer goes via subprotocol.
|
|
1719
|
+
this.ws = token
|
|
1720
|
+
? new WebSocket(wsUrl, [`bearer.${token}`])
|
|
1721
|
+
: new WebSocket(wsUrl);
|
|
1722
|
+
this.onTerminal = onTerminal;
|
|
1723
|
+
// daemon-public-server's wireAcpForSocket sends Uint8Array via
|
|
1724
|
+
// ws.send — PWA must request ArrayBuffer (default is Blob, which
|
|
1725
|
+
// is async-only and would silently drop synchronous JSON.parse).
|
|
1726
|
+
this.ws.binaryType = 'arraybuffer';
|
|
1727
|
+
this.ws.addEventListener('message', (ev) => this.onMessage(ev));
|
|
1728
|
+
this.ws.addEventListener('error', () => {
|
|
1729
|
+
// 브라우저 WebSocket 의 error 이벤트는 사유를 싣지 않는다 — `String(ev)` 는 늘 «[object Event]» 였다(09-28 · 3시간 36줄).
|
|
1730
|
+
// ⇒ 무엇을 가를 수 있는지만 적는다: «열기 전»(데몬에 못 닿음·거절) ↔ «연 뒤»(도중 끊김) ⊕ 어느 호스트.
|
|
1731
|
+
const error = new Error(describeSocketError(this.ws.readyState, wsUrl));
|
|
1732
|
+
this.fail(error);
|
|
1733
|
+
// An error need not be followed promptly by close. Request transport
|
|
1734
|
+
// shutdown after rejecting readiness and all in-flight RPCs now.
|
|
1735
|
+
if (this.ws.readyState === WebSocket.CONNECTING || this.ws.readyState === WebSocket.OPEN) {
|
|
1736
|
+
this.ws.close();
|
|
1737
|
+
}
|
|
1738
|
+
debugLog('webterm.acp.error', { reason: error.message });
|
|
1739
|
+
});
|
|
1740
|
+
this.ws.addEventListener('close', (ev) => {
|
|
1741
|
+
const closeDetail = ev.reason ? `: ${ev.reason}` : '';
|
|
1742
|
+
const error = this.stateError ?? new Error(`socket closed: ${ev.code}${closeDetail}`);
|
|
1743
|
+
this.terminate(error, this.handshakeComplete ? 'CLOSED' : 'FAILED');
|
|
1744
|
+
debugLog('webterm.acp.close', { code: ev.code, reason: ev.reason, handshakeComplete: this.handshakeComplete });
|
|
1745
|
+
});
|
|
1746
|
+
// WT-S-1.5 — auto ACP handshake on open. Sends `initialize` then
|
|
1747
|
+
// `session/new` with elanous term/ui caps declared, so daemon
|
|
1748
|
+
// broadcasts (terminalOutput envelope etc.) reach this peer.
|
|
1749
|
+
this.readyPromise = (async () => {
|
|
1750
|
+
await this.waitOpen();
|
|
1751
|
+
const initRes = await this.sendRaw('initialize', {
|
|
1752
|
+
protocolVersion: 1,
|
|
1753
|
+
clientCapabilities: {
|
|
1754
|
+
fs: { readTextFile: false, writeTextFile: false },
|
|
1755
|
+
terminal: false,
|
|
1756
|
+
_meta: {
|
|
1757
|
+
elanous: {
|
|
1758
|
+
ui: { showModal: true, showToast: true, updateStatusPill: true, usage: false },
|
|
1759
|
+
term: { terminalOutput: true, terminalExit: true, terminalFrame: true },
|
|
1760
|
+
// M4 of PLAN-ask-user-question-cross-surface-2026-05-13 —
|
|
1761
|
+
// PWA renders the native AskUserQuestion modal (shadcn
|
|
1762
|
+
// Dialog). Daemon's `dispatchAskUserQuestion` resolver
|
|
1763
|
+
// path will push via SDK `extMethod('elanous/ask/request',
|
|
1764
|
+
// …)` to peers that advertise this cap.
|
|
1765
|
+
ask: { askUserQuestion: true },
|
|
1766
|
+
},
|
|
1767
|
+
},
|
|
1768
|
+
},
|
|
1769
|
+
});
|
|
1770
|
+
debugLog('webterm.acp.initialize.done', { res: initRes });
|
|
1771
|
+
// Multi-surface entry (CV-1 Phase E follow-up · 2026-05-07) —
|
|
1772
|
+
// if the caller passed a hint sessionId (URL ?session= /
|
|
1773
|
+
// localStorage), try `session/load` first so this peer joins
|
|
1774
|
+
// the existing fan-out set on the server. `session/new` always
|
|
1775
|
+
// mints a fresh id, which forks every new tab into its own
|
|
1776
|
+
// session — the symptom that hid cross-surface streaming. On
|
|
1777
|
+
// "unknown session" we transparently fall back so a stale hint
|
|
1778
|
+
// (server restart cleared the session) still bootstraps.
|
|
1779
|
+
let sid = '';
|
|
1780
|
+
if (sessionId) {
|
|
1781
|
+
try {
|
|
1782
|
+
await this.sendRaw('session/load', {
|
|
1783
|
+
sessionId,
|
|
1784
|
+
cwd: '/',
|
|
1785
|
+
mcpServers: [],
|
|
1786
|
+
});
|
|
1787
|
+
sid = sessionId;
|
|
1788
|
+
debugLog('webterm.acp.session-load.done', { sessionId: sid });
|
|
1789
|
+
} catch (e) {
|
|
1790
|
+
debugLog('webterm.acp.session-load.miss', {
|
|
1791
|
+
sessionId,
|
|
1792
|
+
reason: String(e),
|
|
1793
|
+
});
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
if (!sid) {
|
|
1797
|
+
const newRes = await this.sendRaw('session/new', {
|
|
1798
|
+
cwd: '/',
|
|
1799
|
+
mcpServers: [],
|
|
1800
|
+
});
|
|
1801
|
+
sid = (newRes as { sessionId?: string } | null)?.sessionId ?? '';
|
|
1802
|
+
debugLog('webterm.acp.session-new.done', { sessionId: sid });
|
|
1803
|
+
}
|
|
1804
|
+
if (sid) this.sessionHandlers.forEach((handler) => { try { handler(sid); } catch { /* consumer callback isolation */ } });
|
|
1805
|
+
this.handshakeComplete = true;
|
|
1806
|
+
return sid;
|
|
1807
|
+
})().catch((cause) => {
|
|
1808
|
+
const error = cause instanceof Error ? cause : new Error(String(cause));
|
|
1809
|
+
this.fail(error);
|
|
1810
|
+
debugLog('webterm.acp.handshake-failed', { reason: error.message });
|
|
1811
|
+
// `ready` stays safe for existing fire-and-forget consumers; `state`
|
|
1812
|
+
// and the send gate retain the failure instead of silently continuing.
|
|
1813
|
+
return '';
|
|
1814
|
+
});
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
private sendRaw(method: string, params: unknown): Promise<unknown> {
|
|
1818
|
+
if (this.stateValue === 'FAILED' || this.stateValue === 'CLOSED' || this.ws.readyState !== WebSocket.OPEN) {
|
|
1819
|
+
return Promise.reject(this.stateError ?? new Error(`socket is ${this.stateValue}`));
|
|
1820
|
+
}
|
|
1821
|
+
const id = this.nextId++;
|
|
1822
|
+
const frame: AcpFrame = { jsonrpc: '2.0', id, method, params };
|
|
1823
|
+
debugLog('webterm.acp.send', { method, id });
|
|
1824
|
+
return new Promise((resolve, reject) => {
|
|
1825
|
+
this.pending.set(id, { resolve, reject });
|
|
1826
|
+
// ndjson framing — daemon-side ndJsonStream parses by '\n'.
|
|
1827
|
+
// Without the terminator, the server-side parser holds the frame
|
|
1828
|
+
// in its buffer indefinitely (no handler dispatch, no response).
|
|
1829
|
+
try { this.ws.send(JSON.stringify(frame) + '\n'); } catch (e) {
|
|
1830
|
+
this.pending.delete(id);
|
|
1831
|
+
reject(e);
|
|
1832
|
+
this.closeIfUnused();
|
|
1833
|
+
}
|
|
1834
|
+
});
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
get readyState(): number {
|
|
1838
|
+
return this.ws.readyState;
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
get state(): AcpConnectionState {
|
|
1842
|
+
return this.stateValue;
|
|
1843
|
+
}
|
|
1844
|
+
|
|
1845
|
+
get isTerminal(): boolean {
|
|
1846
|
+
return this.stateValue === 'FAILED' || this.stateValue === 'CLOSED';
|
|
1847
|
+
}
|
|
1848
|
+
|
|
1849
|
+
acquire(onSession?: (id: string) => void): AcpConnection {
|
|
1850
|
+
this.leases += 1;
|
|
1851
|
+
return new AcpConnectionLease(this, onSession);
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
subscribeSession(handler: (id: string) => void): () => void {
|
|
1855
|
+
this.sessionHandlers.add(handler);
|
|
1856
|
+
return () => this.sessionHandlers.delete(handler);
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
release(): void {
|
|
1860
|
+
this.leases = Math.max(0, this.leases - 1);
|
|
1861
|
+
if (this.leases !== 0) return;
|
|
1862
|
+
if (this.pending.size > 0) {
|
|
1863
|
+
debugLog('webterm.acp.release-deferred', { pending: this.pending.size });
|
|
1864
|
+
return;
|
|
1865
|
+
}
|
|
1866
|
+
this.closeIfUnused();
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
private closeIfUnused(): void {
|
|
1870
|
+
if (this.leases === 0 && this.pending.size === 0 && !this.isTerminal) {
|
|
1871
|
+
this.dispose(new Error('ACP transport released'));
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
dispose(error: Error = new Error('ACP transport disposed')): void {
|
|
1876
|
+
// Remove this exact core before close enters the browser's asynchronous
|
|
1877
|
+
// CLOSING state. A StrictMode remount must acquire a fresh transport,
|
|
1878
|
+
// while a late close from this core cannot erase that replacement.
|
|
1879
|
+
if (this.stateValue !== 'CLOSED') this.transition('CLOSED', error);
|
|
1880
|
+
this.rejectPending(error);
|
|
1881
|
+
this.notifyTerminal();
|
|
1882
|
+
if (this.ws.readyState !== WebSocket.CLOSED && this.ws.readyState !== WebSocket.CLOSING) {
|
|
1883
|
+
this.ws.close();
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
onState(cb: AcpStateHandler): () => void {
|
|
1888
|
+
this.stateHandlers.add(cb);
|
|
1889
|
+
this.notifyStateHandler(cb, this.stateValue, this.stateError);
|
|
1890
|
+
return () => this.stateHandlers.delete(cb);
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
private transition(state: AcpConnectionState, error?: Error): void {
|
|
1894
|
+
if (this.stateValue === state && this.stateError === error) return;
|
|
1895
|
+
this.stateValue = state;
|
|
1896
|
+
if (error) this.stateError = error;
|
|
1897
|
+
// A display subscriber is untrusted consumer code. Its failure must not
|
|
1898
|
+
// interrupt the core's terminal cleanup or prevent other leases learning
|
|
1899
|
+
// that their shared transport ended.
|
|
1900
|
+
this.stateHandlers.forEach((handler) => this.notifyStateHandler(handler, state, error));
|
|
1901
|
+
debugLog('webterm.acp.state', { state, reason: error?.message });
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
private notifyStateHandler(handler: AcpStateHandler, state: AcpConnectionState, error?: Error): void {
|
|
1905
|
+
try {
|
|
1906
|
+
handler(state, error);
|
|
1907
|
+
} catch (cause) {
|
|
1908
|
+
debugLog('webterm.acp.state-handler.error', { state, reason: String(cause) });
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
private rejectPending(error: Error): void {
|
|
1913
|
+
this.pending.forEach((pending) => pending.reject(error));
|
|
1914
|
+
this.pending.clear();
|
|
1915
|
+
}
|
|
1916
|
+
|
|
1917
|
+
private notifyTerminal(): void {
|
|
1918
|
+
if (this.terminalNotified) return;
|
|
1919
|
+
this.terminalNotified = true;
|
|
1920
|
+
this.onTerminal?.();
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
private terminate(error: Error, state: 'FAILED' | 'CLOSED'): void {
|
|
1924
|
+
// The first terminal transition wins. Before handshake completion, any
|
|
1925
|
+
// WebSocket close is a connection failure; after it, close is observable
|
|
1926
|
+
// as a normal ended connection. This prevents close/error ordering from
|
|
1927
|
+
// changing the UI outcome.
|
|
1928
|
+
if (!this.isTerminal) this.transition(state, error);
|
|
1929
|
+
this.rejectPending(error);
|
|
1930
|
+
this.notifyTerminal();
|
|
1931
|
+
}
|
|
1932
|
+
|
|
1933
|
+
private fail(error: Error): void {
|
|
1934
|
+
this.terminate(error, 'FAILED');
|
|
1935
|
+
// JSON-RPC handshake rejections do not necessarily emit a browser error
|
|
1936
|
+
// or close event. Close the live transport here so a FAILED core cannot
|
|
1937
|
+
// remain cached forever after its final lease is released.
|
|
1938
|
+
if (this.ws.readyState === WebSocket.CONNECTING || this.ws.readyState === WebSocket.OPEN) {
|
|
1939
|
+
this.ws.close();
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
|
|
1943
|
+
async send(method: string, params: unknown): Promise<unknown> {
|
|
1944
|
+
// WT-S-1.5 — public sends wait for handshake. Internal handshake
|
|
1945
|
+
// sends use sendRaw to avoid recursion.
|
|
1946
|
+
await this.readyPromise.catch(() => undefined);
|
|
1947
|
+
return this.sendRaw(method, params);
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
on(kind: NonNullable<AcpFrame['kind']>, cb: AcpFrameHandler): () => void {
|
|
1951
|
+
let set = this.kindHandlers.get(kind);
|
|
1952
|
+
if (!set) {
|
|
1953
|
+
set = new Set();
|
|
1954
|
+
this.kindHandlers.set(kind, set);
|
|
1955
|
+
}
|
|
1956
|
+
set.add(cb);
|
|
1957
|
+
return () => set!.delete(cb);
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
onAny(cb: AcpFrameHandler): () => void {
|
|
1961
|
+
this.anyHandlers.add(cb);
|
|
1962
|
+
return () => this.anyHandlers.delete(cb);
|
|
1963
|
+
}
|
|
1964
|
+
|
|
1965
|
+
onRequest(method: string, handler: AcpRequestHandler): () => void {
|
|
1966
|
+
const token = Symbol(method);
|
|
1967
|
+
let handlers = this.requestHandlers.get(method);
|
|
1968
|
+
if (!handlers) {
|
|
1969
|
+
handlers = new Map();
|
|
1970
|
+
this.requestHandlers.set(method, handlers);
|
|
1971
|
+
}
|
|
1972
|
+
handlers.set(token, handler);
|
|
1973
|
+
return () => {
|
|
1974
|
+
const current = this.requestHandlers.get(method);
|
|
1975
|
+
if (!current) return;
|
|
1976
|
+
current.delete(token);
|
|
1977
|
+
if (current.size === 0) this.requestHandlers.delete(method);
|
|
1978
|
+
};
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
close(): void {
|
|
1982
|
+
this.release();
|
|
1983
|
+
}
|
|
1984
|
+
|
|
1985
|
+
/** Invoke the latest active lease-local handler for an inbound request.
|
|
1986
|
+
* ACP permits one response per request, so this preserves the prior
|
|
1987
|
+
* last-write-wins handler contract without duplicating user side effects. */
|
|
1988
|
+
private async handleInboundRequest(
|
|
1989
|
+
id: string | number,
|
|
1990
|
+
method: string,
|
|
1991
|
+
params: unknown,
|
|
1992
|
+
handler: AcpRequestHandler,
|
|
1993
|
+
): Promise<void> {
|
|
1994
|
+
debugLog('webterm.acp.request.in', { method, id });
|
|
1995
|
+
try {
|
|
1996
|
+
const result = await handler(params);
|
|
1997
|
+
this.sendResponse({ jsonrpc: '2.0', id, result }, method);
|
|
1998
|
+
} catch (err) {
|
|
1999
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
2000
|
+
this.sendResponse({ jsonrpc: '2.0', id, error: { code: -32603, message: `internal error: ${msg}` } }, method);
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
private sendErrorResponse(id: string | number, code: number, message: string): void {
|
|
2005
|
+
this.sendResponse({ jsonrpc: '2.0', id, error: { code, message } }, 'error-response');
|
|
2006
|
+
}
|
|
2007
|
+
|
|
2008
|
+
/** Inbound RPC replies bypass `sendRaw`, but use the same final OPEN gate:
|
|
2009
|
+
* responder work may settle after an error/close event changed the core. */
|
|
2010
|
+
private sendResponse(frame: AcpFrame, method: string): void {
|
|
2011
|
+
if (this.stateValue !== 'OPEN' || this.ws.readyState !== WebSocket.OPEN) {
|
|
2012
|
+
debugLog('webterm.acp.request.response.drop', { method, id: frame.id, state: this.stateValue });
|
|
2013
|
+
return;
|
|
2014
|
+
}
|
|
2015
|
+
try {
|
|
2016
|
+
this.ws.send(JSON.stringify(frame) + '\n');
|
|
2017
|
+
} catch (err) {
|
|
2018
|
+
debugLog('webterm.acp.request.response.fail', { method, id: frame.id, reason: String(err) });
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
private async waitOpen(): Promise<void> {
|
|
2023
|
+
if (this.ws.readyState === WebSocket.OPEN) return;
|
|
2024
|
+
if (this.ws.readyState === WebSocket.CLOSED || this.ws.readyState === WebSocket.CLOSING) {
|
|
2025
|
+
throw new Error('socket already closed');
|
|
2026
|
+
}
|
|
2027
|
+
await new Promise<void>((resolve, reject) => {
|
|
2028
|
+
const onOpen = (): void => {
|
|
2029
|
+
cleanup();
|
|
2030
|
+
this.transition('OPEN');
|
|
2031
|
+
resolve();
|
|
2032
|
+
};
|
|
2033
|
+
const onErr = (): void => {
|
|
2034
|
+
cleanup();
|
|
2035
|
+
reject(new Error('socket open failed'));
|
|
2036
|
+
};
|
|
2037
|
+
const onClose = (): void => {
|
|
2038
|
+
cleanup();
|
|
2039
|
+
reject(new Error('socket closed before open'));
|
|
2040
|
+
};
|
|
2041
|
+
const cleanup = (): void => {
|
|
2042
|
+
this.ws.removeEventListener('open', onOpen);
|
|
2043
|
+
this.ws.removeEventListener('error', onErr);
|
|
2044
|
+
this.ws.removeEventListener('close', onClose);
|
|
2045
|
+
};
|
|
2046
|
+
this.ws.addEventListener('open', onOpen);
|
|
2047
|
+
this.ws.addEventListener('error', onErr);
|
|
2048
|
+
this.ws.addEventListener('close', onClose);
|
|
2049
|
+
});
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
private onMessage(ev: MessageEvent): void {
|
|
2053
|
+
// Decode regardless of whether the server sent string or binary —
|
|
2054
|
+
// daemon-public-server pushes Uint8Array via ws.send, while a
|
|
2055
|
+
// legacy string-mode path may exist on other transports. Without
|
|
2056
|
+
// this, binary frames silently fall through to an empty-object
|
|
2057
|
+
// parse, dropping every JSON-RPC response and hanging the
|
|
2058
|
+
// handshake.
|
|
2059
|
+
let text: string;
|
|
2060
|
+
const data: unknown = ev.data;
|
|
2061
|
+
if (typeof data === 'string') {
|
|
2062
|
+
text = data;
|
|
2063
|
+
} else if (data instanceof ArrayBuffer) {
|
|
2064
|
+
text = new TextDecoder().decode(new Uint8Array(data));
|
|
2065
|
+
} else if (typeof Blob !== 'undefined' && data instanceof Blob) {
|
|
2066
|
+
// Async Blob path — schedule decode then re-enter onMessage. This
|
|
2067
|
+
// happens only when binaryType wasn't set to 'arraybuffer' in
|
|
2068
|
+
// time (defensive fallback).
|
|
2069
|
+
void data.text().then((t) =>
|
|
2070
|
+
this.onMessage({ ...ev, data: t } as unknown as MessageEvent),
|
|
2071
|
+
);
|
|
2072
|
+
return;
|
|
2073
|
+
} else {
|
|
2074
|
+
text = '';
|
|
2075
|
+
}
|
|
2076
|
+
let frame: AcpFrame;
|
|
2077
|
+
try {
|
|
2078
|
+
frame = JSON.parse(text) as AcpFrame;
|
|
2079
|
+
} catch (err) {
|
|
2080
|
+
debugLog('webterm.acp.parse-error', { err: String(err), len: text.length });
|
|
2081
|
+
return;
|
|
2082
|
+
}
|
|
2083
|
+
// WT-S-1 — ACP standard JSON-RPC notifications carry `method` on the
|
|
2084
|
+
// wire, not `kind`. Map the canonical methods to our kind aliases so
|
|
2085
|
+
// consumers can `acp.on('sessionUpdate', cb)` regardless of which
|
|
2086
|
+
// path daemon-side emit took. Backward-compat: explicit `kind`
|
|
2087
|
+
// already on the frame wins.
|
|
2088
|
+
if (!frame.kind && frame.method) {
|
|
2089
|
+
if (frame.method === 'session/update') frame.kind = 'sessionUpdate';
|
|
2090
|
+
}
|
|
2091
|
+
debugLog('webterm.acp.frame.in', {
|
|
2092
|
+
method: frame.method ?? '(notif)',
|
|
2093
|
+
kind: frame.kind,
|
|
2094
|
+
id: frame.id,
|
|
2095
|
+
});
|
|
2096
|
+
// Resolve pending RPC
|
|
2097
|
+
if (frame.id !== undefined && this.pending.has(frame.id)) {
|
|
2098
|
+
const p = this.pending.get(frame.id)!;
|
|
2099
|
+
this.pending.delete(frame.id);
|
|
2100
|
+
if (frame.error) p.reject(new Error(frame.error.message));
|
|
2101
|
+
else p.resolve(frame.result);
|
|
2102
|
+
// A reply may itself trigger another send in the caller's microtask.
|
|
2103
|
+
// Defer retirement until that continuation has had a chance to run.
|
|
2104
|
+
queueMicrotask(() => this.closeIfUnused());
|
|
2105
|
+
} else if (
|
|
2106
|
+
// M4 of PLAN-ask-user-question-cross-surface-2026-05-13 — inbound
|
|
2107
|
+
// JSON-RPC request from the server (id present + method present +
|
|
2108
|
+
// NOT in our outbound pending map). Dispatch via the registered
|
|
2109
|
+
// handler and send a `{ jsonrpc, id, result | error }` response.
|
|
2110
|
+
frame.id !== undefined
|
|
2111
|
+
&& frame.method
|
|
2112
|
+
&& this.requestHandlers.has(frame.method)
|
|
2113
|
+
) {
|
|
2114
|
+
const handlers = this.requestHandlers.get(frame.method)!;
|
|
2115
|
+
const handler = [...handlers.values()].at(-1);
|
|
2116
|
+
if (handler) void this.handleInboundRequest(frame.id, frame.method, frame.params, handler);
|
|
2117
|
+
} else if (
|
|
2118
|
+
// Inbound request for an unknown method — respond with
|
|
2119
|
+
// methodNotFound so the server's sendRequest Promise doesn't hang.
|
|
2120
|
+
frame.id !== undefined
|
|
2121
|
+
&& frame.method
|
|
2122
|
+
) {
|
|
2123
|
+
void this.sendErrorResponse(frame.id, -32601, `method not found: ${frame.method}`);
|
|
2124
|
+
}
|
|
2125
|
+
// Notification dispatch
|
|
2126
|
+
if (frame.kind) {
|
|
2127
|
+
const set = this.kindHandlers.get(frame.kind);
|
|
2128
|
+
set?.forEach((h) => h(frame));
|
|
2129
|
+
}
|
|
2130
|
+
this.anyHandlers.forEach((h) => h(frame));
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
|
|
2134
|
+
class AcpConnectionLease implements AcpConnection {
|
|
2135
|
+
private closed = false;
|
|
2136
|
+
private readonly disposers = new Set<() => void>();
|
|
2137
|
+
|
|
2138
|
+
constructor(private readonly core: AcpConnectionImpl, onSession?: (id: string) => void) {
|
|
2139
|
+
if (onSession) this.disposers.add(core.subscribeSession(onSession));
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
private track(disposer: () => void): () => void {
|
|
2143
|
+
if (this.closed) {
|
|
2144
|
+
disposer();
|
|
2145
|
+
return () => {};
|
|
2146
|
+
}
|
|
2147
|
+
this.disposers.add(disposer);
|
|
2148
|
+
return () => { this.disposers.delete(disposer); disposer(); };
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
get ready(): Promise<string> { return this.core.ready; }
|
|
2152
|
+
get readyState(): number { return this.core.readyState; }
|
|
2153
|
+
get state(): AcpConnectionState { return this.core.state; }
|
|
2154
|
+
send(method: string, params: unknown): Promise<unknown> {
|
|
2155
|
+
return this.closed ? Promise.reject(new Error('ACP lease released')) : this.core.send(method, params);
|
|
2156
|
+
}
|
|
2157
|
+
on(kind: NonNullable<AcpFrame['kind']>, cb: AcpFrameHandler): () => void {
|
|
2158
|
+
return this.closed ? () => {} : this.track(this.core.on(kind, cb));
|
|
2159
|
+
}
|
|
2160
|
+
onAny(cb: AcpFrameHandler): () => void {
|
|
2161
|
+
return this.closed ? () => {} : this.track(this.core.onAny(cb));
|
|
2162
|
+
}
|
|
2163
|
+
onRequest(method: string, handler: AcpRequestHandler): () => void {
|
|
2164
|
+
return this.closed ? () => {} : this.track(this.core.onRequest(method, handler));
|
|
2165
|
+
}
|
|
2166
|
+
onState(cb: AcpStateHandler): () => void {
|
|
2167
|
+
return this.closed ? () => {} : this.track(this.core.onState(cb));
|
|
2168
|
+
}
|
|
2169
|
+
close(): void {
|
|
2170
|
+
if (this.closed) return;
|
|
2171
|
+
this.closed = true;
|
|
2172
|
+
this.disposers.forEach((dispose) => dispose());
|
|
2173
|
+
this.disposers.clear();
|
|
2174
|
+
this.core.release();
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
|
|
2178
|
+
// ── Phase B-1 (PWA chat streaming) — SSE parser ────────────────────
|
|
2179
|
+
//
|
|
2180
|
+
// Parses the wire shape `event: <name>\ndata: <json>\n\n` produced by
|
|
2181
|
+
// daemon `/v1/prompt/stream`. Exported standalone so the test suite
|
|
2182
|
+
// can lock the parser independent of fetch + WebSocket plumbing.
|
|
2183
|
+
|
|
2184
|
+
interface SseBlock {
|
|
2185
|
+
event: string;
|
|
2186
|
+
data: unknown;
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
/** Parse one `\n\n`-delimited SSE event block into `{event, data}`.
|
|
2190
|
+
* Returns `null` for blocks without a JSON-decodable `data:` line so
|
|
2191
|
+
* comment lines / partial blocks are dropped without breaking the
|
|
2192
|
+
* stream loop. Exported for unit testing. */
|
|
2193
|
+
/** ⛔⭐⭐⭐ `tool-result` 전선 한 줄 → 핸들러 인자. **두 파서가 «한 집»에서 이것을 만든다.**
|
|
2194
|
+
*
|
|
2195
|
+
* 📏 2026-08-22 실측(16차 `[F]`): 이 계약이 **두 곳에 베껴져 있었고 하나만 자랐다.**
|
|
2196
|
+
* - `parsePromptSseStream`(POST 턴) — `result` 를 읽고 `_meta.ui.resourceUri` 까지 «뽑았다».
|
|
2197
|
+
* - `consumeObserverSse`(다른 탭 관측) — `ev.data` 를 **그대로 넘기며 타입만 네 필드로 좁혔다.**
|
|
2198
|
+
* ⇒ `resourceUri` 는 «파생 값»이라 아무도 계산하지 않았고, 그래서 그 경로에서는
|
|
2199
|
+
* ***`mcp_app` 블록이 영영 만들어지지 않는다*** — 위젯이 아예 안 뜬다.
|
|
2200
|
+
*
|
|
2201
|
+
* ⛔ 이 저장소가 오늘 아침에 이름 붙인 그 부류다(`#11050` — 「같은 계약이 네 자리에 각자」).
|
|
2202
|
+
* ⇒ 값을 만드는 자리를 «하나»로 둔다. 다음에 필드가 늘어도 두 경로가 «같이» 움직인다. */
|
|
2203
|
+
export function toolResultHandlerPayload(data: unknown): {
|
|
2204
|
+
id: string;
|
|
2205
|
+
name: string;
|
|
2206
|
+
ok: boolean;
|
|
2207
|
+
summary?: string;
|
|
2208
|
+
rawOutput?: unknown;
|
|
2209
|
+
resourceUri?: string;
|
|
2210
|
+
resultOmittedReason?: 'too_large' | 'unserializable';
|
|
2211
|
+
} | null {
|
|
2212
|
+
if (!data || typeof data !== 'object' || Array.isArray(data)) return null;
|
|
2213
|
+
const parsed = data as {
|
|
2214
|
+
id: string;
|
|
2215
|
+
name: string;
|
|
2216
|
+
ok: boolean;
|
|
2217
|
+
summary?: string;
|
|
2218
|
+
/** ⛔⭐ 이 갈래의 이름은 `result` 다 — `rawOutput` 이 «아니다».
|
|
2219
|
+
* `rawOutput` 은 ACP 갈래(`tool_call_update`)의 이름이고,
|
|
2220
|
+
* 이 `tool-result` 갈래는 `src/nexus/api/meta-api.ts` 의
|
|
2221
|
+
* `projectPwaToolResult()` 가 `result` 로 싣는다.
|
|
2222
|
+
* ⛔ 두 갈래는 «다른 경로»다 — 이름을 섞으면 값이 영영 안 온다
|
|
2223
|
+
* (2026-08-20 실측: 실제로 그렇게 어긋나 있었다). */
|
|
2224
|
+
result?: unknown;
|
|
2225
|
+
/** 값이 «빠진» 이유 — 발신 쪽이 «아는» 사실만 온다(추측이 아니다). */
|
|
2226
|
+
resultOmittedReason?: 'too_large' | 'unserializable';
|
|
2227
|
+
};
|
|
2228
|
+
const rawOutput = parsed.result;
|
|
2229
|
+
const rawOutputObject = rawOutput !== null
|
|
2230
|
+
&& typeof rawOutput === 'object'
|
|
2231
|
+
&& !Array.isArray(rawOutput)
|
|
2232
|
+
? rawOutput as Record<string, unknown>
|
|
2233
|
+
: undefined;
|
|
2234
|
+
const meta = rawOutputObject?._meta;
|
|
2235
|
+
const metaUi = meta !== null && typeof meta === 'object' && !Array.isArray(meta)
|
|
2236
|
+
? (meta as Record<string, unknown>).ui
|
|
2237
|
+
: undefined;
|
|
2238
|
+
const nestedResourceUri = metaUi !== null && typeof metaUi === 'object' && !Array.isArray(metaUi)
|
|
2239
|
+
? (metaUi as Record<string, unknown>).resourceUri
|
|
2240
|
+
: undefined;
|
|
2241
|
+
const flatResourceUri = rawOutputObject?.['ui/resourceUri'];
|
|
2242
|
+
const resourceUri = typeof nestedResourceUri === 'string'
|
|
2243
|
+
? nestedResourceUri
|
|
2244
|
+
: typeof flatResourceUri === 'string'
|
|
2245
|
+
? flatResourceUri
|
|
2246
|
+
: undefined;
|
|
2247
|
+
return {
|
|
2248
|
+
id: parsed.id,
|
|
2249
|
+
name: parsed.name,
|
|
2250
|
+
ok: parsed.ok,
|
|
2251
|
+
...(parsed.summary !== undefined ? { summary: parsed.summary } : {}),
|
|
2252
|
+
...(rawOutput !== undefined ? { rawOutput } : {}),
|
|
2253
|
+
...(resourceUri !== undefined ? { resourceUri } : {}),
|
|
2254
|
+
// ⭐ 「왜 빠졌나」는 «발신 쪽이 아는» 사실이다(추측이 아니다) — 그대로 나른다.
|
|
2255
|
+
...(parsed.resultOmittedReason !== undefined
|
|
2256
|
+
? { resultOmittedReason: parsed.resultOmittedReason }
|
|
2257
|
+
: {}),
|
|
2258
|
+
};
|
|
2259
|
+
}
|
|
2260
|
+
|
|
2261
|
+
export function parseSseBlock(block: string): SseBlock | null {
|
|
2262
|
+
let event = 'message';
|
|
2263
|
+
let dataStr = '';
|
|
2264
|
+
for (const line of block.split('\n')) {
|
|
2265
|
+
if (line.startsWith('event:')) {
|
|
2266
|
+
event = line.slice(6).trim();
|
|
2267
|
+
} else if (line.startsWith('data:')) {
|
|
2268
|
+
// SSE allows leading space after `data:`; strip exactly one if
|
|
2269
|
+
// present to match the daemon's writer (which emits `data: <json>`).
|
|
2270
|
+
const rest = line.slice(5);
|
|
2271
|
+
dataStr += rest.startsWith(' ') ? rest.slice(1) : rest;
|
|
2272
|
+
}
|
|
2273
|
+
}
|
|
2274
|
+
if (!dataStr) return null;
|
|
2275
|
+
try {
|
|
2276
|
+
return { event, data: JSON.parse(dataStr) as unknown };
|
|
2277
|
+
} catch {
|
|
2278
|
+
return null;
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
/** Consume an SSE response body, dispatch events into `handlers`, and
|
|
2283
|
+
* resolve with the `turn-end` payload. Rejects on `error` event or
|
|
2284
|
+
* if the stream closes without a terminal event. Exported for the
|
|
2285
|
+
* contract test that locks the wire shape. */
|
|
2286
|
+
export async function parsePromptSseStream(
|
|
2287
|
+
body: ReadableStream<Uint8Array>,
|
|
2288
|
+
handlers: PromptStreamHandlers,
|
|
2289
|
+
): Promise<PromptResponse> {
|
|
2290
|
+
const reader = body.getReader();
|
|
2291
|
+
const dec = new TextDecoder();
|
|
2292
|
+
let buffer = '';
|
|
2293
|
+
let final: PromptResponse | null = null;
|
|
2294
|
+
let errorPayload: PromptStreamErrorPayload | null = null;
|
|
2295
|
+
for (;;) {
|
|
2296
|
+
const { value, done } = await reader.read();
|
|
2297
|
+
if (done) break;
|
|
2298
|
+
buffer += dec.decode(value, { stream: true });
|
|
2299
|
+
let idx;
|
|
2300
|
+
while ((idx = buffer.indexOf('\n\n')) >= 0) {
|
|
2301
|
+
const block = buffer.slice(0, idx);
|
|
2302
|
+
buffer = buffer.slice(idx + 2);
|
|
2303
|
+
const ev = parseSseBlock(block);
|
|
2304
|
+
if (!ev) continue;
|
|
2305
|
+
if (ev.event === 'turn-begin') {
|
|
2306
|
+
handlers.onTurnBegin?.(ev.data as { sessionId: string });
|
|
2307
|
+
} else if (ev.event === 'text-delta') {
|
|
2308
|
+
handlers.onTextDelta?.(ev.data as { delta: string; full: string });
|
|
2309
|
+
} else if (ev.event === 'image-block') {
|
|
2310
|
+
handlers.onImageBlock?.(ev.data as {
|
|
2311
|
+
src: string;
|
|
2312
|
+
mediaType: string;
|
|
2313
|
+
alt?: string;
|
|
2314
|
+
});
|
|
2315
|
+
} else if (ev.event === 'tool-call') {
|
|
2316
|
+
handlers.onToolCall?.(ev.data as {
|
|
2317
|
+
id: string;
|
|
2318
|
+
name: string;
|
|
2319
|
+
args: Record<string, unknown>;
|
|
2320
|
+
});
|
|
2321
|
+
} else if (ev.event === 'tool-result') {
|
|
2322
|
+
const payload = toolResultHandlerPayload(ev.data);
|
|
2323
|
+
if (payload) handlers.onToolResult?.(payload);
|
|
2324
|
+
} else if (ev.event === 'feedback') {
|
|
2325
|
+
// M1 PR 2 — validate before dispatch · drop silently on schema
|
|
2326
|
+
// mismatch so a daemon-side regression can't crash the chat.
|
|
2327
|
+
if (isFeedbackEnvelopeWire(ev.data)) {
|
|
2328
|
+
handlers.onFeedback?.(ev.data);
|
|
2329
|
+
} else {
|
|
2330
|
+
debugLog('webterm.sse.feedback.drop', { reason: 'schema-mismatch' });
|
|
2331
|
+
}
|
|
2332
|
+
} else if (ev.event === 'turn-end') {
|
|
2333
|
+
final = ev.data as PromptResponse;
|
|
2334
|
+
handlers.onTurnEnd?.(final);
|
|
2335
|
+
} else if (ev.event === 'error') {
|
|
2336
|
+
errorPayload = ev.data as PromptStreamErrorPayload;
|
|
2337
|
+
handlers.onError?.(errorPayload);
|
|
2338
|
+
}
|
|
2339
|
+
}
|
|
2340
|
+
}
|
|
2341
|
+
if (errorPayload) {
|
|
2342
|
+
const detail = errorPayload.message ? `: ${errorPayload.message}` : '';
|
|
2343
|
+
throw new Error(`${errorPayload.error}${detail}`);
|
|
2344
|
+
}
|
|
2345
|
+
if (!final) throw new Error('prompt/stream closed without turn-end');
|
|
2346
|
+
return final;
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
/** Phase B-4 follow-up — observer-mode SSE consumer. Same parsing as
|
|
2350
|
+
* `parsePromptSseStream` but never resolves: the caller's disposer
|
|
2351
|
+
* aborts the underlying fetch when the subscription should end.
|
|
2352
|
+
* `error` events fire the handler but do NOT throw — the stream
|
|
2353
|
+
* stays open for the next turn. `subscribed` events (the one-shot
|
|
2354
|
+
* marker the observer endpoint emits at start) and `turn-end`
|
|
2355
|
+
* events both fall through to the same handlers as `promptStream`.
|
|
2356
|
+
* Exported for the contract test that exercises observer parsing
|
|
2357
|
+
* independent of fetch plumbing. */
|
|
2358
|
+
export async function consumeObserverSse(
|
|
2359
|
+
body: ReadableStream<Uint8Array>,
|
|
2360
|
+
handlers: PromptStreamHandlers,
|
|
2361
|
+
): Promise<void> {
|
|
2362
|
+
const reader = body.getReader();
|
|
2363
|
+
const dec = new TextDecoder();
|
|
2364
|
+
let buffer = '';
|
|
2365
|
+
for (;;) {
|
|
2366
|
+
const { value, done } = await reader.read();
|
|
2367
|
+
if (done) break;
|
|
2368
|
+
buffer += dec.decode(value, { stream: true });
|
|
2369
|
+
let idx = buffer.indexOf('\n\n');
|
|
2370
|
+
while (idx >= 0) {
|
|
2371
|
+
const block = buffer.slice(0, idx);
|
|
2372
|
+
buffer = buffer.slice(idx + 2);
|
|
2373
|
+
const ev = parseSseBlock(block);
|
|
2374
|
+
idx = buffer.indexOf('\n\n');
|
|
2375
|
+
if (!ev) continue;
|
|
2376
|
+
if (ev.event === 'subscribed') {
|
|
2377
|
+
// No-op marker — bus subscription is live. Future turns
|
|
2378
|
+
// arrive on the same stream. (Caller may peek via debugLog
|
|
2379
|
+
// but observer needs no behavioral branch here.)
|
|
2380
|
+
continue;
|
|
2381
|
+
}
|
|
2382
|
+
if (ev.event === 'turn-begin') {
|
|
2383
|
+
handlers.onTurnBegin?.(ev.data as { sessionId: string });
|
|
2384
|
+
} else if (ev.event === 'text-delta') {
|
|
2385
|
+
handlers.onTextDelta?.(ev.data as { delta: string; full: string });
|
|
2386
|
+
} else if (ev.event === 'image-block') {
|
|
2387
|
+
handlers.onImageBlock?.(ev.data as {
|
|
2388
|
+
src: string;
|
|
2389
|
+
mediaType: string;
|
|
2390
|
+
alt?: string;
|
|
2391
|
+
});
|
|
2392
|
+
} else if (ev.event === 'tool-call') {
|
|
2393
|
+
handlers.onToolCall?.(ev.data as {
|
|
2394
|
+
id: string;
|
|
2395
|
+
name: string;
|
|
2396
|
+
args: Record<string, unknown>;
|
|
2397
|
+
});
|
|
2398
|
+
} else if (ev.event === 'tool-result') {
|
|
2399
|
+
// ⛔⭐⭐ 1차판은 `ev.data` 를 «그대로» 넘기며 타입만 네 필드로 좁혔다.
|
|
2400
|
+
// ⇒ `resourceUri` 는 «파생 값»이라 아무도 계산하지 않았고, 그래서 이 경로에서는
|
|
2401
|
+
// ***`mcp_app` 블록이 영영 안 만들어졌다*** — 다른 탭에서 보면 위젯이 아예 없다.
|
|
2402
|
+
// ⇒ POST 경로와 «같은 집»에서 만든다(`toolResultHandlerPayload`).
|
|
2403
|
+
const payload = toolResultHandlerPayload(ev.data);
|
|
2404
|
+
if (payload) handlers.onToolResult?.(payload);
|
|
2405
|
+
} else if (ev.event === 'feedback') {
|
|
2406
|
+
// M1 PR 2 — observer path mirrors `parsePromptSseStream` so
|
|
2407
|
+
// the same envelope wire reaches multi-tab observers.
|
|
2408
|
+
if (isFeedbackEnvelopeWire(ev.data)) {
|
|
2409
|
+
handlers.onFeedback?.(ev.data);
|
|
2410
|
+
} else {
|
|
2411
|
+
debugLog('webterm.sse.feedback.observer-drop', { reason: 'schema-mismatch' });
|
|
2412
|
+
}
|
|
2413
|
+
} else if (ev.event === 'turn-end') {
|
|
2414
|
+
handlers.onTurnEnd?.(ev.data as PromptResponse);
|
|
2415
|
+
} else if (ev.event === 'error') {
|
|
2416
|
+
handlers.onError?.(ev.data as PromptStreamErrorPayload);
|
|
2417
|
+
// Observer keeps the connection open after an error so the
|
|
2418
|
+
// next turn (which gets its own turn-begin) flows through.
|
|
2419
|
+
}
|
|
2420
|
+
}
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
// ── agent.status SSE consumer (rich-dev-feedback §6.2 #3) ───────────
|
|
2425
|
+
|
|
2426
|
+
/** Caller hooks for `subscribeAgentStatusEvents`. Mirrors the
|
|
2427
|
+
* PromptStreamHandlers single-source contract — every received
|
|
2428
|
+
* agent.status NexusEvent maps to one synthesized FeedbackEnvelope
|
|
2429
|
+
* via `onFeedback`. Long-lived: never rejects, the disposer is the
|
|
2430
|
+
* only exit. */
|
|
2431
|
+
export interface AgentStatusEventHandlers {
|
|
2432
|
+
onFeedback: (env: FeedbackEnvelopeWire) => void;
|
|
2433
|
+
onError?: (info: { error: string; message?: string }) => void;
|
|
2434
|
+
}
|
|
2435
|
+
|
|
2436
|
+
/** Daemon-side `AgentStatusRecord.status` enum (`SessionStatus`).
|
|
2437
|
+
* Translated to the envelope's `'running' | 'queued' | 'done' |
|
|
2438
|
+
* 'error'` enum on the PWA side so the renderer + accumulator stay
|
|
2439
|
+
* on a single status alphabet. `'idle'` has no envelope equivalent
|
|
2440
|
+
* — those events are dropped (the chip's absence is the "idle"
|
|
2441
|
+
* representation). */
|
|
2442
|
+
type DaemonSessionStatus = 'idle' | 'working' | 'awaiting' | 'done' | 'err';
|
|
2443
|
+
|
|
2444
|
+
const STATUS_MAP: Record<DaemonSessionStatus, 'running' | 'queued' | 'done' | 'error' | null> = {
|
|
2445
|
+
idle: null,
|
|
2446
|
+
working: 'running',
|
|
2447
|
+
awaiting: 'queued',
|
|
2448
|
+
done: 'done',
|
|
2449
|
+
err: 'error',
|
|
2450
|
+
};
|
|
2451
|
+
|
|
2452
|
+
interface AgentStatusEventDetail {
|
|
2453
|
+
agentId?: string;
|
|
2454
|
+
status?: string;
|
|
2455
|
+
lastEvent?: string;
|
|
2456
|
+
updatedAt?: number;
|
|
2457
|
+
}
|
|
2458
|
+
|
|
2459
|
+
interface AgentStatusNexusEvent {
|
|
2460
|
+
ts: number;
|
|
2461
|
+
kind: string;
|
|
2462
|
+
detail?: AgentStatusEventDetail;
|
|
2463
|
+
}
|
|
2464
|
+
|
|
2465
|
+
/** Long-lived SSE consumer for `/v1/events?topics=agent.status`.
|
|
2466
|
+
* Parses each NexusEvent frame, validates the agent.status detail,
|
|
2467
|
+
* translates SessionStatus → envelope status enum, and synthesizes
|
|
2468
|
+
* a FeedbackEnvelopeWire (kind='agent.status', phase='update',
|
|
2469
|
+
* blockId=`${sessionId}:agent-status:${agentId}` stable per agent).
|
|
2470
|
+
* Maintains a per-blockId seq counter so the accumulator's monotonic
|
|
2471
|
+
* invariant holds for the synthetic envelopes.
|
|
2472
|
+
*
|
|
2473
|
+
* Exported so the contract test can exercise parsing without fetch
|
|
2474
|
+
* plumbing. */
|
|
2475
|
+
export async function consumeAgentStatusSse(
|
|
2476
|
+
body: ReadableStream<Uint8Array>,
|
|
2477
|
+
sessionId: string,
|
|
2478
|
+
handlers: AgentStatusEventHandlers,
|
|
2479
|
+
): Promise<void> {
|
|
2480
|
+
const reader = body.getReader();
|
|
2481
|
+
const dec = new TextDecoder();
|
|
2482
|
+
let buffer = '';
|
|
2483
|
+
const seqByBlockId = new Map<string, number>();
|
|
2484
|
+
const nextSeq = (blockId: string): number => {
|
|
2485
|
+
const prev = seqByBlockId.get(blockId) ?? 0;
|
|
2486
|
+
const n = prev + 1;
|
|
2487
|
+
seqByBlockId.set(blockId, n);
|
|
2488
|
+
return n;
|
|
2489
|
+
};
|
|
2490
|
+
for (;;) {
|
|
2491
|
+
const { value, done } = await reader.read();
|
|
2492
|
+
if (done) break;
|
|
2493
|
+
buffer += dec.decode(value, { stream: true });
|
|
2494
|
+
let idx = buffer.indexOf('\n\n');
|
|
2495
|
+
while (idx >= 0) {
|
|
2496
|
+
const block = buffer.slice(0, idx);
|
|
2497
|
+
buffer = buffer.slice(idx + 2);
|
|
2498
|
+
idx = buffer.indexOf('\n\n');
|
|
2499
|
+
const parsed = parseSseBlock(block);
|
|
2500
|
+
if (!parsed) continue;
|
|
2501
|
+
if (parsed.event !== 'agent.status') continue;
|
|
2502
|
+
const ev = parsed.data as AgentStatusNexusEvent | null;
|
|
2503
|
+
if (!ev || typeof ev !== 'object') continue;
|
|
2504
|
+
const detail = ev.detail;
|
|
2505
|
+
if (
|
|
2506
|
+
!detail
|
|
2507
|
+
|| typeof detail.agentId !== 'string'
|
|
2508
|
+
|| typeof detail.status !== 'string'
|
|
2509
|
+
) continue;
|
|
2510
|
+
const mapped = STATUS_MAP[detail.status as DaemonSessionStatus];
|
|
2511
|
+
if (mapped === undefined || mapped === null) continue;
|
|
2512
|
+
const blockId = `${sessionId}:agent-status:${detail.agentId}`;
|
|
2513
|
+
const env: FeedbackEnvelopeWire = {
|
|
2514
|
+
envelopeVersion: 1,
|
|
2515
|
+
sessionId,
|
|
2516
|
+
blockId,
|
|
2517
|
+
kind: 'agent.status',
|
|
2518
|
+
phase: 'update',
|
|
2519
|
+
emittedAt: typeof detail.updatedAt === 'number' ? detail.updatedAt : ev.ts,
|
|
2520
|
+
seq: nextSeq(blockId),
|
|
2521
|
+
payload: {
|
|
2522
|
+
agentId: detail.agentId,
|
|
2523
|
+
status: mapped,
|
|
2524
|
+
...(typeof detail.lastEvent === 'string' ? { lastEvent: detail.lastEvent } : {}),
|
|
2525
|
+
},
|
|
2526
|
+
asciiFallback: [
|
|
2527
|
+
`${detail.agentId} ${mapped}${detail.lastEvent ? ' · ' + detail.lastEvent : ''}`,
|
|
2528
|
+
],
|
|
2529
|
+
};
|
|
2530
|
+
if (!isFeedbackEnvelopeWire(env)) {
|
|
2531
|
+
debugLog('webterm.agent-status.synthesize.drop', { agentId: detail.agentId, status: detail.status });
|
|
2532
|
+
continue;
|
|
2533
|
+
}
|
|
2534
|
+
handlers.onFeedback(env);
|
|
2535
|
+
}
|
|
2536
|
+
}
|
|
2537
|
+
}
|
|
2538
|
+
|
|
2539
|
+
// PLAN-chat-hud-multi-surface-port-2026-05-13 §4 M4 — hud.segment SSE
|
|
2540
|
+
// consumer. Each event's detail is the `HudSegmentEventDetail` shape
|
|
2541
|
+
// from the daemon-side bridge (src/nexus/api/hud-event-bridge.ts):
|
|
2542
|
+
// { phase: 'update'|'end', key, value?, priority?, tone?, glyph? }
|
|
2543
|
+
// We synthesize a kind='hud.segment' envelope so the chat-runtime
|
|
2544
|
+
// onFeedback path routes it via M1's applyHudSegmentEnvelope without
|
|
2545
|
+
// any new branching.
|
|
2546
|
+
|
|
2547
|
+
export interface HudSegmentEventHandlers {
|
|
2548
|
+
onFeedback: (env: FeedbackEnvelopeWire) => void;
|
|
2549
|
+
onError?: (info: { error: string; message?: string }) => void;
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2552
|
+
interface HudSegmentEventDetail {
|
|
2553
|
+
phase?: string;
|
|
2554
|
+
key?: string;
|
|
2555
|
+
value?: string;
|
|
2556
|
+
priority?: number;
|
|
2557
|
+
tone?: string;
|
|
2558
|
+
glyph?: string;
|
|
2559
|
+
}
|
|
2560
|
+
|
|
2561
|
+
interface HudSegmentNexusEvent {
|
|
2562
|
+
ts: number;
|
|
2563
|
+
kind: string;
|
|
2564
|
+
detail?: HudSegmentEventDetail;
|
|
2565
|
+
}
|
|
2566
|
+
|
|
2567
|
+
/** Exported so contract tests can exercise the parse + synthesize
|
|
2568
|
+
* step without fetch plumbing. Same shape contract as
|
|
2569
|
+
* consumeAgentStatusSse. */
|
|
2570
|
+
export async function consumeHudSegmentSse(
|
|
2571
|
+
body: ReadableStream<Uint8Array>,
|
|
2572
|
+
sessionId: string,
|
|
2573
|
+
handlers: HudSegmentEventHandlers,
|
|
2574
|
+
): Promise<void> {
|
|
2575
|
+
const reader = body.getReader();
|
|
2576
|
+
const dec = new TextDecoder();
|
|
2577
|
+
let buffer = '';
|
|
2578
|
+
const seqByBlockId = new Map<string, number>();
|
|
2579
|
+
const nextSeq = (blockId: string): number => {
|
|
2580
|
+
const prev = seqByBlockId.get(blockId) ?? 0;
|
|
2581
|
+
const n = prev + 1;
|
|
2582
|
+
seqByBlockId.set(blockId, n);
|
|
2583
|
+
return n;
|
|
2584
|
+
};
|
|
2585
|
+
for (;;) {
|
|
2586
|
+
const { value, done } = await reader.read();
|
|
2587
|
+
if (done) break;
|
|
2588
|
+
buffer += dec.decode(value, { stream: true });
|
|
2589
|
+
let idx = buffer.indexOf('\n\n');
|
|
2590
|
+
while (idx >= 0) {
|
|
2591
|
+
const block = buffer.slice(0, idx);
|
|
2592
|
+
buffer = buffer.slice(idx + 2);
|
|
2593
|
+
idx = buffer.indexOf('\n\n');
|
|
2594
|
+
const parsed = parseSseBlock(block);
|
|
2595
|
+
if (!parsed) continue;
|
|
2596
|
+
if (parsed.event !== 'hud.segment') continue;
|
|
2597
|
+
const ev = parsed.data as HudSegmentNexusEvent | null;
|
|
2598
|
+
if (!ev || typeof ev !== 'object') continue;
|
|
2599
|
+
const detail = ev.detail;
|
|
2600
|
+
if (!detail || typeof detail.key !== 'string' || !detail.key) continue;
|
|
2601
|
+
const phase = detail.phase === 'end' ? 'end' : 'update';
|
|
2602
|
+
const blockId = `${sessionId}:hud:${detail.key}`;
|
|
2603
|
+
const payload: Record<string, unknown> = { key: detail.key };
|
|
2604
|
+
if (phase === 'update') {
|
|
2605
|
+
if (typeof detail.value !== 'string') {
|
|
2606
|
+
debugLog('webterm.hud-segment.synthesize.drop', { key: detail.key, reason: 'missing-value' });
|
|
2607
|
+
continue;
|
|
2608
|
+
}
|
|
2609
|
+
payload.value = detail.value;
|
|
2610
|
+
if (typeof detail.priority === 'number') payload.priority = detail.priority;
|
|
2611
|
+
if (typeof detail.tone === 'string') payload.tone = detail.tone;
|
|
2612
|
+
if (typeof detail.glyph === 'string') payload.glyph = detail.glyph;
|
|
2613
|
+
} else {
|
|
2614
|
+
// phase=end: payload only needs key (accumulator clears the slot).
|
|
2615
|
+
payload.value = ''; // satisfy non-string narrowing for wire guard
|
|
2616
|
+
}
|
|
2617
|
+
const env: FeedbackEnvelopeWire = {
|
|
2618
|
+
envelopeVersion: 1,
|
|
2619
|
+
sessionId,
|
|
2620
|
+
blockId,
|
|
2621
|
+
kind: 'hud.segment',
|
|
2622
|
+
phase,
|
|
2623
|
+
emittedAt: ev.ts,
|
|
2624
|
+
seq: nextSeq(blockId),
|
|
2625
|
+
payload,
|
|
2626
|
+
asciiFallback: phase === 'update' && typeof detail.value === 'string'
|
|
2627
|
+
? [`${detail.glyph ?? ''}${detail.glyph ? ' ' : ''}${detail.value}`]
|
|
2628
|
+
: [],
|
|
2629
|
+
};
|
|
2630
|
+
if (!isFeedbackEnvelopeWire(env)) {
|
|
2631
|
+
debugLog('webterm.hud-segment.synthesize.drop', { key: detail.key, reason: 'wire-guard' });
|
|
2632
|
+
continue;
|
|
2633
|
+
}
|
|
2634
|
+
handlers.onFeedback(env);
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
}
|