@deepseek-insight/dsi 0.5.5
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/LICENSE +204 -0
- package/README.md +98 -0
- package/bin/dsi.mjs +147 -0
- package/build/client/_app/immutable/assets/0.DqFt8jIM.css +2 -0
- package/build/client/_app/immutable/assets/2.YlW45hiM.css +1 -0
- package/build/client/_app/immutable/assets/codicon.Brq4_Ui5.ttf +0 -0
- package/build/client/_app/immutable/assets/editor.jjEx9u7D.css +1 -0
- package/build/client/_app/immutable/assets/settings-monaco.C1CMdMvw.css +1 -0
- package/build/client/_app/immutable/chunks/-g7BcI22.js +4 -0
- package/build/client/_app/immutable/chunks/08VXUWAP.js +1 -0
- package/build/client/_app/immutable/chunks/2irkVCIh.js +10 -0
- package/build/client/_app/immutable/chunks/43DmfD33.js +1 -0
- package/build/client/_app/immutable/chunks/6GKQw8m6.js +99 -0
- package/build/client/_app/immutable/chunks/6RTg0lbw.js +1 -0
- package/build/client/_app/immutable/chunks/9TvT6fta.js +120 -0
- package/build/client/_app/immutable/chunks/B1YSaoU7.js +96 -0
- package/build/client/_app/immutable/chunks/B2J2w5EN.js +1 -0
- package/build/client/_app/immutable/chunks/B5-_aFwp.js +2 -0
- package/build/client/_app/immutable/chunks/B8-Q2PIv.js +1 -0
- package/build/client/_app/immutable/chunks/B8J7ngcE.js +1 -0
- package/build/client/_app/immutable/chunks/B9JPFI3C.js +2 -0
- package/build/client/_app/immutable/chunks/BAZKJuQw.js +1 -0
- package/build/client/_app/immutable/chunks/BBKpNcUe.js +1 -0
- package/build/client/_app/immutable/chunks/BEEn4gHE.js +1 -0
- package/build/client/_app/immutable/chunks/BEtHBSE6.js +1 -0
- package/build/client/_app/immutable/chunks/BFoDCU3G.js +1 -0
- package/build/client/_app/immutable/chunks/BHtPwB2y.js +847 -0
- package/build/client/_app/immutable/chunks/BI-MrBd-.js +1 -0
- package/build/client/_app/immutable/chunks/BI4pMaIG.js +1 -0
- package/build/client/_app/immutable/chunks/BJL7RCQE.js +4 -0
- package/build/client/_app/immutable/chunks/BKxtCVv1.js +1 -0
- package/build/client/_app/immutable/chunks/BOfSXrr7.js +1 -0
- package/build/client/_app/immutable/chunks/BOotOW0E.js +1 -0
- package/build/client/_app/immutable/chunks/BTzV9O1M.js +3 -0
- package/build/client/_app/immutable/chunks/BW-FRVGs.js +1 -0
- package/build/client/_app/immutable/chunks/BWPQTe0t.js +1 -0
- package/build/client/_app/immutable/chunks/BYgofb2h.js +1 -0
- package/build/client/_app/immutable/chunks/Ba7i2nA0.js +1 -0
- package/build/client/_app/immutable/chunks/Bb19NAkg.js +1 -0
- package/build/client/_app/immutable/chunks/Bc_sGQ0U.js +1 -0
- package/build/client/_app/immutable/chunks/BeGwcela.js +1 -0
- package/build/client/_app/immutable/chunks/BeZqd5lB.js +1 -0
- package/build/client/_app/immutable/chunks/Beo7Z46k.js +7 -0
- package/build/client/_app/immutable/chunks/BhNEBkk_.js +39 -0
- package/build/client/_app/immutable/chunks/BifhSqXX.js +1 -0
- package/build/client/_app/immutable/chunks/Bjy-W4x2.js +81 -0
- package/build/client/_app/immutable/chunks/BlltJnm0.js +1 -0
- package/build/client/_app/immutable/chunks/Bn9NRi0R.js +168 -0
- package/build/client/_app/immutable/chunks/BnF5Jm-h.js +1 -0
- package/build/client/_app/immutable/chunks/Bp4uuUjI.js +3 -0
- package/build/client/_app/immutable/chunks/BrTsmS-o.js +57 -0
- package/build/client/_app/immutable/chunks/Bri6UV-V.js +1 -0
- package/build/client/_app/immutable/chunks/Btk-1DaX.js +1 -0
- package/build/client/_app/immutable/chunks/BwWrilGY.js +1 -0
- package/build/client/_app/immutable/chunks/Bxkupp3x.js +1 -0
- package/build/client/_app/immutable/chunks/Bz4Y3fRF.js +1 -0
- package/build/client/_app/immutable/chunks/C-OQMol4.js +1 -0
- package/build/client/_app/immutable/chunks/C-y9NEjX.js +1 -0
- package/build/client/_app/immutable/chunks/C1JXY9b5.js +30 -0
- package/build/client/_app/immutable/chunks/C2x7inlt.js +321 -0
- package/build/client/_app/immutable/chunks/C531GsRP.js +2 -0
- package/build/client/_app/immutable/chunks/C5TAQhFO.js +1 -0
- package/build/client/_app/immutable/chunks/C5_-GSwl.js +1 -0
- package/build/client/_app/immutable/chunks/C6lv30UQ.js +1 -0
- package/build/client/_app/immutable/chunks/C7h46wYY.js +1 -0
- package/build/client/_app/immutable/chunks/C8Ef5oNN.js +1 -0
- package/build/client/_app/immutable/chunks/CA_WNCsl.js +41 -0
- package/build/client/_app/immutable/chunks/CC2rA5mh.js +1 -0
- package/build/client/_app/immutable/chunks/CHdTS7qa.js +15 -0
- package/build/client/_app/immutable/chunks/CIPQ_RoX.js +1 -0
- package/build/client/_app/immutable/chunks/CJ_zvTBg.js +72 -0
- package/build/client/_app/immutable/chunks/CPEyWost.js +1 -0
- package/build/client/_app/immutable/chunks/CPgSxomx.js +1 -0
- package/build/client/_app/immutable/chunks/CRfGWb83.js +1 -0
- package/build/client/_app/immutable/chunks/CTgm3pse.js +1 -0
- package/build/client/_app/immutable/chunks/CVaqCwHa.js +1 -0
- package/build/client/_app/immutable/chunks/CWKM3f5q.js +1 -0
- package/build/client/_app/immutable/chunks/CWVpRRWx.js +162 -0
- package/build/client/_app/immutable/chunks/CXMH3UgJ.js +257 -0
- package/build/client/_app/immutable/chunks/CZ-RNlot.js +1 -0
- package/build/client/_app/immutable/chunks/CZXl7qUb.js +70 -0
- package/build/client/_app/immutable/chunks/C_N-eONP.js +1 -0
- package/build/client/_app/immutable/chunks/Cb1pwoev.js +1 -0
- package/build/client/_app/immutable/chunks/CcL1k2On.js +11 -0
- package/build/client/_app/immutable/chunks/CcWV7GYH.js +1 -0
- package/build/client/_app/immutable/chunks/CcwsVR0C.js +1 -0
- package/build/client/_app/immutable/chunks/Cd6K7Y8m.js +1 -0
- package/build/client/_app/immutable/chunks/CfSJPG6W.js +1 -0
- package/build/client/_app/immutable/chunks/CfZ7uSQe.js +38 -0
- package/build/client/_app/immutable/chunks/Cimd5fb3.js +1 -0
- package/build/client/_app/immutable/chunks/Cj-Zm41R.js +36 -0
- package/build/client/_app/immutable/chunks/CjZ_QSbm.js +1 -0
- package/build/client/_app/immutable/chunks/CkrcOjFY.js +1 -0
- package/build/client/_app/immutable/chunks/ClamHrr6.js +1 -0
- package/build/client/_app/immutable/chunks/Cm7r79vr.js +1 -0
- package/build/client/_app/immutable/chunks/CmbEK4CY.js +84 -0
- package/build/client/_app/immutable/chunks/CmvnEPtD.js +7 -0
- package/build/client/_app/immutable/chunks/CopQ2nXW.js +1 -0
- package/build/client/_app/immutable/chunks/CpzslTdj.js +1 -0
- package/build/client/_app/immutable/chunks/CsHVnZCH.js +1 -0
- package/build/client/_app/immutable/chunks/CsQS60Ue.js +1 -0
- package/build/client/_app/immutable/chunks/CuRJVwEq.js +1 -0
- package/build/client/_app/immutable/chunks/D-oSqn_W.js +1 -0
- package/build/client/_app/immutable/chunks/D-ptJ9y-.js +1 -0
- package/build/client/_app/immutable/chunks/D05T4iGw.js +1 -0
- package/build/client/_app/immutable/chunks/D0I62FkS.js +1 -0
- package/build/client/_app/immutable/chunks/D16vkywU.js +1 -0
- package/build/client/_app/immutable/chunks/D1qzYj9m.js +1 -0
- package/build/client/_app/immutable/chunks/D3hlyOfw.js +1 -0
- package/build/client/_app/immutable/chunks/D4gq_dik.js +1 -0
- package/build/client/_app/immutable/chunks/D7fX-3xy.js +1 -0
- package/build/client/_app/immutable/chunks/D8-5qLJg.js +231 -0
- package/build/client/_app/immutable/chunks/D8hlhfM3.js +1 -0
- package/build/client/_app/immutable/chunks/DAS1CLuE.js +24 -0
- package/build/client/_app/immutable/chunks/DGarjVZC.js +1 -0
- package/build/client/_app/immutable/chunks/DGd2pJF5.js +1 -0
- package/build/client/_app/immutable/chunks/DHpiXF5c.js +1 -0
- package/build/client/_app/immutable/chunks/DHwB1DNv.js +161 -0
- package/build/client/_app/immutable/chunks/DIMkf-bt.js +3 -0
- package/build/client/_app/immutable/chunks/DISqw1ZD.js +1 -0
- package/build/client/_app/immutable/chunks/DITEY8D_.js +62 -0
- package/build/client/_app/immutable/chunks/DL0yNkAA.js +1 -0
- package/build/client/_app/immutable/chunks/DL1Hc2zs.js +1 -0
- package/build/client/_app/immutable/chunks/DLOOos_8.js +292 -0
- package/build/client/_app/immutable/chunks/DMUM7wLl.js +1 -0
- package/build/client/_app/immutable/chunks/DPKol_4Z.js +139 -0
- package/build/client/_app/immutable/chunks/DS17s2tU.js +1 -0
- package/build/client/_app/immutable/chunks/DT7zqm-g.js +1 -0
- package/build/client/_app/immutable/chunks/DTj74zXo.js +1 -0
- package/build/client/_app/immutable/chunks/DV3o63ZY.js +1 -0
- package/build/client/_app/immutable/chunks/DVXVVWkX.js +129 -0
- package/build/client/_app/immutable/chunks/DWDfcLfy.js +206 -0
- package/build/client/_app/immutable/chunks/DXeGLmed.js +8 -0
- package/build/client/_app/immutable/chunks/DYqsupvX.js +1 -0
- package/build/client/_app/immutable/chunks/DZ6u0Z-K.js +1 -0
- package/build/client/_app/immutable/chunks/DZFCIeNp.js +1 -0
- package/build/client/_app/immutable/chunks/D_Lu-MrJ.js +1 -0
- package/build/client/_app/immutable/chunks/DauUninz.js +1 -0
- package/build/client/_app/immutable/chunks/DbInun42.js +1 -0
- package/build/client/_app/immutable/chunks/DbcKN35_.js +3 -0
- package/build/client/_app/immutable/chunks/DcZe4Woe.js +1 -0
- package/build/client/_app/immutable/chunks/DdL9SqIa.js +1 -0
- package/build/client/_app/immutable/chunks/De2hgUGE.js +1 -0
- package/build/client/_app/immutable/chunks/DezsRK8O.js +1 -0
- package/build/client/_app/immutable/chunks/Dg_UWGX7.js +24 -0
- package/build/client/_app/immutable/chunks/Dj2t5yNg.js +1 -0
- package/build/client/_app/immutable/chunks/DkqhCAOL.js +1 -0
- package/build/client/_app/immutable/chunks/DlQrSOw4.js +7 -0
- package/build/client/_app/immutable/chunks/DmHpPYUd.js +1 -0
- package/build/client/_app/immutable/chunks/Dmn-tsie.js +1 -0
- package/build/client/_app/immutable/chunks/DpFanUEy.js +298 -0
- package/build/client/_app/immutable/chunks/DqwfDHZH.js +89 -0
- package/build/client/_app/immutable/chunks/Dr0pcX_F.js +1 -0
- package/build/client/_app/immutable/chunks/DrH0SRf2.js +1 -0
- package/build/client/_app/immutable/chunks/DsF7k-Jl.js +1 -0
- package/build/client/_app/immutable/chunks/DtBGId5S.js +2 -0
- package/build/client/_app/immutable/chunks/DuM1hSCa.js +1 -0
- package/build/client/_app/immutable/chunks/Du_ODUAO.js +1 -0
- package/build/client/_app/immutable/chunks/DvCMcJ3P.js +1 -0
- package/build/client/_app/immutable/chunks/Dy-Kn_BL.js +1 -0
- package/build/client/_app/immutable/chunks/DzVMo6mB.js +62 -0
- package/build/client/_app/immutable/chunks/ESmLJICu.js +1 -0
- package/build/client/_app/immutable/chunks/FvmIjYaQ.js +1 -0
- package/build/client/_app/immutable/chunks/GBaNblmo.js +1 -0
- package/build/client/_app/immutable/chunks/HclGiUj8.js +1 -0
- package/build/client/_app/immutable/chunks/Ju5jF6hy.js +1 -0
- package/build/client/_app/immutable/chunks/KythIMN8.js +1 -0
- package/build/client/_app/immutable/chunks/LWre5GKl.js +40 -0
- package/build/client/_app/immutable/chunks/NEE52Syq.js +1 -0
- package/build/client/_app/immutable/chunks/No6lfiAw.js +1 -0
- package/build/client/_app/immutable/chunks/OmE6SGvs.js +106 -0
- package/build/client/_app/immutable/chunks/P_ok0Z_j.js +2 -0
- package/build/client/_app/immutable/chunks/PaZBB01u.js +1 -0
- package/build/client/_app/immutable/chunks/Rh9cy7xg.js +2 -0
- package/build/client/_app/immutable/chunks/SOo6toE5.js +1 -0
- package/build/client/_app/immutable/chunks/TNLUqJaC.js +1 -0
- package/build/client/_app/immutable/chunks/UNxFjlik.js +1 -0
- package/build/client/_app/immutable/chunks/UmdltqoE.js +1 -0
- package/build/client/_app/immutable/chunks/Z5eAx3Zn.js +1 -0
- package/build/client/_app/immutable/chunks/bTuwJoIa.js +1 -0
- package/build/client/_app/immutable/chunks/fmXr3nnJ.js +1 -0
- package/build/client/_app/immutable/chunks/fybaL0A-.js +1 -0
- package/build/client/_app/immutable/chunks/gp-XZpBa.js +3 -0
- package/build/client/_app/immutable/chunks/h-p5ZdY8.js +1 -0
- package/build/client/_app/immutable/chunks/hxYEUgOo.js +1 -0
- package/build/client/_app/immutable/chunks/i0VQdJtv.js +1 -0
- package/build/client/_app/immutable/chunks/i0X4ZdIN.js +1 -0
- package/build/client/_app/immutable/chunks/mVHw7KEX.js +7 -0
- package/build/client/_app/immutable/chunks/nDMCpPkF.js +1 -0
- package/build/client/_app/immutable/chunks/nr791fC2.js +1 -0
- package/build/client/_app/immutable/chunks/onAF5SnQ.js +1 -0
- package/build/client/_app/immutable/chunks/oz_6vUea.js +1 -0
- package/build/client/_app/immutable/chunks/qEGLx2Wc.js +78 -0
- package/build/client/_app/immutable/chunks/raVGrKQy.js +44 -0
- package/build/client/_app/immutable/chunks/sBoK_t0W.js +1 -0
- package/build/client/_app/immutable/chunks/sIEmSkn6.js +34 -0
- package/build/client/_app/immutable/chunks/wFIeY1Cf.js +88 -0
- package/build/client/_app/immutable/chunks/xihTtKlq.js +1 -0
- package/build/client/_app/immutable/chunks/zpcgJjUg.js +127 -0
- package/build/client/_app/immutable/entry/app.B2QxMn0t.js +2 -0
- package/build/client/_app/immutable/entry/start.BR3A4iFi.js +1 -0
- package/build/client/_app/immutable/nodes/0.B_ZEZy7b.js +1 -0
- package/build/client/_app/immutable/nodes/1.By3Gd2cs.js +1 -0
- package/build/client/_app/immutable/nodes/2.1TAwiWw1.js +69 -0
- package/build/client/_app/immutable/workers/css.worker-DRH2OcAG.js +93 -0
- package/build/client/_app/immutable/workers/html.worker-DQLddT9h.js +506 -0
- package/build/client/_app/immutable/workers/json.worker-D_Dqrls5.js +62 -0
- package/build/client/_app/immutable/workers/settings-editor-worker-D9zwrD0f.js +30 -0
- package/build/client/_app/immutable/workers/ts.worker-DkYoA6bF.js +67738 -0
- package/build/client/_app/immutable/workers/yaml.worker-BTGFEDOA.js +449 -0
- package/build/client/_app/version.json +1 -0
- package/build/client/favicon.svg +7 -0
- package/build/env.js +70 -0
- package/build/handler.js +23 -0
- package/build/index.js +146 -0
- package/build/server/chunks/chunks/a2a-protocol.js-C77mVg2Q.js +52 -0
- package/build/server/chunks/chunks/app-config.svelte.js-Co9jacqT.js +52 -0
- package/build/server/chunks/chunks/config.js-BBYogCe7.js +123 -0
- package/build/server/chunks/chunks/db.js-DcmO3JAx.js +120 -0
- package/build/server/chunks/chunks/db2.js-DBltVUGg.js +717 -0
- package/build/server/chunks/chunks/dsh-connection.js-DwihVtk_.js +1957 -0
- package/build/server/chunks/chunks/dsh-events.js-BtDxaV6Q.js +706 -0
- package/build/server/chunks/chunks/env.js-l0sNRNKZ.js +2 -0
- package/build/server/chunks/chunks/exports.js-DMiPee3x.js +263 -0
- package/build/server/chunks/chunks/goal-projection.js-0_34t60K.js +44 -0
- package/build/server/chunks/chunks/image-limits.js-BMPZ55kJ.js +186 -0
- package/build/server/chunks/chunks/insight-config.js-CfMPTA6Z.js +352 -0
- package/build/server/chunks/chunks/internal.js-CQzEjdyk.js +747 -0
- package/build/server/chunks/chunks/internal2.js-D-DAuSVh.js +22 -0
- package/build/server/chunks/chunks/server.js-DoCd0fEo.js +4104 -0
- package/build/server/chunks/chunks/shared.js-C4-Py8s_.js +775 -0
- package/build/server/chunks/chunks/state.js-CpmOS0a2.js +114 -0
- package/build/server/chunks/chunks/uneval.js-BJ9Qq2SF.js +488 -0
- package/build/server/chunks/chunks/utils.js-tOWCe9Wk.js +933 -0
- package/build/server/chunks/chunks/watcher.js-BelxjMOP.js +473 -0
- package/build/server/chunks/entries/endpoints/api/a2a/_id_/_server.ts.js-B4HUNFZv.js +37 -0
- package/build/server/chunks/entries/endpoints/api/a2a/_server.ts.js-JDV_oqbX.js +61 -0
- package/build/server/chunks/entries/endpoints/api/a2a/register/_server.ts.js-Dxwc-7-5.js +99 -0
- package/build/server/chunks/entries/endpoints/api/config/_server.ts.js-D8i35bGH.js +35 -0
- package/build/server/chunks/entries/endpoints/api/dsh/directory/_server.ts.js-CeBU1G85.js +43 -0
- package/build/server/chunks/entries/endpoints/api/dsh/pick-directory/_server.ts.js-CyrVUxv3.js +36 -0
- package/build/server/chunks/entries/endpoints/api/dsh/presets/_server.ts.js-qeO_1htT.js +33 -0
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/attachment/_server.ts.js-DnHffohz.js +44 -0
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/cancel/_server.ts.js-fm6MFyjP.js +33 -0
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/catalog/_server.ts.js-wJ9V_Ue7.js +42 -0
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/command/_server.ts.js-o83L4GUY.js +85 -0
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/events/_server.ts.js-DLCHSC1M.js +212 -0
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/fork/_server.ts.js-Ca6NU9HO.js +58 -0
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/goal/_server.ts.js-RteR85vn.js +138 -0
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/history/_server.ts.js-CEKDkK7v.js +55 -0
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/models/_server.ts.js-D7ziyW3d.js +35 -0
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/permission/_server.ts.js-DbkD4JZb.js +92 -0
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/prompt/_server.ts.js-eOLNlf1-.js +94 -0
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/rename/_server.ts.js-txQRocK9.js +57 -0
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/respond/_server.ts.js-D3WGYzkE.js +69 -0
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/select-model/_server.ts.js-g2GtvLTs.js +69 -0
- package/build/server/chunks/entries/endpoints/api/dsh/sessions/_server.ts.js-17yKojU_.js +85 -0
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-file/_server.ts.js-D16pEhvd.js +99 -0
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-file/save/_server.ts.js-BXpZNLK8.js +110 -0
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-file-bytes/_server.ts.js-hBlyjq-x.js +113 -0
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-tree/_server.ts.js-KWRnsAkm.js +59 -0
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_server.ts.js-DzNvvCxK.js +55 -0
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/delete/_server.ts.js-MK5925CY.js +45 -0
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/rename/_server.ts.js-w3Mo0nf7.js +63 -0
- package/build/server/chunks/entries/endpoints/api/prompts/_id_/_server.ts.js-CInfjM-i.js +64 -0
- package/build/server/chunks/entries/endpoints/api/prompts/_server.ts.js-C1lqP1OV.js +87 -0
- package/build/server/chunks/entries/endpoints/api/prompts/use/_server.ts.js-B36YMKMt.js +54 -0
- package/build/server/chunks/entries/endpoints/api/settings/_server.ts.js-CHvHNzeB.js +101 -0
- package/build/server/chunks/entries/pages/_error.svelte.js-BE3-BWDd.js +41 -0
- package/build/server/chunks/entries/pages/_layout.svelte.js-EFiihTdF.js +18 -0
- package/build/server/chunks/entries/pages/_layout.ts.js-CNSo-Z1U.js +22 -0
- package/build/server/chunks/entries/pages/_page.server.ts.js-Bk8UuUXA.js +85 -0
- package/build/server/chunks/entries/pages/_page.svelte.js-CfmKQYLK.js +13883 -0
- package/build/server/chunks/handler-BshnD4Y4.js +1735 -0
- package/build/server/chunks/index.js-I_pMeIwQ.js +3864 -0
- package/build/server/chunks/manifest.js-DwhpAk_y.js +273 -0
- package/build/server/chunks/nodes/0.js-DCyDo8-C.js +12 -0
- package/build/server/chunks/nodes/1.js-Dx7z_VWN.js +9 -0
- package/build/server/chunks/nodes/2.js-CLw9pxho.js +24 -0
- package/build/shims.js +33 -0
- package/package.json +65 -0
- package/template/.dsi/a2a.sqlite +0 -0
- package/template/.dsi/config.json +42 -0
- package/template/.dsi/prompts.sqlite +0 -0
- package/template/.dsi/settings.yaml +33 -0
|
@@ -0,0 +1,706 @@
|
|
|
1
|
+
//#region src/lib/utils/truncate.ts
|
|
2
|
+
/**
|
|
3
|
+
* Cut `text` to at most `max` characters. `max` <= 0 returns the full text
|
|
4
|
+
* (max means "no limit" — documented contract, pinned by tests).
|
|
5
|
+
*/
|
|
6
|
+
function truncate(text, max) {
|
|
7
|
+
if (max <= 0 || text.length <= max) return {
|
|
8
|
+
head: text,
|
|
9
|
+
truncated: false,
|
|
10
|
+
cutChars: 0
|
|
11
|
+
};
|
|
12
|
+
return {
|
|
13
|
+
head: text.slice(0, max),
|
|
14
|
+
truncated: true,
|
|
15
|
+
cutChars: text.length - max
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/lib/services/conversation/dsh-events.ts
|
|
20
|
+
/**
|
|
21
|
+
* Internal harness markers that never render in the transcript: policy
|
|
22
|
+
* snapshots, turn/step bookkeeping, projections, retry plumbing. They are
|
|
23
|
+
* durable truth for the harness, noise for a conversation page.
|
|
24
|
+
*
|
|
25
|
+
* NOT silent since 2026-09-01: `request/header` carries the rendered system
|
|
26
|
+
* prompt (`header.system`) — transcript content in DSH's own Chat — and now
|
|
27
|
+
* maps to a `system-prompt` entry. `request/context` stays silent (route
|
|
28
|
+
* metadata, no user-visible text).
|
|
29
|
+
*/
|
|
30
|
+
var SILENT_TYPES = /* @__PURE__ */ new Set([
|
|
31
|
+
"agent-preset/selected",
|
|
32
|
+
"agent/inbox/spliced",
|
|
33
|
+
"approval/decided",
|
|
34
|
+
"approval/policy",
|
|
35
|
+
"approval/asked",
|
|
36
|
+
"command/done",
|
|
37
|
+
"command/run",
|
|
38
|
+
"compaction/end",
|
|
39
|
+
"compaction/prune",
|
|
40
|
+
"compaction/start",
|
|
41
|
+
"compaction/summary",
|
|
42
|
+
"feedback/record",
|
|
43
|
+
"goal/change",
|
|
44
|
+
"hook/invoked",
|
|
45
|
+
"hook/result",
|
|
46
|
+
"llm/retry",
|
|
47
|
+
"llm/retry-started",
|
|
48
|
+
"assistant/attempt",
|
|
49
|
+
"permission/preset",
|
|
50
|
+
"plan/mode",
|
|
51
|
+
"request/context",
|
|
52
|
+
"sandbox/mode",
|
|
53
|
+
"schedule/change",
|
|
54
|
+
"session",
|
|
55
|
+
"session/end-seed",
|
|
56
|
+
"session/title",
|
|
57
|
+
"session/title-llm-request",
|
|
58
|
+
"step/end",
|
|
59
|
+
"step/start",
|
|
60
|
+
"subagent/catalog",
|
|
61
|
+
"subagent/descriptor",
|
|
62
|
+
"team/member",
|
|
63
|
+
"team/message/delivered",
|
|
64
|
+
"team/message/queued",
|
|
65
|
+
"team/task",
|
|
66
|
+
"todo/write",
|
|
67
|
+
"turn/start",
|
|
68
|
+
"web/deepseek-search-llm-request"
|
|
69
|
+
]);
|
|
70
|
+
/** Stable bubble id for one assistant step (chunk merge key). */
|
|
71
|
+
function bubbleId(turn, step) {
|
|
72
|
+
return `a:${String(turn)}:${String(step)}`;
|
|
73
|
+
}
|
|
74
|
+
/** Extract validated image refs from a message content array (Wave 3 task
|
|
75
|
+
* 3.1). Wire shape: {type:'image', attachment:{attachmentId, mediaType,
|
|
76
|
+
* bytes, width, height, name?}} (ImageBlock). Structural validation at the
|
|
77
|
+
* wire boundary; malformed attachments are skipped, never guessed into
|
|
78
|
+
* shape. Returns undefined when none survive (lean payloads, text-only
|
|
79
|
+
* entries unchanged). */
|
|
80
|
+
function imageRefsOfContent(content) {
|
|
81
|
+
if (!Array.isArray(content)) return void 0;
|
|
82
|
+
const refs = [];
|
|
83
|
+
for (const part of content) {
|
|
84
|
+
if (!part || typeof part !== "object" || part.type !== "image") continue;
|
|
85
|
+
const attachment = part.attachment;
|
|
86
|
+
if (!attachment || typeof attachment !== "object") continue;
|
|
87
|
+
const ref = attachment;
|
|
88
|
+
if (typeof ref.attachmentId !== "string" || typeof ref.mediaType !== "string" || typeof ref.bytes !== "number" || typeof ref.width !== "number" || typeof ref.height !== "number") continue;
|
|
89
|
+
refs.push({
|
|
90
|
+
attachmentId: ref.attachmentId,
|
|
91
|
+
mediaType: ref.mediaType,
|
|
92
|
+
bytes: ref.bytes,
|
|
93
|
+
width: ref.width,
|
|
94
|
+
height: ref.height,
|
|
95
|
+
...typeof ref.name === "string" ? { name: ref.name } : {}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return refs.length > 0 ? refs : void 0;
|
|
99
|
+
}
|
|
100
|
+
/** Join the text parts of a message content array; non-text blocks ignored. */
|
|
101
|
+
function textOfContent(content) {
|
|
102
|
+
if (!Array.isArray(content)) return "";
|
|
103
|
+
const parts = [];
|
|
104
|
+
for (const part of content) if (part && typeof part === "object" && part.type === "text" && typeof part.text === "string") parts.push(part.text);
|
|
105
|
+
return parts.join("\n");
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Context-injection family detection (task 2.4; BC-11: fixture-pinned wire
|
|
109
|
+
* markers — tests/unit/fixtures/context-injection-sources.json, live rc.8
|
|
110
|
+
* ledger 2026-08-21). Harness-injected context user/messages carry a
|
|
111
|
+
* structural `source` marker; each producer has its own shape:
|
|
112
|
+
*
|
|
113
|
+
* runtime-context source = { kind:'plugin',
|
|
114
|
+
* plugin:'@deepseek-ai/dsh-system-prompt',
|
|
115
|
+
* form:'snapshot', sections:[…] }
|
|
116
|
+
* + text opens "Current runtime context."
|
|
117
|
+
* instructions source = { kind:'agent-instructions', form:'instructions',
|
|
118
|
+
* baseline, changes:[{action,set,scope,path,digest}] }
|
|
119
|
+
* (AGENTS.md workspace instructions)
|
|
120
|
+
* skill-catalog source = { kind:'skill-catalog', form:'catalog',
|
|
121
|
+
* entries:[{name,description}] }
|
|
122
|
+
* skill-invocation source = { kind:'skill-invocation', name,
|
|
123
|
+
* form:'instructions' }
|
|
124
|
+
* (the rendered <skill_content> body injected after a
|
|
125
|
+
* user-explicit skill load — SkillInvocationSource,
|
|
126
|
+
* dsh-skill; `name` is the invoked skill, surfaced as
|
|
127
|
+
* the chip label)
|
|
128
|
+
* compaction source = { kind:'plugin', plugin:'compact',
|
|
129
|
+
* compactionId, sourceCommandId? }
|
|
130
|
+
* (the /compact checkpoint replacement user/message —
|
|
131
|
+
* preamble + <compacted-summary> body —
|
|
132
|
+
* CompactionCheckpointSource, dsh-compaction/checkpoint;
|
|
133
|
+
* the full summary rides the message text, so the
|
|
134
|
+
* compaction/* lifecycle events stay silent)
|
|
135
|
+
*
|
|
136
|
+
* The family is OPEN (2026-08-31 audit): MessageSourceMap is
|
|
137
|
+
* merge-extensible and kind:'plugin' carries ANY plugin name. After the
|
|
138
|
+
* five tailored producers, detection falls through exactly the way DSH's
|
|
139
|
+
* own client does (ui-chat contextProvenance / message.ts):
|
|
140
|
+
*
|
|
141
|
+
* plugin source = { kind:'plugin', plugin:<name>, form? }
|
|
142
|
+
* (every other injecting plugin — tool-jobs notices,
|
|
143
|
+
* user-approval policy changes, hooks relays,
|
|
144
|
+
* time-context / tmux-context snapshots, …; the chip
|
|
145
|
+
* is NAMED after the wire plugin string)
|
|
146
|
+
* recall source = { kind:'session-reference', form:'recall',
|
|
147
|
+
* references:[{label,…}] }
|
|
148
|
+
* (cross-session context prepared by the host;
|
|
149
|
+
* named after the first reference label)
|
|
150
|
+
* injected any other non-'user' source kind
|
|
151
|
+
* (webhook notices, team messages, future kinds — the
|
|
152
|
+
* chip is NAMED after the wire kind string; an unknown
|
|
153
|
+
* producer stays visible, never a silent bubble)
|
|
154
|
+
*
|
|
155
|
+
* The 1.4-pinned fixture is the contract; the tailored producers require
|
|
156
|
+
* the STRUCTURAL marker (source.kind + producer-specific form/keys) —
|
|
157
|
+
* plain text that merely quotes the words never matches. Since the
|
|
158
|
+
* 2026-08-31 audit, everything else NON-'user' still surfaces as a
|
|
159
|
+
* fall-through chip (plugin name / recall label / kind string) instead of
|
|
160
|
+
* posing as the operator's own bubble; only kind:'user' and source-less
|
|
161
|
+
* messages stay ordinary bubbles.
|
|
162
|
+
*/
|
|
163
|
+
var RUNTIME_CONTEXT_PLUGIN = "@deepseek-ai/dsh-system-prompt";
|
|
164
|
+
var RUNTIME_CONTEXT_FORM = "snapshot";
|
|
165
|
+
var RUNTIME_CONTEXT_TEXT_PREFIX = "Current runtime context.";
|
|
166
|
+
function contextInjectionProducer(data) {
|
|
167
|
+
const source = data?.source;
|
|
168
|
+
if (!source || typeof source.kind !== "string") return void 0;
|
|
169
|
+
if (source.kind === "plugin") {
|
|
170
|
+
if (source.plugin === RUNTIME_CONTEXT_PLUGIN && source.form === RUNTIME_CONTEXT_FORM && textOfContent(data?.content).startsWith(RUNTIME_CONTEXT_TEXT_PREFIX)) return "runtime-context";
|
|
171
|
+
if (source.plugin === "compact") return "compaction";
|
|
172
|
+
return "plugin";
|
|
173
|
+
}
|
|
174
|
+
if (source.kind === "agent-instructions" && source.form === "instructions") return "instructions";
|
|
175
|
+
if (source.kind === "skill-catalog" && source.form === "catalog") return "skill-catalog";
|
|
176
|
+
if (source.kind === "skill-invocation" && source.form === "instructions") return "skill-invocation";
|
|
177
|
+
if (source.kind === "session-reference") return "recall";
|
|
178
|
+
if (source.kind !== "user") return "injected";
|
|
179
|
+
}
|
|
180
|
+
/** tool/call display summary: harness view title when present, else the raw
|
|
181
|
+
* args truncated through the shared util (task 2.1 promotion — single
|
|
182
|
+
* truncation implementation; marker-less head, the chip owns affordances). */
|
|
183
|
+
function callSummary(event, argumentsRaw) {
|
|
184
|
+
const title = event.view?.view?.title;
|
|
185
|
+
if (typeof title === "string" && title.length > 0) return title;
|
|
186
|
+
const { head, truncated } = truncate(argumentsRaw, 120);
|
|
187
|
+
if (head.length > 0) return truncated ? `${head}…` : head;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Map ONE raw event to its DsiEntry (or null when it renders nothing).
|
|
191
|
+
*
|
|
192
|
+
* Streaming bubbles are STORE state (applyLiveStream), never mapper output:
|
|
193
|
+
* the live tail is seq-less and arrives beside the durable events, not as
|
|
194
|
+
* one.
|
|
195
|
+
*/
|
|
196
|
+
function entryForEvent(event) {
|
|
197
|
+
if (SILENT_TYPES.has(event.type)) return null;
|
|
198
|
+
const data = event.data;
|
|
199
|
+
if (data === void 0) return {
|
|
200
|
+
kind: "unknown-event",
|
|
201
|
+
id: `ev:${event.seq}`,
|
|
202
|
+
seq: event.seq,
|
|
203
|
+
time: event.time,
|
|
204
|
+
eventType: event.type
|
|
205
|
+
};
|
|
206
|
+
switch (event.type) {
|
|
207
|
+
case "system/message": {
|
|
208
|
+
const message = data?.message;
|
|
209
|
+
const text = textOfContent(message?.content);
|
|
210
|
+
if (typeof text !== "string" || text.length === 0) return null;
|
|
211
|
+
return {
|
|
212
|
+
kind: "system-prompt",
|
|
213
|
+
id: `sp:${event.seq}`,
|
|
214
|
+
seq: event.seq,
|
|
215
|
+
time: event.time,
|
|
216
|
+
text
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
case "request/header": {
|
|
220
|
+
const system = (data?.header)?.system;
|
|
221
|
+
if (typeof system !== "string" || system.length === 0) return null;
|
|
222
|
+
return {
|
|
223
|
+
kind: "system-prompt",
|
|
224
|
+
id: `sp:${event.seq}`,
|
|
225
|
+
seq: event.seq,
|
|
226
|
+
time: event.time,
|
|
227
|
+
text: system
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
case "user/message": {
|
|
231
|
+
const text = textOfContent(data?.content);
|
|
232
|
+
const id = typeof data?.id === "string" ? `u:${data.id}` : `u:seq:${event.seq}`;
|
|
233
|
+
const imageRefs = imageRefsOfContent(data?.content);
|
|
234
|
+
const producer = contextInjectionProducer(data);
|
|
235
|
+
if (producer) {
|
|
236
|
+
const src = data.source;
|
|
237
|
+
return {
|
|
238
|
+
kind: "user-message",
|
|
239
|
+
id,
|
|
240
|
+
seq: event.seq,
|
|
241
|
+
time: event.time,
|
|
242
|
+
text,
|
|
243
|
+
meta: producer,
|
|
244
|
+
...src !== void 0 ? { metaSource: src } : {},
|
|
245
|
+
...imageRefs !== void 0 ? { imageRefs } : {}
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
return {
|
|
249
|
+
kind: "user-message",
|
|
250
|
+
id,
|
|
251
|
+
seq: event.seq,
|
|
252
|
+
time: event.time,
|
|
253
|
+
text,
|
|
254
|
+
...imageRefs !== void 0 ? { imageRefs } : {}
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
case "assistant/message": {
|
|
258
|
+
const message = data?.message;
|
|
259
|
+
const reasoning = firstOfType(message?.content, "reasoning");
|
|
260
|
+
const reasoningText = typeof reasoning?.text === "string" && reasoning.text.length > 0 ? reasoning.text : void 0;
|
|
261
|
+
const source = message?.source;
|
|
262
|
+
const usage = usageOf(data?.usage, source);
|
|
263
|
+
return {
|
|
264
|
+
kind: "assistant-message",
|
|
265
|
+
id: bubbleId(data?.turn, data?.step),
|
|
266
|
+
seq: event.seq,
|
|
267
|
+
time: event.time,
|
|
268
|
+
text: textOfContent(message?.content),
|
|
269
|
+
streaming: false,
|
|
270
|
+
...reasoningText !== void 0 ? {
|
|
271
|
+
reasoning: reasoningText,
|
|
272
|
+
reasoningStreaming: false
|
|
273
|
+
} : {},
|
|
274
|
+
...usage !== void 0 ? { usage } : {}
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
case "turn/end": {
|
|
278
|
+
const reason = data?.reason;
|
|
279
|
+
if (reason?.kind !== "error") return null;
|
|
280
|
+
const message = readStr(reason.error?.message) ?? "turn ended with an error";
|
|
281
|
+
return {
|
|
282
|
+
kind: "turn-error",
|
|
283
|
+
id: `te:${event.seq}`,
|
|
284
|
+
seq: event.seq,
|
|
285
|
+
time: event.time,
|
|
286
|
+
message,
|
|
287
|
+
...readStr(reason.error?.code) !== void 0 ? { code: readStr(reason.error?.code) } : {}
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
case "tool/ptc-dispatch-start":
|
|
291
|
+
case "tool/ptc-dispatch": {
|
|
292
|
+
const parentCallId = readStr(data?.parentCallId);
|
|
293
|
+
const subCallId = readStr(data?.subCallId);
|
|
294
|
+
if (parentCallId === void 0 || subCallId === void 0) return null;
|
|
295
|
+
const args = data?.arguments;
|
|
296
|
+
return {
|
|
297
|
+
kind: "code-dispatch",
|
|
298
|
+
id: `cd:${subCallId}`,
|
|
299
|
+
seq: event.seq,
|
|
300
|
+
time: event.time,
|
|
301
|
+
parentCallId,
|
|
302
|
+
subCallId,
|
|
303
|
+
name: readStr(data?.name) ?? "tool",
|
|
304
|
+
...args !== void 0 ? { argsRaw: JSON.stringify(args) } : {},
|
|
305
|
+
settled: event.type === "tool/ptc-dispatch",
|
|
306
|
+
...event.type === "tool/ptc-dispatch" ? {
|
|
307
|
+
isError: data?.isError === true,
|
|
308
|
+
contentText: textOfContent(data?.content) || void 0
|
|
309
|
+
} : {}
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
case "tool/call": {
|
|
313
|
+
const callId = readStr(data?.callId) ?? `seq:${event.seq}`;
|
|
314
|
+
const argsRaw = readStr(data?.arguments);
|
|
315
|
+
return {
|
|
316
|
+
kind: "tool-call",
|
|
317
|
+
id: `tc:${callId}`,
|
|
318
|
+
seq: event.seq,
|
|
319
|
+
time: event.time,
|
|
320
|
+
callId,
|
|
321
|
+
toolName: readStr(data?.name) ?? "tool",
|
|
322
|
+
summary: callSummary(event, argsRaw ?? ""),
|
|
323
|
+
argsRaw,
|
|
324
|
+
status: "pending"
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
case "tool-workflow/run-start": {
|
|
328
|
+
const runId = readStr(data?.runId) ?? `seq:${event.seq}`;
|
|
329
|
+
return {
|
|
330
|
+
kind: "workflow-run",
|
|
331
|
+
id: `wf:${runId}`,
|
|
332
|
+
seq: event.seq,
|
|
333
|
+
time: event.time,
|
|
334
|
+
runId,
|
|
335
|
+
name: readStr(data?.name) ?? "workflow",
|
|
336
|
+
status: "running",
|
|
337
|
+
agents: []
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
case "tool-workflow/agent-start": {
|
|
341
|
+
const runId = readStr(data?.runId) ?? `seq:${event.seq}`;
|
|
342
|
+
const memberSeq = typeof data?.seq === "number" ? data.seq : -1;
|
|
343
|
+
const phase = readStr(data?.phase);
|
|
344
|
+
return {
|
|
345
|
+
kind: "workflow-run",
|
|
346
|
+
id: `wf:${runId}`,
|
|
347
|
+
seq: event.seq,
|
|
348
|
+
time: event.time,
|
|
349
|
+
runId,
|
|
350
|
+
name: "",
|
|
351
|
+
status: "running",
|
|
352
|
+
agents: [{
|
|
353
|
+
seq: memberSeq,
|
|
354
|
+
label: readStr(data?.label) ?? `agent ${memberSeq}`,
|
|
355
|
+
childId: readStr(data?.childId) ?? "",
|
|
356
|
+
...phase !== void 0 ? { phase } : {},
|
|
357
|
+
status: "running",
|
|
358
|
+
startedAt: event.time
|
|
359
|
+
}]
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
case "tool-workflow/agent-end": {
|
|
363
|
+
const runId = readStr(data?.runId) ?? `seq:${event.seq}`;
|
|
364
|
+
const memberSeq = typeof data?.seq === "number" ? data.seq : -1;
|
|
365
|
+
const outcome = readStr(data?.outcome);
|
|
366
|
+
return {
|
|
367
|
+
kind: "workflow-run",
|
|
368
|
+
id: `wf:${runId}`,
|
|
369
|
+
seq: event.seq,
|
|
370
|
+
time: event.time,
|
|
371
|
+
runId,
|
|
372
|
+
name: "",
|
|
373
|
+
status: "running",
|
|
374
|
+
agents: [{
|
|
375
|
+
seq: memberSeq,
|
|
376
|
+
label: "",
|
|
377
|
+
childId: "",
|
|
378
|
+
status: outcome === "completed" || outcome === "failed" ? outcome : "cancelled",
|
|
379
|
+
startedAt: 0,
|
|
380
|
+
endedAt: event.time
|
|
381
|
+
}]
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
case "tool-workflow/run-end": {
|
|
385
|
+
const runId = readStr(data?.runId) ?? `seq:${event.seq}`;
|
|
386
|
+
const stopReason = readStr(data?.stopReason);
|
|
387
|
+
return {
|
|
388
|
+
kind: "workflow-run",
|
|
389
|
+
id: `wf:${runId}`,
|
|
390
|
+
seq: event.seq,
|
|
391
|
+
time: event.time,
|
|
392
|
+
runId,
|
|
393
|
+
name: "",
|
|
394
|
+
status: stopReason === "completed" ? "completed" : stopReason === "error" ? "failed" : "cancelled",
|
|
395
|
+
agents: []
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
case "tool/result": {
|
|
399
|
+
const message = data?.message;
|
|
400
|
+
const callId = readStr(message?.source?.callId) ?? `seq:${event.seq}`;
|
|
401
|
+
const resultPart = firstOfType(message?.content, "tool-result");
|
|
402
|
+
const resultText = textOfContent(resultPart?.content) || void 0;
|
|
403
|
+
return {
|
|
404
|
+
kind: "tool-result",
|
|
405
|
+
id: `tr:${callId}`,
|
|
406
|
+
seq: event.seq,
|
|
407
|
+
time: event.time,
|
|
408
|
+
callId,
|
|
409
|
+
toolName: "",
|
|
410
|
+
ok: !resultPart || resultPart.isError !== true,
|
|
411
|
+
summary: resultText,
|
|
412
|
+
resultText,
|
|
413
|
+
...readViewFrom(event.view) !== void 0 ? { readView: readViewFrom(event.view) } : {}
|
|
414
|
+
};
|
|
415
|
+
}
|
|
416
|
+
default: return {
|
|
417
|
+
kind: "unknown-event",
|
|
418
|
+
id: `ev:${event.seq}`,
|
|
419
|
+
seq: event.seq,
|
|
420
|
+
time: event.time,
|
|
421
|
+
eventType: event.type
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
/** Read a wire TokenUsage (assistant/message.data.usage) into its DSI
|
|
426
|
+
* shape — structural and conservative: a non-numeric inputTokens declines
|
|
427
|
+
* to undefined (the event carries no accounting). 2026-08-23. Route
|
|
428
|
+
* attribution rides message.source when both parts are non-empty
|
|
429
|
+
* (2026-09-09, DSH turn-usage parity). */
|
|
430
|
+
function usageOf(v, source) {
|
|
431
|
+
const u = v;
|
|
432
|
+
if (u === void 0 || typeof u.inputTokens !== "number" || typeof u.outputTokens !== "number") return;
|
|
433
|
+
const opt = (n) => typeof n === "number" ? n : void 0;
|
|
434
|
+
const provider = typeof source?.provider === "string" && source.provider.length > 0 ? source.provider : void 0;
|
|
435
|
+
const model = typeof source?.model === "string" && source.model.length > 0 ? source.model : void 0;
|
|
436
|
+
return {
|
|
437
|
+
inputTokens: u.inputTokens,
|
|
438
|
+
outputTokens: u.outputTokens,
|
|
439
|
+
...opt(u.cacheReadTokens) !== void 0 ? { cacheReadTokens: opt(u.cacheReadTokens) } : {},
|
|
440
|
+
...opt(u.cacheWriteTokens) !== void 0 ? { cacheWriteTokens: opt(u.cacheWriteTokens) } : {},
|
|
441
|
+
...opt(u.reasoningTokens) !== void 0 ? { reasoningTokens: opt(u.reasoningTokens) } : {},
|
|
442
|
+
...provider !== void 0 && model !== void 0 ? {
|
|
443
|
+
provider,
|
|
444
|
+
model
|
|
445
|
+
} : {}
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
function readStr(v) {
|
|
449
|
+
return typeof v === "string" && v.length > 0 ? v : void 0;
|
|
450
|
+
}
|
|
451
|
+
function firstOfType(content, type) {
|
|
452
|
+
if (!Array.isArray(content)) return void 0;
|
|
453
|
+
return content.find((p) => p?.type === type);
|
|
454
|
+
}
|
|
455
|
+
/** Normalize a read-result presentation view (tool/result view.card ===
|
|
456
|
+
* 'read') into DsiReadView. Structural and conservative: any malformed
|
|
457
|
+
* member declines to undefined (the flat resultText path stays). BC-11:
|
|
458
|
+
* the shape is read from the harness's own projection, never re-derived
|
|
459
|
+
* by guessing at arguments. 2026-08-22. */
|
|
460
|
+
function readViewFrom(view) {
|
|
461
|
+
const v = view?.view;
|
|
462
|
+
if (v === void 0 || v.card !== "read") return void 0;
|
|
463
|
+
const path = readStr(v.path);
|
|
464
|
+
if (path === void 0) return void 0;
|
|
465
|
+
const offset = v.offset;
|
|
466
|
+
const totalLines = v.totalLines;
|
|
467
|
+
const lines = v.lines;
|
|
468
|
+
if (typeof offset !== "number" || typeof totalLines !== "number" || !Array.isArray(lines)) return void 0;
|
|
469
|
+
const out = [];
|
|
470
|
+
for (const l of lines) {
|
|
471
|
+
const line = l;
|
|
472
|
+
if (typeof line?.number !== "number" || typeof line?.text !== "string") return void 0;
|
|
473
|
+
out.push({
|
|
474
|
+
number: line.number,
|
|
475
|
+
text: line.text
|
|
476
|
+
});
|
|
477
|
+
}
|
|
478
|
+
const lang = readStr(v.lang);
|
|
479
|
+
return {
|
|
480
|
+
path,
|
|
481
|
+
offset,
|
|
482
|
+
totalLines,
|
|
483
|
+
lines: out,
|
|
484
|
+
...lang !== void 0 ? { lang } : {}
|
|
485
|
+
};
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Merge incoming DsiEntry deltas into an existing list (id-keyed, idempotent):
|
|
489
|
+
*
|
|
490
|
+
* assistant-message, same id, finalized — REPLACES (the assembled message
|
|
491
|
+
* is authoritative over any streamed prefix, text AND reasoning; this
|
|
492
|
+
* is how the durable assistant/message finalizes the live-tail bubble
|
|
493
|
+
* folded by the store's applyLiveStream);
|
|
494
|
+
* any other kind, known id — ignored (retransmit);
|
|
495
|
+
* unknown id — appended.
|
|
496
|
+
*
|
|
497
|
+
* (Ledger v2 removed the durable chunk events whose fragments CONCAT'ed
|
|
498
|
+
* here while streaming; the live tail carries the full accumulation each
|
|
499
|
+
* poll and replaces wholesale in the store, outside this merge.)
|
|
500
|
+
*
|
|
501
|
+
* Tool lifecycle (Wave 1, task 1.2): tool/call is born status:'pending';
|
|
502
|
+
* a paired tool/result flips it to pass/fail (result.ok, i.e. isError on the
|
|
503
|
+
* wire) and carries durationMs = result.time − call.time — both directions of
|
|
504
|
+
* arrival (cold load has call+result together; polls may deliver result into
|
|
505
|
+
* a list that already holds the call). An orphan result (no call in the list)
|
|
506
|
+
* keeps its honest state: name unknown → 'tool', duration undefined.
|
|
507
|
+
*
|
|
508
|
+
* Also pairs tool-result entries with their tool-call by callId (fills
|
|
509
|
+
* toolName). Server cold load and client poll deltas share these rules.
|
|
510
|
+
*/
|
|
511
|
+
function mergeEntries(existing, incoming) {
|
|
512
|
+
const merged = existing.map((e) => ({ ...e }));
|
|
513
|
+
for (const entry of incoming) {
|
|
514
|
+
const at = merged.findIndex((e) => e.id === entry.id);
|
|
515
|
+
if (at === -1) {
|
|
516
|
+
merged.push({ ...entry });
|
|
517
|
+
continue;
|
|
518
|
+
}
|
|
519
|
+
const candidate = merged[at];
|
|
520
|
+
if (candidate.kind === "workflow-run" && entry.kind === "workflow-run") {
|
|
521
|
+
merged[at] = mergeWorkflowRun(candidate, entry);
|
|
522
|
+
continue;
|
|
523
|
+
}
|
|
524
|
+
if (candidate.kind === "code-dispatch" && entry.kind === "code-dispatch") {
|
|
525
|
+
if (entry.argsRaw !== void 0) candidate.argsRaw = entry.argsRaw;
|
|
526
|
+
candidate.time = entry.time > candidate.time ? entry.time : candidate.time;
|
|
527
|
+
if (entry.settled) {
|
|
528
|
+
candidate.settled = true;
|
|
529
|
+
candidate.isError = entry.isError;
|
|
530
|
+
candidate.contentText = entry.contentText;
|
|
531
|
+
}
|
|
532
|
+
continue;
|
|
533
|
+
}
|
|
534
|
+
const prev = candidate;
|
|
535
|
+
if (prev.kind === "assistant-message" && entry.kind === "assistant-message") {
|
|
536
|
+
if (!entry.streaming) {
|
|
537
|
+
const next = { ...entry };
|
|
538
|
+
if (next.reasoning === void 0 && prev.reasoning !== void 0) {
|
|
539
|
+
next.reasoning = prev.reasoning;
|
|
540
|
+
next.reasoningStreaming = false;
|
|
541
|
+
}
|
|
542
|
+
if (next.text === "") next.text = prev.text;
|
|
543
|
+
merged[at] = next;
|
|
544
|
+
}
|
|
545
|
+
continue;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
const calls = /* @__PURE__ */ new Map();
|
|
549
|
+
for (const e of merged) if (e.kind === "tool-call") calls.set(e.callId, e);
|
|
550
|
+
for (const e of merged) {
|
|
551
|
+
if (e.kind !== "tool-result") continue;
|
|
552
|
+
const call = calls.get(e.callId);
|
|
553
|
+
if (call) {
|
|
554
|
+
if (!e.toolName || e.toolName === "" || e.toolName === "tool") e.toolName = call.toolName;
|
|
555
|
+
if (!e.durationMs && e.time >= call.time) e.durationMs = e.time - call.time;
|
|
556
|
+
}
|
|
557
|
+
if (!e.toolName || e.toolName === "") e.toolName = "tool";
|
|
558
|
+
if (call && call.status === "pending") call.status = e.ok ? "pass" : "fail";
|
|
559
|
+
}
|
|
560
|
+
foldCodeDispatches(merged);
|
|
561
|
+
return merged;
|
|
562
|
+
}
|
|
563
|
+
/**
|
|
564
|
+
* Fold `code-dispatch` partials onto their parent tool-call entries
|
|
565
|
+
* (ADR D1/D2, 2026-09-05). Start and settled partials merge by subCallId —
|
|
566
|
+
* a settle fills content/isError and never un-settles; a late start after a
|
|
567
|
+
* settle keeps the settle's facts. Entries fold by parentCallId → the call's
|
|
568
|
+
* `dispatches` list in `<n>` submission order. Orphans (no parent call in
|
|
569
|
+
* the list) are dropped — the fold never guesses a parent. Idempotent:
|
|
570
|
+
* retransmitted partials rewrite the same facts; the folded entry carries
|
|
571
|
+
* fresh arrays, so re-running never aliases a prior list.
|
|
572
|
+
*/
|
|
573
|
+
function foldCodeDispatches(entries) {
|
|
574
|
+
const bySub = /* @__PURE__ */ new Map();
|
|
575
|
+
for (const e of entries) {
|
|
576
|
+
if (e.kind !== "code-dispatch") continue;
|
|
577
|
+
const prev = bySub.get(e.subCallId);
|
|
578
|
+
if (prev === void 0) {
|
|
579
|
+
bySub.set(e.subCallId, e);
|
|
580
|
+
continue;
|
|
581
|
+
}
|
|
582
|
+
prev.time = e.time > prev.time ? e.time : prev.time;
|
|
583
|
+
if (e.argsRaw !== void 0) prev.argsRaw = e.argsRaw;
|
|
584
|
+
if (e.settled) {
|
|
585
|
+
prev.settled = true;
|
|
586
|
+
prev.isError = e.isError;
|
|
587
|
+
prev.contentText = e.contentText;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
if (bySub.size === 0) return;
|
|
591
|
+
const calls = /* @__PURE__ */ new Map();
|
|
592
|
+
for (const e of entries) if (e.kind === "tool-call") calls.set(e.callId, e);
|
|
593
|
+
const grouped = /* @__PURE__ */ new Map();
|
|
594
|
+
for (const d of bySub.values()) {
|
|
595
|
+
const list = grouped.get(d.parentCallId) ?? [];
|
|
596
|
+
list.push(d);
|
|
597
|
+
grouped.set(d.parentCallId, list);
|
|
598
|
+
}
|
|
599
|
+
const orderOf = (subCallId) => {
|
|
600
|
+
const m = /:(?:code|ptc):(\d+)$/.exec(subCallId);
|
|
601
|
+
return m !== null ? Number(m[1]) : Number.MAX_SAFE_INTEGER;
|
|
602
|
+
};
|
|
603
|
+
for (const [parentCallId, list] of grouped) {
|
|
604
|
+
list.sort((a, b) => orderOf(a.subCallId) - orderOf(b.subCallId));
|
|
605
|
+
const call = calls.get(parentCallId);
|
|
606
|
+
if (call === void 0) continue;
|
|
607
|
+
const kept = new Map(call.dispatches?.map((d) => [d.subCallId, d]) ?? []);
|
|
608
|
+
const next = [];
|
|
609
|
+
const seen = /* @__PURE__ */ new Set();
|
|
610
|
+
for (const d of list) {
|
|
611
|
+
seen.add(d.subCallId);
|
|
612
|
+
const k = kept.get(d.subCallId);
|
|
613
|
+
const winner = d.settled ? d : k?.settled ? k : d;
|
|
614
|
+
next.push({
|
|
615
|
+
subCallId: d.subCallId,
|
|
616
|
+
name: d.name,
|
|
617
|
+
...winner.argsRaw !== void 0 ? { argsRaw: winner.argsRaw } : k?.argsRaw !== void 0 ? { argsRaw: k.argsRaw } : {},
|
|
618
|
+
settled: d.settled || (k?.settled ?? false),
|
|
619
|
+
...winner.isError !== void 0 ? { isError: winner.isError } : {},
|
|
620
|
+
...winner.contentText !== void 0 ? { contentText: winner.contentText } : {}
|
|
621
|
+
});
|
|
622
|
+
}
|
|
623
|
+
for (const d of kept.values()) if (!seen.has(d.subCallId)) next.push({ ...d });
|
|
624
|
+
next.sort((a, b) => orderOf(a.subCallId) - orderOf(b.subCallId));
|
|
625
|
+
call.dispatches = next;
|
|
626
|
+
}
|
|
627
|
+
for (let i = entries.length - 1; i >= 0; i--) if (entries[i].kind === "code-dispatch") entries.splice(i, 1);
|
|
628
|
+
}
|
|
629
|
+
/** Full ledger tail → merged render list (cold load; BC-4 reads the ledger). */
|
|
630
|
+
function eventsToEntries(events) {
|
|
631
|
+
return collapseSystemPromptEntries(mergeEntries([], events.map(entryForEvent).filter((e) => e !== null)));
|
|
632
|
+
}
|
|
633
|
+
/**
|
|
634
|
+
* Collapse repeated `system-prompt` entries to one row per DISTINCT text
|
|
635
|
+
* (2026-09-01): a request/header is appended per epoch — initial, resume,
|
|
636
|
+
* change, series — so an uncollapsed transcript would repeat the identical
|
|
637
|
+
* "System prompt" row after every host restart or tools-only header bump.
|
|
638
|
+
* DSH's own Chat decides per header (`showsPrompt`); DSI cannot, because
|
|
639
|
+
* scroll-up pages map through fresh calls with no earlier-page state — so
|
|
640
|
+
* the rule is textual and stateless: keep a system-prompt row only when its
|
|
641
|
+
* text differs from the last KEPT one. Pure, order-preserving, idempotent;
|
|
642
|
+
* safe to re-run at every merge point (mapped batches, client deltas,
|
|
643
|
+
* prepended older pages).
|
|
644
|
+
*/
|
|
645
|
+
function collapseSystemPromptEntries(entries) {
|
|
646
|
+
let lastKept;
|
|
647
|
+
const out = [];
|
|
648
|
+
for (const e of entries) {
|
|
649
|
+
if (e.kind === "system-prompt") {
|
|
650
|
+
if (e.text === lastKept) continue;
|
|
651
|
+
lastKept = e.text;
|
|
652
|
+
}
|
|
653
|
+
out.push(e);
|
|
654
|
+
}
|
|
655
|
+
return out;
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* Fold ONE workflow-run partial into the running entry (2026-08-31).
|
|
659
|
+
* Partials carry only what their event proved — run-start owns the name,
|
|
660
|
+
* agent-start appends a member, agent-end settles a member by its member
|
|
661
|
+
* seq (label/childId are NEVER overwritten by a settle partial's empty
|
|
662
|
+
* strings), run-end sets the terminal status. Idempotent: a retransmitted
|
|
663
|
+
* partial rewrites the same facts; a running status never un-settles a
|
|
664
|
+
* terminal one.
|
|
665
|
+
*/
|
|
666
|
+
function mergeWorkflowRun(prev, incoming) {
|
|
667
|
+
const agents = [...prev.agents];
|
|
668
|
+
for (const a of incoming.agents) {
|
|
669
|
+
const at = agents.findIndex((x) => x.seq === a.seq);
|
|
670
|
+
if (at === -1) {
|
|
671
|
+
agents.push({ ...a });
|
|
672
|
+
continue;
|
|
673
|
+
}
|
|
674
|
+
agents[at] = {
|
|
675
|
+
...agents[at],
|
|
676
|
+
label: agents[at].label === "" && a.label !== "" ? a.label : agents[at].label,
|
|
677
|
+
childId: agents[at].childId === "" && a.childId !== "" ? a.childId : agents[at].childId,
|
|
678
|
+
startedAt: agents[at].startedAt > 0 ? agents[at].startedAt : a.startedAt,
|
|
679
|
+
status: a.status !== "running" ? a.status : agents[at].status,
|
|
680
|
+
...a.phase !== void 0 ? { phase: a.phase } : {},
|
|
681
|
+
...a.endedAt !== void 0 ? { endedAt: a.endedAt } : {}
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
return {
|
|
685
|
+
...prev,
|
|
686
|
+
seq: Math.max(prev.seq, incoming.seq),
|
|
687
|
+
time: Math.max(prev.time, incoming.time),
|
|
688
|
+
name: prev.name !== "" ? prev.name : incoming.name,
|
|
689
|
+
status: incoming.status !== "running" ? incoming.status : prev.status,
|
|
690
|
+
agents
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
/** Ledger HistoryEntry[] → raw events with their presentation views carried
|
|
694
|
+
* (2026-08-22): the harness attaches `view` BESIDE `event` on each history
|
|
695
|
+
* entry — a plain `.map((h) => h.event)` drops it, and the read-result file
|
|
696
|
+
* rendering lost its typed data. Views merge shallowly; the event's own
|
|
697
|
+
* member (if a wire ever carries one) wins. */
|
|
698
|
+
function historyToEvents(history) {
|
|
699
|
+
return history.map((h) => h.view === void 0 || h.event.view !== void 0 ? h.event : {
|
|
700
|
+
...h.event,
|
|
701
|
+
view: h.view
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
export { entryForEvent as a, collapseSystemPromptEntries as c, eventsToEntries as e, historyToEvents as h, mergeEntries as m, truncate as t };
|
|
706
|
+
//# sourceMappingURL=dsh-events.js-BtDxaV6Q.js.map
|