@deepseek-insight/dsi 0.6.12 → 0.6.14
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/.agents/skills/dsi-thin/SKILL.md +140 -0
- package/.agents/skills/dsi-thin/references/ADR-0019-snapshot.md +363 -0
- package/.agents/skills/dsi-thin/references/authority-adr.md +28 -0
- package/.agents/skills/dsi-thin/references/input-contract.md +42 -0
- package/.agents/skills/dsi-thin/references/proven-gates.md +61 -0
- package/.agents/skills/dsi-thin/references/two-lane-contract.md +53 -0
- package/build/client/_app/immutable/assets/0.B-dIufDc.css +2 -0
- package/build/client/_app/immutable/assets/2.B70dfiy3.css +1 -0
- package/build/client/_app/immutable/chunks/{B9fOkvHb.js → 0HT0ILkA.js} +1 -1
- package/build/client/_app/immutable/chunks/{Dwt_JXeR.js → 2KTqoQH-.js} +1 -1
- package/build/client/_app/immutable/chunks/{BIvFR1xA.js → 2M1KS72j.js} +1 -1
- package/build/client/_app/immutable/chunks/{a1Hqq5w-.js → 2XtVrxH4.js} +1 -1
- package/build/client/_app/immutable/chunks/38H6DLwz.js +1 -0
- package/build/client/_app/immutable/chunks/{Cdn_bzx2.js → 3E8jbhSl.js} +1 -1
- package/build/client/_app/immutable/chunks/{CmNEu9LM.js → A5Iiq81h.js} +1 -1
- package/build/client/_app/immutable/chunks/{C48u-2qp.js → ANnPTMPF.js} +1 -1
- package/build/client/_app/immutable/chunks/{BfChGCnE.js → B5S0Wke9.js} +1 -1
- package/build/client/_app/immutable/chunks/BBDOLPkB.js +1 -0
- package/build/client/_app/immutable/chunks/{DJ36HFmi.js → BImoJlJo.js} +1 -1
- package/build/client/_app/immutable/chunks/{DqRXQwgi.js → BJsp4NMH.js} +1 -1
- package/build/client/_app/immutable/chunks/{C7a8i7sD.js → BKU5-8Td.js} +1 -1
- package/build/client/_app/immutable/chunks/BMgyB-Sy.js +1 -0
- package/build/client/_app/immutable/chunks/BYHxHjHc.js +1 -0
- package/build/client/_app/immutable/chunks/{BC5nqwvj.js → BZ6uvzU8.js} +1 -1
- package/build/client/_app/immutable/chunks/{CvjdFV1E.js → B_Gknb5_.js} +1 -1
- package/build/client/_app/immutable/chunks/{CDTTZjYW.js → Bf1I5ROF.js} +1 -1
- package/build/client/_app/immutable/chunks/{CaAId7nh.js → Bh_Z0-Fh.js} +1 -1
- package/build/client/_app/immutable/chunks/{CLvIgAhR.js → BjafRUyA.js} +1 -1
- package/build/client/_app/immutable/chunks/{CG77uzLI.js → Bq4mG8qS.js} +1 -1
- package/build/client/_app/immutable/chunks/{CI1tkkzb.js → BqX9BB0G.js} +1 -1
- package/build/client/_app/immutable/chunks/BwNsQhd8.js +1 -0
- package/build/client/_app/immutable/chunks/{CvWnUnS1.js → Bx68-tOf.js} +1 -1
- package/build/client/_app/immutable/chunks/{RIIj2qfU.js → C1dC47iq.js} +1 -1
- package/build/client/_app/immutable/chunks/{BNx4_m7U.js → C6zqVyWx.js} +1 -1
- package/build/client/_app/immutable/chunks/{GLtnCmfd.js → C8seIiU_.js} +1 -1
- package/build/client/_app/immutable/chunks/{B_6pr4k2.js → CCWXLdgd.js} +1 -1
- package/build/client/_app/immutable/chunks/{D5ecapQY.js → CHYEvS-6.js} +1 -1
- package/build/client/_app/immutable/chunks/{OVDjSnH6.js → CIH5Juz4.js} +1 -1
- package/build/client/_app/immutable/chunks/CMByLjfJ.js +1 -0
- package/build/client/_app/immutable/chunks/{CnAA0dO8.js → CNJYmM8n.js} +1 -1
- package/build/client/_app/immutable/chunks/CP4wchdA.js +2 -0
- package/build/client/_app/immutable/chunks/{B2hm1w7K.js → CQTGR8fW.js} +1 -1
- package/build/client/_app/immutable/chunks/{Bp4vT1Ke.js → CW2uYEvb.js} +1 -1
- package/build/client/_app/immutable/chunks/{BPFR73BS.js → C_Gd0Wor.js} +1 -1
- package/build/client/_app/immutable/chunks/{Dn4fSUjR.js → C_MwBDNt.js} +1 -1
- package/build/client/_app/immutable/chunks/{Dea0pTfN.js → Ch7rc-L7.js} +4 -4
- package/build/client/_app/immutable/chunks/{J3KpJGd_.js → ChC4viXw.js} +1 -1
- package/build/client/_app/immutable/chunks/{4pCoNSa4.js → CiLhSVIj.js} +1 -1
- package/build/client/_app/immutable/chunks/{C7iYNw8X.js → Cx8YXmgi.js} +1 -1
- package/build/client/_app/immutable/chunks/{BRNBFqQ_.js → D4I0Dqwh.js} +1 -1
- package/build/client/_app/immutable/chunks/D6mTYwDH.js +6 -0
- package/build/client/_app/immutable/chunks/{l5GiMY16.js → D7-uGicP.js} +1 -1
- package/build/client/_app/immutable/chunks/{C8wGq5T2.js → D7XrPGMK.js} +1 -1
- package/build/client/_app/immutable/chunks/{xRO38jd8.js → D7eKc9ur.js} +1 -1
- package/build/client/_app/immutable/chunks/{CEj_BGCY.js → DCmONIPx.js} +1 -1
- package/build/client/_app/immutable/chunks/DJWLLhNJ.js +1 -0
- package/build/client/_app/immutable/chunks/{qkxAgKjo.js → DNf96C-O.js} +1 -1
- package/build/client/_app/immutable/chunks/{D4Ogpdhb.js → DSqRqQNp.js} +1 -1
- package/build/client/_app/immutable/chunks/{D4xFb7_b.js → DT1b6JaK.js} +1 -1
- package/build/client/_app/immutable/chunks/{D3bC95qg.js → DWYSL4om.js} +1 -1
- package/build/client/_app/immutable/chunks/{Bi5NvDds.js → DYfx-RRD.js} +1 -1
- package/build/client/_app/immutable/chunks/{Bi25XSWW.js → DfIqw6WM.js} +1 -1
- package/build/client/_app/immutable/chunks/{CGux-rdo.js → Dj4_qcIH.js} +4 -4
- package/build/client/_app/immutable/chunks/{Cx__ttXF.js → Dk9aRp2m.js} +1 -1
- package/build/client/_app/immutable/chunks/{C-58cZAk.js → DmLHHlla.js} +3 -3
- package/build/client/_app/immutable/chunks/{GNZHLVjs.js → Do0VAo0_.js} +1 -1
- package/build/client/_app/immutable/chunks/{BFsDYOFz.js → DrVddB75.js} +1 -1
- package/build/client/_app/immutable/chunks/{CdFbOrCf.js → Dso_gKeU.js} +1 -1
- package/build/client/_app/immutable/chunks/{Bl78Sc72.js → DykTZ90H.js} +1 -1
- package/build/client/_app/immutable/chunks/{DNlR6G0m.js → GdM4UPkS.js} +1 -1
- package/build/client/_app/immutable/chunks/{B52Khb6E.js → IBXFCASw.js} +1 -1
- package/build/client/_app/immutable/chunks/{BIUi504d.js → IoX9lmZK.js} +1 -1
- package/build/client/_app/immutable/chunks/{Bn64J6A-.js → bpkmZ_Dv.js} +1 -1
- package/build/client/_app/immutable/chunks/{iK_uzrhN.js → crRp5OG4.js} +1 -1
- package/build/client/_app/immutable/chunks/da2fibLv.js +8 -0
- package/build/client/_app/immutable/chunks/{BOKyldQm.js → dcghWWmq.js} +1 -1
- package/build/client/_app/immutable/chunks/{CItDRTlN.js → fJBuRi-A.js} +1 -1
- package/build/client/_app/immutable/chunks/{CRe9IZg0.js → gXyYVhfn.js} +1 -1
- package/build/client/_app/immutable/chunks/{C2vkjTiv.js → j2lJ25s0.js} +1 -1
- package/build/client/_app/immutable/chunks/{DypDva7F.js → l3etNtOh.js} +1 -1
- package/build/client/_app/immutable/chunks/{BGQXNvll.js → olUfRNXS.js} +1 -1
- package/build/client/_app/immutable/chunks/{D3W5wGWM.js → uEyn1Z7p.js} +1 -1
- package/build/client/_app/immutable/entry/app.CCuVGpQc.js +2 -0
- package/build/client/_app/immutable/entry/start.BtgtnpyB.js +1 -0
- package/build/client/_app/immutable/nodes/0.GHtnahSb.js +1 -0
- package/build/client/_app/immutable/nodes/1.CaQ_jAq8.js +1 -0
- package/build/client/_app/immutable/nodes/2.DxOLlTKc.js +337 -0
- package/build/client/_app/version.json +1 -1
- package/build/handler.js +7 -6
- package/build/index.js +7 -6
- package/build/server/chunks/chunks/{app-config.svelte.js-BW7TwbBy.js → app-config.svelte.js-D7wkLUkK.js} +2 -2
- package/build/server/chunks/chunks/{db.js-BylhmazO.js → db.js-DRhjT6xK.js} +2 -2
- package/build/server/chunks/chunks/{db2.js-Cm8FBINY.js → db2.js-DUta2B-n.js} +207 -222
- package/build/server/chunks/chunks/{dsh-connection.js-Lnv7PlHw.js → dsh-connection.js-DRtqPR_j.js} +959 -752
- package/build/server/chunks/chunks/{dsh-events.js-D9tSYE7f.js → dsh-events.js-B_E1BU9F.js} +141 -350
- package/build/server/chunks/chunks/{git-probe.js-D_H3YQbR.js → git-probe.js-Daf6r7Z9.js} +3 -3
- package/build/server/chunks/chunks/index-server.js-CV2lq-ha.js +147 -0
- package/build/server/chunks/chunks/{insight-config.js-XUD5BN0g.js → insight-config.js-CA-iT3lB.js} +5 -3
- package/build/server/chunks/chunks/{internal2.js-BcS47nI-.js → internal.js-BcS47nI-.js} +1 -1
- package/build/server/chunks/chunks/{internal.js-D_QJoxN-.js → internal2.js-DAPn3Vk8.js} +11 -153
- package/build/server/chunks/chunks/merge.js-yMwW440S.js +228 -0
- package/build/server/chunks/chunks/{server.js-11-pxAWV.js → server.js-DqHGsQU2.js} +2 -2
- package/build/server/chunks/chunks/{state.js-DbUk4Hrz.js → state.js-CsIZcr7q.js} +5 -4
- package/build/server/chunks/chunks/theme-prefs.svelte.js-8CaWz46g.js +109 -0
- package/build/server/chunks/chunks/{watcher.js-DU-MZGLU.js → watcher.js-CoR53lwR.js} +5 -5
- package/build/server/chunks/entries/endpoints/api/a2a/_id_/{_server.ts.js-DQenu1Rx.js → _server.ts.js-CpeC2QLb.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/a2a/{_server.ts.js-BvEDeAhP.js → _server.ts.js-BKlF4XGH.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/a2a/register/{_server.ts.js-DLJ4sQBq.js → _server.ts.js-BpEhlidV.js} +7 -6
- package/build/server/chunks/entries/endpoints/api/config/{_server.ts.js-zogZnK_B.js → _server.ts.js-BG78X__J.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/directory/{_server.ts.js-BAfRDeE_.js → _server.ts.js-Dmh7f-hU.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/pick-directory/{_server.ts.js-N21TnqYh.js → _server.ts.js-BEci0ZAx.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/presets/{_server.ts.js-C5ckDTov.js → _server.ts.js-OXFzXBSp.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/attachment/{_server.ts.js-CEPz4kVZ.js → _server.ts.js-x44GKy4R.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/cancel/{_server.ts.js-CUB5TKnW.js → _server.ts.js-Da5ZqeJ7.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/catalog/{_server.ts.js-BfDAa0Vb.js → _server.ts.js-BACv9hW-.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/changes/{_server.ts.js-QiLS5yAj.js → _server.ts.js-BtiUS3iD.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/command/{_server.ts.js-C5kJrRx-.js → _server.ts.js-BOOyd1LI.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/events/{_server.ts.js-vydjdEkJ.js → _server.ts.js-D0GwQbdF.js} +5 -4
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/fork/{_server.ts.js-y5sqH_UC.js → _server.ts.js-Bd0JYMlf.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/goal/{_server.ts.js-BoYIpj-f.js → _server.ts.js-DqAV7OOv.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/history/{_server.ts.js-SchAEll8.js → _server.ts.js-Cz4P-68E.js} +5 -4
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/models/{_server.ts.js-B8bmQCwT.js → _server.ts.js-C4fXXBIM.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/path/{_server.ts.js-DxiKkvE-.js → _server.ts.js-_SIiC8sn.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/permission/{_server.ts.js-BBexDstc.js → _server.ts.js-BiqNZiiN.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/prompt/{_server.ts.js-fd9StFXw.js → _server.ts.js-Bdx9V4oY.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/rename/{_server.ts.js-98HaDusY.js → _server.ts.js-CuBqoV3c.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/respond/{_server.ts.js-DN9APffn.js → _server.ts.js-CXPFI_Pn.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/session/_sessionId_/select-model/{_server.ts.js-CeROEmUY.js → _server.ts.js-CRcaw4Yo.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/sessions/{_server.ts.js-DKHmiqIs.js → _server.ts.js-dYrtVHDP.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-file/{_server.ts.js-S6XZDJmC.js → _server.ts.js-BtlfuMjf.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/workspace-tree/{_server.ts.js-CA4PUERZ.js → _server.ts.js-D12kAP9B.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/{_server.ts.js-BObM3Axz.js → _server.ts.js-C9JHp1WU.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/delete/{_server.ts.js-CA34p4GV.js → _server.ts.js-bLF4Fbgn.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/dsh/workspaces/_workspaceId_/rename/{_server.ts.js-DPoRM_7u.js → _server.ts.js-BSw_zD-0.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/prompts/_id_/{_server.ts.js-u-regI3R.js → _server.ts.js-bRLZ5TWI.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/prompts/{_server.ts.js-YtkQGu7O.js → _server.ts.js-ChzWZoFk.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/prompts/use/{_server.ts.js-tv0ivn2x.js → _server.ts.js-DdH5QmPS.js} +3 -3
- package/build/server/chunks/entries/endpoints/api/settings/{_server.ts.js-DmU2MBc5.js → _server.ts.js-DwGQj520.js} +2 -2
- package/build/server/chunks/entries/endpoints/api/terminal/{_server.ts.js-DHhod6dT.js → _server.ts.js-CwXC6Stk.js} +3 -2
- package/build/server/chunks/entries/endpoints/api/workspace/file-write/{_server.ts.js-BmEUPTSa.js → _server.ts.js-CqyKA9g2.js} +6 -5
- package/build/server/chunks/entries/endpoints/api/workspace/git-events/{_server.ts.js-_1uYvYEA.js → _server.ts.js-yu695YoE.js} +6 -5
- package/build/server/chunks/entries/endpoints/api/workspace/git-file-head/{_server.ts.js-DaXO3et9.js → _server.ts.js-BhDAvM6y.js} +6 -5
- package/build/server/chunks/entries/endpoints/api/workspace/git-map/{_server.ts.js-hp85iKSu.js → _server.ts.js-BRUgPrJ2.js} +6 -5
- package/build/server/chunks/entries/endpoints/api/workspace/git-status/{_server.ts.js-CPB-9252.js → _server.ts.js-C7VJ2G4_.js} +6 -5
- package/build/server/chunks/entries/endpoints/api/workspace/write-gate/{_server.ts.js-DKqzSQBE.js → _server.ts.js-BH5BRA_d.js} +6 -5
- package/build/server/chunks/entries/pages/{_error.svelte.js-AsgAVyDR.js → _error.svelte.js-B5TEtccE.js} +10 -9
- package/build/server/chunks/entries/pages/_layout.svelte.js-DRfiLzlz.js +20 -0
- package/build/server/chunks/entries/pages/{_page.server.ts.js-DTjoTdYK.js → _page.server.ts.js-CityLNBO.js} +3 -3
- package/build/server/chunks/entries/pages/{_page.svelte.js-CFdCjELr.js → _page.svelte.js-i6KsWK9O.js} +4654 -2413
- package/build/server/chunks/{handler-Bx2fbkEJ.js → handler-XuK3Ihhf.js} +3 -3
- package/build/server/chunks/{index.js-BldXQ38P.js → index.js-D2FEiD0I.js} +5 -4
- package/build/server/chunks/{manifest.js-Du-9DaEd.js → manifest.js-B_kahcFI.js} +45 -45
- package/build/server/chunks/nodes/0.js-C0B2o0le.js +12 -0
- package/build/server/chunks/nodes/1.js-C2e7NFqd.js +9 -0
- package/build/server/chunks/nodes/{2.js-DGLcInR6.js → 2.js-Bh3kLeYq.js} +9 -8
- package/package.json +2 -2
- package/skills/dsi-sloc/SKILL.md +117 -0
- package/skills/dsi-sloc/references/measurement.md +79 -0
- package/skills/dsi-sloc/references/report-skeleton.md +79 -0
- package/skills/dsi-thin/SKILL.md +214 -0
- package/skills/dsi-thin/references/ADR-0019-snapshot.md +363 -0
- package/skills/dsi-thin/references/authority-adr.md +28 -0
- package/skills/dsi-thin/references/input-contract.md +42 -0
- package/skills/dsi-thin/references/proven-gates.md +61 -0
- package/skills/dsi-thin/references/two-lane-contract.md +53 -0
- package/template/.dsi/prompts.sqlite +0 -0
- package/template/.dsi/prompts.sqlite-shm +0 -0
- package/template/.dsi/prompts.sqlite-wal +0 -0
- package/template/.dsi/resources/skills-reff.md +5 -4
- package/build/client/_app/immutable/assets/0.CRU0GiZX.css +0 -2
- package/build/client/_app/immutable/assets/2.Bzy6Q5kl.css +0 -1
- package/build/client/_app/immutable/chunks/-BV4MEqr.js +0 -1
- package/build/client/_app/immutable/chunks/66qbK5h1.js +0 -2
- package/build/client/_app/immutable/chunks/BLxS3bAX.js +0 -6
- package/build/client/_app/immutable/chunks/CPhcxli7.js +0 -1
- package/build/client/_app/immutable/chunks/CT1m72HM.js +0 -1
- package/build/client/_app/immutable/chunks/CxnI-Htc.js +0 -8
- package/build/client/_app/immutable/chunks/D0uZseUH.js +0 -1
- package/build/client/_app/immutable/chunks/D73RufXg.js +0 -1
- package/build/client/_app/immutable/chunks/HwuqC1sa.js +0 -1
- package/build/client/_app/immutable/chunks/NtHUheoE.js +0 -1
- package/build/client/_app/immutable/entry/app.D8WfdLSe.js +0 -2
- package/build/client/_app/immutable/entry/start.CVl0g0cv.js +0 -1
- package/build/client/_app/immutable/nodes/0.k1Ikzbp6.js +0 -1
- package/build/client/_app/immutable/nodes/1.X0If5xAN.js +0 -1
- package/build/client/_app/immutable/nodes/2.CELzu2i6.js +0 -337
- package/build/server/chunks/entries/pages/_layout.svelte.js-EFiihTdF.js +0 -18
- package/build/server/chunks/nodes/0.js-B0560RI0.js +0 -12
- package/build/server/chunks/nodes/1.js-D55AmdZs.js +0 -9
|
@@ -1,71 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
"web/deepseek-search-llm-request"
|
|
68
|
-
]);
|
|
1
|
+
import { c as collapseSystemPromptEntries, m as mergeEntries, t as truncate } from './merge.js-yMwW440S.js';
|
|
2
|
+
|
|
3
|
+
//#region src/lib/services/conversation/events/content.ts
|
|
69
4
|
/** Stable bubble id for one assistant step (chunk merge key). */
|
|
70
5
|
function bubbleId(turn, step) {
|
|
71
6
|
return `a:${String(turn)}:${String(step)}`;
|
|
@@ -103,6 +38,87 @@ function textOfContent(content) {
|
|
|
103
38
|
for (const part of content) if (part && typeof part === "object" && part.type === "text" && typeof part.text === "string") parts.push(part.text);
|
|
104
39
|
return parts.join("\n");
|
|
105
40
|
}
|
|
41
|
+
/** tool/call display summary: harness view title when present, else the raw
|
|
42
|
+
* args truncated through the shared util (task 2.1 promotion — single
|
|
43
|
+
* truncation implementation; marker-less head, the chip owns affordances). */
|
|
44
|
+
function callSummary(event, argumentsRaw) {
|
|
45
|
+
const title = event.view?.view?.title;
|
|
46
|
+
if (typeof title === "string" && title.length > 0) return title;
|
|
47
|
+
const { head, truncated } = truncate(argumentsRaw, 120);
|
|
48
|
+
if (head.length > 0) return truncated ? `${head}…` : head;
|
|
49
|
+
}
|
|
50
|
+
/** Read a wire TokenUsage (assistant/message.data.usage) into its DSI
|
|
51
|
+
* shape — structural and conservative: a non-numeric inputTokens declines
|
|
52
|
+
* to undefined (the event carries no accounting). 2026-08-23. Route
|
|
53
|
+
* attribution rides message.source when both parts are non-empty
|
|
54
|
+
* (2026-09-09, DSH turn-usage parity). */
|
|
55
|
+
function usageOf(v, source) {
|
|
56
|
+
const u = v;
|
|
57
|
+
if (u === void 0 || typeof u.inputTokens !== "number" || typeof u.outputTokens !== "number") return;
|
|
58
|
+
const opt = (n) => typeof n === "number" ? n : void 0;
|
|
59
|
+
const count = (n) => typeof n === "number" && Number.isSafeInteger(n) && n > 0 ? n : void 0;
|
|
60
|
+
const provider = typeof source?.provider === "string" && source.provider.length > 0 ? source.provider : void 0;
|
|
61
|
+
const model = typeof source?.model === "string" && source.model.length > 0 ? source.model : void 0;
|
|
62
|
+
return {
|
|
63
|
+
inputTokens: u.inputTokens,
|
|
64
|
+
outputTokens: u.outputTokens,
|
|
65
|
+
...count(u.totalTokens) !== void 0 ? { totalTokens: count(u.totalTokens) } : {},
|
|
66
|
+
...opt(u.cacheReadTokens) !== void 0 ? { cacheReadTokens: opt(u.cacheReadTokens) } : {},
|
|
67
|
+
...opt(u.cacheWriteTokens) !== void 0 ? { cacheWriteTokens: opt(u.cacheWriteTokens) } : {},
|
|
68
|
+
...opt(u.reasoningTokens) !== void 0 ? { reasoningTokens: opt(u.reasoningTokens) } : {},
|
|
69
|
+
...provider !== void 0 && model !== void 0 ? {
|
|
70
|
+
provider,
|
|
71
|
+
model
|
|
72
|
+
} : {}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function readStr(v) {
|
|
76
|
+
return typeof v === "string" && v.length > 0 ? v : void 0;
|
|
77
|
+
}
|
|
78
|
+
function firstOfType(content, type) {
|
|
79
|
+
if (!Array.isArray(content)) return void 0;
|
|
80
|
+
return content.find((p) => p?.type === type);
|
|
81
|
+
}
|
|
82
|
+
/** Normalize a read-result presentation view (tool/result view.card ===
|
|
83
|
+
* 'read') into DsiReadView. Structural and conservative: any malformed
|
|
84
|
+
* member declines to undefined (the flat resultText path stays). BC-11:
|
|
85
|
+
* the shape is read from the harness's own projection, never re-derived
|
|
86
|
+
* by guessing at arguments. 2026-08-22. */
|
|
87
|
+
function readViewFrom(view) {
|
|
88
|
+
const v = view?.view;
|
|
89
|
+
if (v === void 0 || v.card !== "read") return void 0;
|
|
90
|
+
const path = readStr(v.path);
|
|
91
|
+
if (path === void 0) return void 0;
|
|
92
|
+
const offset = v.offset;
|
|
93
|
+
const totalLines = v.totalLines;
|
|
94
|
+
const lines = v.lines;
|
|
95
|
+
if (typeof offset !== "number" || typeof totalLines !== "number" || !Array.isArray(lines)) return void 0;
|
|
96
|
+
const out = [];
|
|
97
|
+
for (const l of lines) {
|
|
98
|
+
const line = l;
|
|
99
|
+
if (typeof line?.number !== "number" || typeof line?.text !== "string") return void 0;
|
|
100
|
+
out.push({
|
|
101
|
+
number: line.number,
|
|
102
|
+
text: line.text
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
const lang = readStr(v.lang);
|
|
106
|
+
return {
|
|
107
|
+
path,
|
|
108
|
+
offset,
|
|
109
|
+
totalLines,
|
|
110
|
+
lines: out,
|
|
111
|
+
...lang !== void 0 ? { lang } : {}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/lib/services/conversation/events/context-injection.ts
|
|
116
|
+
/**
|
|
117
|
+
* dsh-events/context-injection — the fixture-pinned context-injection family
|
|
118
|
+
* detector moved whole from dsh-events.ts (ADR-0022 W2): producer
|
|
119
|
+
* classification for harness-injected user/messages. Pure function; the
|
|
120
|
+
* detection doc comment rides verbatim below.
|
|
121
|
+
*/
|
|
106
122
|
/**
|
|
107
123
|
* Context-injection family detection (task 2.4; BC-11: fixture-pinned wire
|
|
108
124
|
* markers — tests/unit/fixtures/context-injection-sources.json, live rc.8
|
|
@@ -177,15 +193,57 @@ function contextInjectionProducer(data) {
|
|
|
177
193
|
if (source.kind === "session-reference") return "recall";
|
|
178
194
|
if (source.kind !== "user") return "injected";
|
|
179
195
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region src/lib/services/conversation/events/mapper.ts
|
|
198
|
+
/**
|
|
199
|
+
* Internal harness markers that never render in the transcript: policy
|
|
200
|
+
* snapshots, turn/step bookkeeping, projections, retry plumbing. They are
|
|
201
|
+
* durable truth for the harness, noise for a conversation page.
|
|
202
|
+
*
|
|
203
|
+
* NOT silent since 2026-09-01: `request/header` carries the rendered system
|
|
204
|
+
* prompt (`header.system`) — transcript content in DSH's own Chat — and now
|
|
205
|
+
* maps to a `system-prompt` entry. `request/context` stays silent (route
|
|
206
|
+
* metadata, no user-visible text).
|
|
207
|
+
*/
|
|
208
|
+
var SILENT_TYPES = /* @__PURE__ */ new Set([
|
|
209
|
+
"agent-preset/selected",
|
|
210
|
+
"agent/inbox/spliced",
|
|
211
|
+
"approval/decided",
|
|
212
|
+
"approval/policy",
|
|
213
|
+
"approval/asked",
|
|
214
|
+
"command/done",
|
|
215
|
+
"command/run",
|
|
216
|
+
"compaction/end",
|
|
217
|
+
"compaction/prune",
|
|
218
|
+
"compaction/start",
|
|
219
|
+
"compaction/summary",
|
|
220
|
+
"feedback/record",
|
|
221
|
+
"goal/change",
|
|
222
|
+
"hook/invoked",
|
|
223
|
+
"hook/result",
|
|
224
|
+
"llm/retry",
|
|
225
|
+
"llm/retry-started",
|
|
226
|
+
"assistant/attempt",
|
|
227
|
+
"permission/preset",
|
|
228
|
+
"plan/mode",
|
|
229
|
+
"request/context",
|
|
230
|
+
"sandbox/mode",
|
|
231
|
+
"schedule/change",
|
|
232
|
+
"session",
|
|
233
|
+
"session/end-seed",
|
|
234
|
+
"session/title",
|
|
235
|
+
"session/title-llm-request",
|
|
236
|
+
"step/end",
|
|
237
|
+
"step/start",
|
|
238
|
+
"subagent/catalog",
|
|
239
|
+
"subagent/descriptor",
|
|
240
|
+
"team/member",
|
|
241
|
+
"team/message/delivered",
|
|
242
|
+
"team/message/queued",
|
|
243
|
+
"team/task",
|
|
244
|
+
"todo/write",
|
|
245
|
+
"web/deepseek-search-llm-request"
|
|
246
|
+
]);
|
|
189
247
|
/**
|
|
190
248
|
* Map ONE raw event to its DsiEntry (or null when it renders nothing).
|
|
191
249
|
*
|
|
@@ -457,279 +515,12 @@ function entryForEvent(event) {
|
|
|
457
515
|
};
|
|
458
516
|
}
|
|
459
517
|
}
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
* to undefined (the event carries no accounting). 2026-08-23. Route
|
|
463
|
-
* attribution rides message.source when both parts are non-empty
|
|
464
|
-
* (2026-09-09, DSH turn-usage parity). */
|
|
465
|
-
function usageOf(v, source) {
|
|
466
|
-
const u = v;
|
|
467
|
-
if (u === void 0 || typeof u.inputTokens !== "number" || typeof u.outputTokens !== "number") return;
|
|
468
|
-
const opt = (n) => typeof n === "number" ? n : void 0;
|
|
469
|
-
const count = (n) => typeof n === "number" && Number.isSafeInteger(n) && n > 0 ? n : void 0;
|
|
470
|
-
const provider = typeof source?.provider === "string" && source.provider.length > 0 ? source.provider : void 0;
|
|
471
|
-
const model = typeof source?.model === "string" && source.model.length > 0 ? source.model : void 0;
|
|
472
|
-
return {
|
|
473
|
-
inputTokens: u.inputTokens,
|
|
474
|
-
outputTokens: u.outputTokens,
|
|
475
|
-
...count(u.totalTokens) !== void 0 ? { totalTokens: count(u.totalTokens) } : {},
|
|
476
|
-
...opt(u.cacheReadTokens) !== void 0 ? { cacheReadTokens: opt(u.cacheReadTokens) } : {},
|
|
477
|
-
...opt(u.cacheWriteTokens) !== void 0 ? { cacheWriteTokens: opt(u.cacheWriteTokens) } : {},
|
|
478
|
-
...opt(u.reasoningTokens) !== void 0 ? { reasoningTokens: opt(u.reasoningTokens) } : {},
|
|
479
|
-
...provider !== void 0 && model !== void 0 ? {
|
|
480
|
-
provider,
|
|
481
|
-
model
|
|
482
|
-
} : {}
|
|
483
|
-
};
|
|
484
|
-
}
|
|
485
|
-
function readStr(v) {
|
|
486
|
-
return typeof v === "string" && v.length > 0 ? v : void 0;
|
|
487
|
-
}
|
|
488
|
-
function firstOfType(content, type) {
|
|
489
|
-
if (!Array.isArray(content)) return void 0;
|
|
490
|
-
return content.find((p) => p?.type === type);
|
|
491
|
-
}
|
|
492
|
-
/** Normalize a read-result presentation view (tool/result view.card ===
|
|
493
|
-
* 'read') into DsiReadView. Structural and conservative: any malformed
|
|
494
|
-
* member declines to undefined (the flat resultText path stays). BC-11:
|
|
495
|
-
* the shape is read from the harness's own projection, never re-derived
|
|
496
|
-
* by guessing at arguments. 2026-08-22. */
|
|
497
|
-
function readViewFrom(view) {
|
|
498
|
-
const v = view?.view;
|
|
499
|
-
if (v === void 0 || v.card !== "read") return void 0;
|
|
500
|
-
const path = readStr(v.path);
|
|
501
|
-
if (path === void 0) return void 0;
|
|
502
|
-
const offset = v.offset;
|
|
503
|
-
const totalLines = v.totalLines;
|
|
504
|
-
const lines = v.lines;
|
|
505
|
-
if (typeof offset !== "number" || typeof totalLines !== "number" || !Array.isArray(lines)) return void 0;
|
|
506
|
-
const out = [];
|
|
507
|
-
for (const l of lines) {
|
|
508
|
-
const line = l;
|
|
509
|
-
if (typeof line?.number !== "number" || typeof line?.text !== "string") return void 0;
|
|
510
|
-
out.push({
|
|
511
|
-
number: line.number,
|
|
512
|
-
text: line.text
|
|
513
|
-
});
|
|
514
|
-
}
|
|
515
|
-
const lang = readStr(v.lang);
|
|
516
|
-
return {
|
|
517
|
-
path,
|
|
518
|
-
offset,
|
|
519
|
-
totalLines,
|
|
520
|
-
lines: out,
|
|
521
|
-
...lang !== void 0 ? { lang } : {}
|
|
522
|
-
};
|
|
523
|
-
}
|
|
524
|
-
/**
|
|
525
|
-
* Merge incoming DsiEntry deltas into an existing list (id-keyed, idempotent):
|
|
526
|
-
*
|
|
527
|
-
* assistant-message, same id, finalized — REPLACES (the assembled message
|
|
528
|
-
* is authoritative over any streamed prefix, text AND reasoning; this
|
|
529
|
-
* is how the durable assistant/message finalizes the live-tail bubble
|
|
530
|
-
* folded by the store's applyLiveStream);
|
|
531
|
-
* any other kind, known id — ignored (retransmit);
|
|
532
|
-
* unknown id — appended.
|
|
533
|
-
*
|
|
534
|
-
* (Ledger v2 removed the durable chunk events whose fragments CONCAT'ed
|
|
535
|
-
* here while streaming; the live tail carries the full accumulation each
|
|
536
|
-
* poll and replaces wholesale in the store, outside this merge.)
|
|
537
|
-
*
|
|
538
|
-
* Tool lifecycle (Wave 1, task 1.2): tool/call is born status:'pending';
|
|
539
|
-
* a paired tool/result flips it to pass/fail (result.ok, i.e. isError on the
|
|
540
|
-
* wire) and carries durationMs = result.time − call.time — both directions of
|
|
541
|
-
* arrival (cold load has call+result together; polls may deliver result into
|
|
542
|
-
* a list that already holds the call). An orphan result (no call in the list)
|
|
543
|
-
* keeps its honest state: name unknown → 'tool', duration undefined.
|
|
544
|
-
*
|
|
545
|
-
* Also pairs tool-result entries with their tool-call by callId (fills
|
|
546
|
-
* toolName). Server cold load and client poll deltas share these rules.
|
|
547
|
-
*/
|
|
548
|
-
function mergeEntries(existing, incoming) {
|
|
549
|
-
const merged = existing.map((e) => ({ ...e }));
|
|
550
|
-
for (const entry of incoming) {
|
|
551
|
-
const at = merged.findIndex((e) => e.id === entry.id);
|
|
552
|
-
if (at === -1) {
|
|
553
|
-
merged.push({ ...entry });
|
|
554
|
-
continue;
|
|
555
|
-
}
|
|
556
|
-
const candidate = merged[at];
|
|
557
|
-
if (candidate.kind === "workflow-run" && entry.kind === "workflow-run") {
|
|
558
|
-
merged[at] = mergeWorkflowRun(candidate, entry);
|
|
559
|
-
continue;
|
|
560
|
-
}
|
|
561
|
-
if (candidate.kind === "code-dispatch" && entry.kind === "code-dispatch") {
|
|
562
|
-
if (entry.argsRaw !== void 0) candidate.argsRaw = entry.argsRaw;
|
|
563
|
-
candidate.time = entry.time > candidate.time ? entry.time : candidate.time;
|
|
564
|
-
if (entry.settled) {
|
|
565
|
-
candidate.settled = true;
|
|
566
|
-
candidate.isError = entry.isError;
|
|
567
|
-
candidate.contentText = entry.contentText;
|
|
568
|
-
}
|
|
569
|
-
continue;
|
|
570
|
-
}
|
|
571
|
-
const prev = candidate;
|
|
572
|
-
if (prev.kind === "assistant-message" && entry.kind === "assistant-message") {
|
|
573
|
-
if (!entry.streaming) {
|
|
574
|
-
const next = { ...entry };
|
|
575
|
-
if (next.reasoning === void 0 && prev.reasoning !== void 0) {
|
|
576
|
-
next.reasoning = prev.reasoning;
|
|
577
|
-
next.reasoningStreaming = false;
|
|
578
|
-
}
|
|
579
|
-
if (next.text === "") next.text = prev.text;
|
|
580
|
-
merged[at] = next;
|
|
581
|
-
}
|
|
582
|
-
continue;
|
|
583
|
-
}
|
|
584
|
-
if (candidate.kind === "files-edited" && entry.kind === "files-edited") {
|
|
585
|
-
if (entry.seq > candidate.seq) merged[at] = { ...entry };
|
|
586
|
-
continue;
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
const calls = /* @__PURE__ */ new Map();
|
|
590
|
-
for (const e of merged) if (e.kind === "tool-call") calls.set(e.callId, e);
|
|
591
|
-
for (const e of merged) {
|
|
592
|
-
if (e.kind !== "tool-result") continue;
|
|
593
|
-
const call = calls.get(e.callId);
|
|
594
|
-
if (call) {
|
|
595
|
-
if (!e.toolName || e.toolName === "" || e.toolName === "tool") e.toolName = call.toolName;
|
|
596
|
-
if (!e.durationMs && e.time >= call.time) e.durationMs = e.time - call.time;
|
|
597
|
-
}
|
|
598
|
-
if (!e.toolName || e.toolName === "") e.toolName = "tool";
|
|
599
|
-
if (call && call.status === "pending") call.status = e.ok ? "pass" : "fail";
|
|
600
|
-
}
|
|
601
|
-
foldCodeDispatches(merged);
|
|
602
|
-
return merged;
|
|
603
|
-
}
|
|
604
|
-
/**
|
|
605
|
-
* Fold `code-dispatch` partials onto their parent tool-call entries
|
|
606
|
-
* (ADR D1/D2, 2026-09-05). Start and settled partials merge by subCallId —
|
|
607
|
-
* a settle fills content/isError and never un-settles; a late start after a
|
|
608
|
-
* settle keeps the settle's facts. Entries fold by parentCallId → the call's
|
|
609
|
-
* `dispatches` list in `<n>` submission order. Orphans (no parent call in
|
|
610
|
-
* the list) are dropped — the fold never guesses a parent. Idempotent:
|
|
611
|
-
* retransmitted partials rewrite the same facts; the folded entry carries
|
|
612
|
-
* fresh arrays, so re-running never aliases a prior list.
|
|
613
|
-
*/
|
|
614
|
-
function foldCodeDispatches(entries) {
|
|
615
|
-
const bySub = /* @__PURE__ */ new Map();
|
|
616
|
-
for (const e of entries) {
|
|
617
|
-
if (e.kind !== "code-dispatch") continue;
|
|
618
|
-
const prev = bySub.get(e.subCallId);
|
|
619
|
-
if (prev === void 0) {
|
|
620
|
-
bySub.set(e.subCallId, e);
|
|
621
|
-
continue;
|
|
622
|
-
}
|
|
623
|
-
prev.time = e.time > prev.time ? e.time : prev.time;
|
|
624
|
-
if (e.argsRaw !== void 0) prev.argsRaw = e.argsRaw;
|
|
625
|
-
if (e.settled) {
|
|
626
|
-
prev.settled = true;
|
|
627
|
-
prev.isError = e.isError;
|
|
628
|
-
prev.contentText = e.contentText;
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
if (bySub.size === 0) return;
|
|
632
|
-
const calls = /* @__PURE__ */ new Map();
|
|
633
|
-
for (const e of entries) if (e.kind === "tool-call") calls.set(e.callId, e);
|
|
634
|
-
const grouped = /* @__PURE__ */ new Map();
|
|
635
|
-
for (const d of bySub.values()) {
|
|
636
|
-
const list = grouped.get(d.parentCallId) ?? [];
|
|
637
|
-
list.push(d);
|
|
638
|
-
grouped.set(d.parentCallId, list);
|
|
639
|
-
}
|
|
640
|
-
const orderOf = (subCallId) => {
|
|
641
|
-
const m = /:(?:code|ptc):(\d+)$/.exec(subCallId);
|
|
642
|
-
return m !== null ? Number(m[1]) : Number.MAX_SAFE_INTEGER;
|
|
643
|
-
};
|
|
644
|
-
for (const [parentCallId, list] of grouped) {
|
|
645
|
-
list.sort((a, b) => orderOf(a.subCallId) - orderOf(b.subCallId));
|
|
646
|
-
const call = calls.get(parentCallId);
|
|
647
|
-
if (call === void 0) continue;
|
|
648
|
-
const kept = new Map(call.dispatches?.map((d) => [d.subCallId, d]) ?? []);
|
|
649
|
-
const next = [];
|
|
650
|
-
const seen = /* @__PURE__ */ new Set();
|
|
651
|
-
for (const d of list) {
|
|
652
|
-
seen.add(d.subCallId);
|
|
653
|
-
const k = kept.get(d.subCallId);
|
|
654
|
-
const winner = d.settled ? d : k?.settled ? k : d;
|
|
655
|
-
next.push({
|
|
656
|
-
subCallId: d.subCallId,
|
|
657
|
-
name: d.name,
|
|
658
|
-
...winner.argsRaw !== void 0 ? { argsRaw: winner.argsRaw } : k?.argsRaw !== void 0 ? { argsRaw: k.argsRaw } : {},
|
|
659
|
-
settled: d.settled || (k?.settled ?? false),
|
|
660
|
-
...winner.isError !== void 0 ? { isError: winner.isError } : {},
|
|
661
|
-
...winner.contentText !== void 0 ? { contentText: winner.contentText } : {}
|
|
662
|
-
});
|
|
663
|
-
}
|
|
664
|
-
for (const d of kept.values()) if (!seen.has(d.subCallId)) next.push({ ...d });
|
|
665
|
-
next.sort((a, b) => orderOf(a.subCallId) - orderOf(b.subCallId));
|
|
666
|
-
call.dispatches = next;
|
|
667
|
-
}
|
|
668
|
-
for (let i = entries.length - 1; i >= 0; i--) if (entries[i].kind === "code-dispatch") entries.splice(i, 1);
|
|
669
|
-
}
|
|
518
|
+
//#endregion
|
|
519
|
+
//#region src/lib/services/conversation/dsh-events.ts
|
|
670
520
|
/** Full ledger tail → merged render list (cold load; BC-4 reads the ledger). */
|
|
671
521
|
function eventsToEntries(events) {
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
/**
|
|
675
|
-
* Collapse repeated `system-prompt` entries to one row per DISTINCT text
|
|
676
|
-
* (2026-09-01): a request/header is appended per epoch — initial, resume,
|
|
677
|
-
* change, series — so an uncollapsed transcript would repeat the identical
|
|
678
|
-
* "System prompt" row after every host restart or tools-only header bump.
|
|
679
|
-
* DSH's own Chat decides per header (`showsPrompt`); DSI cannot, because
|
|
680
|
-
* scroll-up pages map through fresh calls with no earlier-page state — so
|
|
681
|
-
* the rule is textual and stateless: keep a system-prompt row only when its
|
|
682
|
-
* text differs from the last KEPT one. Pure, order-preserving, idempotent;
|
|
683
|
-
* safe to re-run at every merge point (mapped batches, client deltas,
|
|
684
|
-
* prepended older pages).
|
|
685
|
-
*/
|
|
686
|
-
function collapseSystemPromptEntries(entries) {
|
|
687
|
-
let lastKept;
|
|
688
|
-
const out = [];
|
|
689
|
-
for (const e of entries) {
|
|
690
|
-
if (e.kind === "system-prompt") {
|
|
691
|
-
if (e.text === lastKept) continue;
|
|
692
|
-
lastKept = e.text;
|
|
693
|
-
}
|
|
694
|
-
out.push(e);
|
|
695
|
-
}
|
|
696
|
-
return out;
|
|
697
|
-
}
|
|
698
|
-
/**
|
|
699
|
-
* Fold ONE workflow-run partial into the running entry (2026-08-31).
|
|
700
|
-
* Partials carry only what their event proved — run-start owns the name,
|
|
701
|
-
* agent-start appends a member, agent-end settles a member by its member
|
|
702
|
-
* seq (label/childId are NEVER overwritten by a settle partial's empty
|
|
703
|
-
* strings), run-end sets the terminal status. Idempotent: a retransmitted
|
|
704
|
-
* partial rewrites the same facts; a running status never un-settles a
|
|
705
|
-
* terminal one.
|
|
706
|
-
*/
|
|
707
|
-
function mergeWorkflowRun(prev, incoming) {
|
|
708
|
-
const agents = [...prev.agents];
|
|
709
|
-
for (const a of incoming.agents) {
|
|
710
|
-
const at = agents.findIndex((x) => x.seq === a.seq);
|
|
711
|
-
if (at === -1) {
|
|
712
|
-
agents.push({ ...a });
|
|
713
|
-
continue;
|
|
714
|
-
}
|
|
715
|
-
agents[at] = {
|
|
716
|
-
...agents[at],
|
|
717
|
-
label: agents[at].label === "" && a.label !== "" ? a.label : agents[at].label,
|
|
718
|
-
childId: agents[at].childId === "" && a.childId !== "" ? a.childId : agents[at].childId,
|
|
719
|
-
startedAt: agents[at].startedAt > 0 ? agents[at].startedAt : a.startedAt,
|
|
720
|
-
status: a.status !== "running" ? a.status : agents[at].status,
|
|
721
|
-
...a.phase !== void 0 ? { phase: a.phase } : {},
|
|
722
|
-
...a.endedAt !== void 0 ? { endedAt: a.endedAt } : {}
|
|
723
|
-
};
|
|
724
|
-
}
|
|
725
|
-
return {
|
|
726
|
-
...prev,
|
|
727
|
-
seq: Math.max(prev.seq, incoming.seq),
|
|
728
|
-
time: Math.max(prev.time, incoming.time),
|
|
729
|
-
name: prev.name !== "" ? prev.name : incoming.name,
|
|
730
|
-
status: incoming.status !== "running" ? incoming.status : prev.status,
|
|
731
|
-
agents
|
|
732
|
-
};
|
|
522
|
+
const mapped = events.map(entryForEvent).filter((e) => e !== null);
|
|
523
|
+
return collapseSystemPromptEntries(mergeEntries([], mapped));
|
|
733
524
|
}
|
|
734
525
|
/** Ledger HistoryEntry[] → raw events with their presentation views carried
|
|
735
526
|
* (2026-08-22): the harness attaches `view` BESIDE `event` on each history
|
|
@@ -743,5 +534,5 @@ function historyToEvents(history) {
|
|
|
743
534
|
});
|
|
744
535
|
}
|
|
745
536
|
|
|
746
|
-
export { entryForEvent as a,
|
|
747
|
-
//# sourceMappingURL=dsh-events.js-
|
|
537
|
+
export { entryForEvent as a, eventsToEntries as e, historyToEvents as h };
|
|
538
|
+
//# sourceMappingURL=dsh-events.js-B_E1BU9F.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as getDshConnection } from './dsh-connection.js-
|
|
2
|
-
import { h as historyToEvents } from './dsh-events.js-
|
|
1
|
+
import { g as getDshConnection } from './dsh-connection.js-DRtqPR_j.js';
|
|
2
|
+
import { h as historyToEvents } from './dsh-events.js-B_E1BU9F.js';
|
|
3
3
|
import { a as foldKnobs, f as filterKnobEvents, F as FULL_ACCESS_PRESET } from './permission-state.js-B7UpAHBv.js';
|
|
4
4
|
import { promises } from 'node:fs';
|
|
5
5
|
import * as nodePath from 'node:path';
|
|
@@ -216,4 +216,4 @@ async function gitStatus(repo) {
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
export { GitUnavailableError as G, gitStatus as a, gitFileHead as b, detectRepos as d, gitGateEnabled as g, isInsideRoot as i, parsePorcelainStatus as p, resolveEnclosingRepo as r };
|
|
219
|
-
//# sourceMappingURL=git-probe.js-
|
|
219
|
+
//# sourceMappingURL=git-probe.js-Daf6r7Z9.js.map
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { u as uneval } from './uneval.js-BJ9Qq2SF.js';
|
|
2
|
+
import { s as ssr_context, r as run, a as setContext, n as noop, h as hasContext, g as getContext, b as getAllContexts, c as getAbortSignal, d as createContext, l as lifecycle_function_unavailable, e as experimental_async_required, f as get_render_context, i as hydratable_serialization_failed } from './server.js-DqHGsQU2.js';
|
|
3
|
+
|
|
4
|
+
//#region \0rolldown/runtime.js
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
7
|
+
var __exportAll = (all, no_symbols) => {
|
|
8
|
+
let target = {};
|
|
9
|
+
for (var name in all) __defProp(target, name, {
|
|
10
|
+
get: all[name],
|
|
11
|
+
enumerable: true
|
|
12
|
+
});
|
|
13
|
+
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
14
|
+
return target;
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/server/hydratable.js
|
|
18
|
+
/** @import { HydratableLookupEntry } from '#server' */
|
|
19
|
+
/**
|
|
20
|
+
* @template T
|
|
21
|
+
* @param {string} key
|
|
22
|
+
* @param {() => T} fn
|
|
23
|
+
* @returns {T}
|
|
24
|
+
*/
|
|
25
|
+
function hydratable(key, fn) {
|
|
26
|
+
experimental_async_required();
|
|
27
|
+
const { hydratable } = get_render_context();
|
|
28
|
+
let entry = hydratable.lookup.get(key);
|
|
29
|
+
if (entry !== void 0) return entry.value;
|
|
30
|
+
const value = fn();
|
|
31
|
+
entry = encode(key, value, hydratable.unresolved_promises);
|
|
32
|
+
hydratable.lookup.set(key, entry);
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @param {string} key
|
|
37
|
+
* @param {any} value
|
|
38
|
+
* @param {Map<Promise<any>, string>} [unresolved]
|
|
39
|
+
*/
|
|
40
|
+
function encode(key, value, unresolved) {
|
|
41
|
+
/** @type {HydratableLookupEntry} */
|
|
42
|
+
const entry = {
|
|
43
|
+
value,
|
|
44
|
+
serialized: ""
|
|
45
|
+
};
|
|
46
|
+
let uid = 1;
|
|
47
|
+
entry.serialized = uneval(entry.value, (value, uneval) => {
|
|
48
|
+
if (is_promise(value)) {
|
|
49
|
+
const placeholder = `"${uid++}"`;
|
|
50
|
+
const p = value.then((v) => {
|
|
51
|
+
entry.serialized = entry.serialized.replace(placeholder, () => `r(${uneval(v)})`);
|
|
52
|
+
}).catch((devalue_error) => hydratable_serialization_failed(key, serialization_stack(entry.stack, devalue_error?.stack)));
|
|
53
|
+
p.catch(() => {}).finally(() => unresolved?.delete(p));
|
|
54
|
+
(entry.promises ??= []).push(p);
|
|
55
|
+
return placeholder;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return entry;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* @param {any} value
|
|
62
|
+
* @returns {value is Promise<any>}
|
|
63
|
+
*/
|
|
64
|
+
function is_promise(value) {
|
|
65
|
+
return Object.prototype.toString.call(value) === "[object Promise]";
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @param {string | undefined} root_stack
|
|
69
|
+
* @param {string | undefined} uneval_stack
|
|
70
|
+
*/
|
|
71
|
+
function serialization_stack(root_stack, uneval_stack) {
|
|
72
|
+
let out = "";
|
|
73
|
+
if (root_stack) out += root_stack + "\n";
|
|
74
|
+
if (uneval_stack) out += "Caused by:\n" + uneval_stack + "\n";
|
|
75
|
+
return out || "<missing stack trace>";
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/internal/server/blocks/snippet.js
|
|
79
|
+
/** @import { Snippet } from 'svelte' */
|
|
80
|
+
/** @import { Renderer } from '../renderer' */
|
|
81
|
+
/** @import { Getters } from '#shared' */
|
|
82
|
+
/**
|
|
83
|
+
* Create a snippet programmatically
|
|
84
|
+
* @template {unknown[]} Params
|
|
85
|
+
* @param {(...params: Getters<Params>) => {
|
|
86
|
+
* render: () => string
|
|
87
|
+
* setup?: (element: Element) => void | (() => void)
|
|
88
|
+
* }} fn
|
|
89
|
+
* @returns {Snippet<Params>}
|
|
90
|
+
*/
|
|
91
|
+
function createRawSnippet(fn) {
|
|
92
|
+
return (renderer, ...args) => {
|
|
93
|
+
var getters = args.map((value) => () => value);
|
|
94
|
+
renderer.push(fn(...getters).render().trim());
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region node_modules/.pnpm/svelte@5.56.10/node_modules/svelte/src/index-server.js
|
|
99
|
+
/** @import { SSRContext } from '#server' */
|
|
100
|
+
/** @import { Renderer } from './internal/server/renderer.js' */
|
|
101
|
+
var index_server_exports = /* @__PURE__ */ __exportAll({
|
|
102
|
+
afterUpdate: () => noop,
|
|
103
|
+
beforeUpdate: () => noop,
|
|
104
|
+
createContext: () => createContext,
|
|
105
|
+
createEventDispatcher: () => createEventDispatcher,
|
|
106
|
+
createRawSnippet: () => createRawSnippet,
|
|
107
|
+
flushSync: () => noop,
|
|
108
|
+
fork: () => fork,
|
|
109
|
+
getAbortSignal: () => getAbortSignal,
|
|
110
|
+
getAllContexts: () => getAllContexts,
|
|
111
|
+
getContext: () => getContext,
|
|
112
|
+
hasContext: () => hasContext,
|
|
113
|
+
hydratable: () => hydratable,
|
|
114
|
+
hydrate: () => hydrate,
|
|
115
|
+
mount: () => mount,
|
|
116
|
+
onDestroy: () => onDestroy,
|
|
117
|
+
onMount: () => noop,
|
|
118
|
+
setContext: () => setContext,
|
|
119
|
+
settled: () => settled,
|
|
120
|
+
tick: () => tick,
|
|
121
|
+
unmount: () => unmount,
|
|
122
|
+
untrack: () => run
|
|
123
|
+
});
|
|
124
|
+
/** @param {() => void} fn */
|
|
125
|
+
function onDestroy(fn) {
|
|
126
|
+
/** @type {Renderer} */ ssr_context.r.on_destroy(fn);
|
|
127
|
+
}
|
|
128
|
+
function createEventDispatcher() {
|
|
129
|
+
return noop;
|
|
130
|
+
}
|
|
131
|
+
function mount() {
|
|
132
|
+
lifecycle_function_unavailable("mount");
|
|
133
|
+
}
|
|
134
|
+
function hydrate() {
|
|
135
|
+
lifecycle_function_unavailable("hydrate");
|
|
136
|
+
}
|
|
137
|
+
function unmount() {
|
|
138
|
+
lifecycle_function_unavailable("unmount");
|
|
139
|
+
}
|
|
140
|
+
function fork() {
|
|
141
|
+
lifecycle_function_unavailable("fork");
|
|
142
|
+
}
|
|
143
|
+
async function tick() {}
|
|
144
|
+
async function settled() {}
|
|
145
|
+
|
|
146
|
+
export { __commonJSMin as _, __exportAll as a, index_server_exports as i, onDestroy as o };
|
|
147
|
+
//# sourceMappingURL=index-server.js-CV2lq-ha.js.map
|