@deepseek-harness-tui/dsh-tui 0.11.2 → 0.13.0
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/README.md +60 -8
- package/assets/deepy/README.md +60 -0
- package/assets/deepy/frames.json +1 -0
- package/assets/whale-girl/whale-girl-happy.png +0 -0
- package/assets/whaleGirl/README.md +7 -0
- package/assets/whaleGirl/frames.json +1 -0
- package/assets/whaleGirl/img/building/00.png +0 -0
- package/assets/whaleGirl/img/building/01.png +0 -0
- package/assets/whaleGirl/img/building/02.png +0 -0
- package/assets/whaleGirl/img/building/03.png +0 -0
- package/assets/whaleGirl/img/building/04.png +0 -0
- package/assets/whaleGirl/img/building/05.png +0 -0
- package/assets/whaleGirl/img/building/06.png +0 -0
- package/assets/whaleGirl/img/building/07.png +0 -0
- package/assets/whaleGirl/img/building/08.png +0 -0
- package/assets/whaleGirl/img/building/09.png +0 -0
- package/assets/whaleGirl/img/building/10.png +0 -0
- package/assets/whaleGirl/img/building/11.png +0 -0
- package/assets/whaleGirl/img/building/12.png +0 -0
- package/assets/whaleGirl/img/building/13.png +0 -0
- package/assets/whaleGirl/img/building/14.png +0 -0
- package/assets/whaleGirl/img/building/15.png +0 -0
- package/assets/whaleGirl/img/building/16.png +0 -0
- package/assets/whaleGirl/img/building/17.png +0 -0
- package/assets/whaleGirl/img/building/18.png +0 -0
- package/assets/whaleGirl/img/building/19.png +0 -0
- package/assets/whaleGirl/img/building/20.png +0 -0
- package/assets/whaleGirl/img/building/21.png +0 -0
- package/assets/whaleGirl/img/building/22.png +0 -0
- package/assets/whaleGirl/img/building/23.png +0 -0
- package/assets/whaleGirl/img/carrying/00.png +0 -0
- package/assets/whaleGirl/img/carrying/01.png +0 -0
- package/assets/whaleGirl/img/carrying/02.png +0 -0
- package/assets/whaleGirl/img/carrying/03.png +0 -0
- package/assets/whaleGirl/img/carrying/04.png +0 -0
- package/assets/whaleGirl/img/carrying/05.png +0 -0
- package/assets/whaleGirl/img/carrying/06.png +0 -0
- package/assets/whaleGirl/img/carrying/07.png +0 -0
- package/assets/whaleGirl/img/compacting/00.png +0 -0
- package/assets/whaleGirl/img/compacting/01.png +0 -0
- package/assets/whaleGirl/img/compacting/02.png +0 -0
- package/assets/whaleGirl/img/compacting/03.png +0 -0
- package/assets/whaleGirl/img/compacting/04.png +0 -0
- package/assets/whaleGirl/img/compacting/05.png +0 -0
- package/assets/whaleGirl/img/compacting/06.png +0 -0
- package/assets/whaleGirl/img/compacting/07.png +0 -0
- package/assets/whaleGirl/img/compacting/08.png +0 -0
- package/assets/whaleGirl/img/compacting/09.png +0 -0
- package/assets/whaleGirl/img/conducting/00.png +0 -0
- package/assets/whaleGirl/img/conducting/01.png +0 -0
- package/assets/whaleGirl/img/conducting/02.png +0 -0
- package/assets/whaleGirl/img/conducting/03.png +0 -0
- package/assets/whaleGirl/img/conducting/04.png +0 -0
- package/assets/whaleGirl/img/conducting/05.png +0 -0
- package/assets/whaleGirl/img/conducting/06.png +0 -0
- package/assets/whaleGirl/img/conducting/07.png +0 -0
- package/assets/whaleGirl/img/conducting/08.png +0 -0
- package/assets/whaleGirl/img/conducting/09.png +0 -0
- package/assets/whaleGirl/img/conducting/10.png +0 -0
- package/assets/whaleGirl/img/conducting/11.png +0 -0
- package/assets/whaleGirl/img/drag/00.png +0 -0
- package/assets/whaleGirl/img/drag/01.png +0 -0
- package/assets/whaleGirl/img/drag/02.png +0 -0
- package/assets/whaleGirl/img/drag/03.png +0 -0
- package/assets/whaleGirl/img/drag/04.png +0 -0
- package/assets/whaleGirl/img/drag/05.png +0 -0
- package/assets/whaleGirl/img/drag/06.png +0 -0
- package/assets/whaleGirl/img/drag/07.png +0 -0
- package/assets/whaleGirl/img/drag/08.png +0 -0
- package/assets/whaleGirl/img/drag/09.png +0 -0
- package/assets/whaleGirl/img/error/00.png +0 -0
- package/assets/whaleGirl/img/error/01.png +0 -0
- package/assets/whaleGirl/img/error/02.png +0 -0
- package/assets/whaleGirl/img/error/03.png +0 -0
- package/assets/whaleGirl/img/error/04.png +0 -0
- package/assets/whaleGirl/img/error/05.png +0 -0
- package/assets/whaleGirl/img/error/06.png +0 -0
- package/assets/whaleGirl/img/error/07.png +0 -0
- package/assets/whaleGirl/img/error/08.png +0 -0
- package/assets/whaleGirl/img/error/09.png +0 -0
- package/assets/whaleGirl/img/happy/00.png +0 -0
- package/assets/whaleGirl/img/happy/01.png +0 -0
- package/assets/whaleGirl/img/happy/02.png +0 -0
- package/assets/whaleGirl/img/happy/03.png +0 -0
- package/assets/whaleGirl/img/happy/04.png +0 -0
- package/assets/whaleGirl/img/happy/05.png +0 -0
- package/assets/whaleGirl/img/happy/06.png +0 -0
- package/assets/whaleGirl/img/happy/07.png +0 -0
- package/assets/whaleGirl/img/happy/08.png +0 -0
- package/assets/whaleGirl/img/happy/09.png +0 -0
- package/assets/whaleGirl/img/happy/10.png +0 -0
- package/assets/whaleGirl/img/idle/00.png +0 -0
- package/assets/whaleGirl/img/idle/01.png +0 -0
- package/assets/whaleGirl/img/idle/02.png +0 -0
- package/assets/whaleGirl/img/idle/03.png +0 -0
- package/assets/whaleGirl/img/idle/04.png +0 -0
- package/assets/whaleGirl/img/idle/05.png +0 -0
- package/assets/whaleGirl/img/idle/06.png +0 -0
- package/assets/whaleGirl/img/idle/07.png +0 -0
- package/assets/whaleGirl/img/idle/08.png +0 -0
- package/assets/whaleGirl/img/idle/09.png +0 -0
- package/assets/whaleGirl/img/idle/10.png +0 -0
- package/assets/whaleGirl/img/idle/11.png +0 -0
- package/assets/whaleGirl/img/idle/12.png +0 -0
- package/assets/whaleGirl/img/idle/13.png +0 -0
- package/assets/whaleGirl/img/idle/14.png +0 -0
- package/assets/whaleGirl/img/idle/15.png +0 -0
- package/assets/whaleGirl/img/idle/16.png +0 -0
- package/assets/whaleGirl/img/idle/17.png +0 -0
- package/assets/whaleGirl/img/idle/18.png +0 -0
- package/assets/whaleGirl/img/idle/19.png +0 -0
- package/assets/whaleGirl/img/idle/20.png +0 -0
- package/assets/whaleGirl/img/idle-look/00.png +0 -0
- package/assets/whaleGirl/img/idle-look/01.png +0 -0
- package/assets/whaleGirl/img/idle-look/02.png +0 -0
- package/assets/whaleGirl/img/idle-look/03.png +0 -0
- package/assets/whaleGirl/img/idle-look/04.png +0 -0
- package/assets/whaleGirl/img/idle-look/05.png +0 -0
- package/assets/whaleGirl/img/idle-look/06.png +0 -0
- package/assets/whaleGirl/img/idle-look/07.png +0 -0
- package/assets/whaleGirl/img/idle-look/08.png +0 -0
- package/assets/whaleGirl/img/idle-look/09.png +0 -0
- package/assets/whaleGirl/img/idle-look/10.png +0 -0
- package/assets/whaleGirl/img/idle-look/11.png +0 -0
- package/assets/whaleGirl/img/idle-look/12.png +0 -0
- package/assets/whaleGirl/img/idle-spout/00.png +0 -0
- package/assets/whaleGirl/img/idle-spout/01.png +0 -0
- package/assets/whaleGirl/img/idle-spout/02.png +0 -0
- package/assets/whaleGirl/img/idle-spout/03.png +0 -0
- package/assets/whaleGirl/img/idle-spout/04.png +0 -0
- package/assets/whaleGirl/img/idle-spout/05.png +0 -0
- package/assets/whaleGirl/img/idle-spout/06.png +0 -0
- package/assets/whaleGirl/img/idle-spout/07.png +0 -0
- package/assets/whaleGirl/img/idle-spout/08.png +0 -0
- package/assets/whaleGirl/img/idle-spout/09.png +0 -0
- package/assets/whaleGirl/img/idle-spout/10.png +0 -0
- package/assets/whaleGirl/img/music/00.png +0 -0
- package/assets/whaleGirl/img/music/01.png +0 -0
- package/assets/whaleGirl/img/music/02.png +0 -0
- package/assets/whaleGirl/img/music/03.png +0 -0
- package/assets/whaleGirl/img/music/04.png +0 -0
- package/assets/whaleGirl/img/music/05.png +0 -0
- package/assets/whaleGirl/img/music/06.png +0 -0
- package/assets/whaleGirl/img/music/07.png +0 -0
- package/assets/whaleGirl/img/notification/00.png +0 -0
- package/assets/whaleGirl/img/notification/01.png +0 -0
- package/assets/whaleGirl/img/notification/02.png +0 -0
- package/assets/whaleGirl/img/notification/03.png +0 -0
- package/assets/whaleGirl/img/notification/04.png +0 -0
- package/assets/whaleGirl/img/notification/05.png +0 -0
- package/assets/whaleGirl/img/notification/06.png +0 -0
- package/assets/whaleGirl/img/notification/07.png +0 -0
- package/assets/whaleGirl/img/poke-left/00.png +0 -0
- package/assets/whaleGirl/img/poke-left/01.png +0 -0
- package/assets/whaleGirl/img/poke-left/02.png +0 -0
- package/assets/whaleGirl/img/poke-left/03.png +0 -0
- package/assets/whaleGirl/img/poke-left/04.png +0 -0
- package/assets/whaleGirl/img/poke-left/05.png +0 -0
- package/assets/whaleGirl/img/poke-left/06.png +0 -0
- package/assets/whaleGirl/img/poke-left/07.png +0 -0
- package/assets/whaleGirl/img/poke-left/08.png +0 -0
- package/assets/whaleGirl/img/poke-left/09.png +0 -0
- package/assets/whaleGirl/img/poke-left/10.png +0 -0
- package/assets/whaleGirl/img/poke-right/00.png +0 -0
- package/assets/whaleGirl/img/poke-right/01.png +0 -0
- package/assets/whaleGirl/img/poke-right/02.png +0 -0
- package/assets/whaleGirl/img/poke-right/03.png +0 -0
- package/assets/whaleGirl/img/poke-right/04.png +0 -0
- package/assets/whaleGirl/img/poke-right/05.png +0 -0
- package/assets/whaleGirl/img/poke-right/06.png +0 -0
- package/assets/whaleGirl/img/poke-right/07.png +0 -0
- package/assets/whaleGirl/img/poke-right/08.png +0 -0
- package/assets/whaleGirl/img/poke-right/09.png +0 -0
- package/assets/whaleGirl/img/poke-right/10.png +0 -0
- package/assets/whaleGirl/img/sleeping/00.png +0 -0
- package/assets/whaleGirl/img/sleeping/01.png +0 -0
- package/assets/whaleGirl/img/sleeping/02.png +0 -0
- package/assets/whaleGirl/img/sleeping/03.png +0 -0
- package/assets/whaleGirl/img/sleeping/04.png +0 -0
- package/assets/whaleGirl/img/sleeping/05.png +0 -0
- package/assets/whaleGirl/img/smile-hearts/00.png +0 -0
- package/assets/whaleGirl/img/smile-hearts/01.png +0 -0
- package/assets/whaleGirl/img/smile-hearts/02.png +0 -0
- package/assets/whaleGirl/img/smile-hearts/03.png +0 -0
- package/assets/whaleGirl/img/smile-hearts/04.png +0 -0
- package/assets/whaleGirl/img/smile-hearts/05.png +0 -0
- package/assets/whaleGirl/img/smile-hearts/06.png +0 -0
- package/assets/whaleGirl/img/smile-hearts/07.png +0 -0
- package/assets/whaleGirl/img/smile-hearts/08.png +0 -0
- package/assets/whaleGirl/img/smile-hearts/09.png +0 -0
- package/assets/whaleGirl/img/smile-hearts/10.png +0 -0
- package/assets/whaleGirl/img/smile-hearts/11.png +0 -0
- package/assets/whaleGirl/img/smile-hearts/12.png +0 -0
- package/assets/whaleGirl/img/smile-hearts/13.png +0 -0
- package/assets/whaleGirl/img/smile-hearts/14.png +0 -0
- package/assets/whaleGirl/img/smile-hearts/15.png +0 -0
- package/assets/whaleGirl/img/swim/00.png +0 -0
- package/assets/whaleGirl/img/swim/01.png +0 -0
- package/assets/whaleGirl/img/swim/02.png +0 -0
- package/assets/whaleGirl/img/swim/03.png +0 -0
- package/assets/whaleGirl/img/swim/04.png +0 -0
- package/assets/whaleGirl/img/swim/05.png +0 -0
- package/assets/whaleGirl/img/swim/06.png +0 -0
- package/assets/whaleGirl/img/swim/07.png +0 -0
- package/assets/whaleGirl/img/thinking/00.png +0 -0
- package/assets/whaleGirl/img/thinking/01.png +0 -0
- package/assets/whaleGirl/img/thinking/02.png +0 -0
- package/assets/whaleGirl/img/thinking/03.png +0 -0
- package/assets/whaleGirl/img/thinking/04.png +0 -0
- package/assets/whaleGirl/img/thinking/05.png +0 -0
- package/assets/whaleGirl/img/thinking/06.png +0 -0
- package/assets/whaleGirl/img/thinking/07.png +0 -0
- package/assets/whaleGirl/img/thinking/08.png +0 -0
- package/assets/whaleGirl/img/thinking/09.png +0 -0
- package/assets/whaleGirl/img/thinking/10.png +0 -0
- package/assets/whaleGirl/img/thinking/11.png +0 -0
- package/assets/whaleGirl/img/thinking/12.png +0 -0
- package/assets/whaleGirl/img/thinking/13.png +0 -0
- package/assets/whaleGirl/img/thinking/14.png +0 -0
- package/assets/whaleGirl/img/thinking/15.png +0 -0
- package/assets/whaleGirl/img/thinking/16.png +0 -0
- package/assets/whaleGirl/img/thumbs-up/00.png +0 -0
- package/assets/whaleGirl/img/thumbs-up/01.png +0 -0
- package/assets/whaleGirl/img/thumbs-up/02.png +0 -0
- package/assets/whaleGirl/img/thumbs-up/03.png +0 -0
- package/assets/whaleGirl/img/thumbs-up/04.png +0 -0
- package/assets/whaleGirl/img/thumbs-up/05.png +0 -0
- package/assets/whaleGirl/img/thumbs-up/06.png +0 -0
- package/assets/whaleGirl/img/thumbs-up/07.png +0 -0
- package/assets/whaleGirl/img/thumbs-up/08.png +0 -0
- package/assets/whaleGirl/img/thumbs-up/09.png +0 -0
- package/assets/whaleGirl/img/thumbs-up/10.png +0 -0
- package/assets/whaleGirl/img/thumbs-up/11.png +0 -0
- package/assets/whaleGirl/img/thumbs-up/12.png +0 -0
- package/assets/whaleGirl/img/tickle/00.png +0 -0
- package/assets/whaleGirl/img/tickle/01.png +0 -0
- package/assets/whaleGirl/img/tickle/02.png +0 -0
- package/assets/whaleGirl/img/tickle/03.png +0 -0
- package/assets/whaleGirl/img/tickle/04.png +0 -0
- package/assets/whaleGirl/img/tickle/05.png +0 -0
- package/assets/whaleGirl/img/tickle/06.png +0 -0
- package/assets/whaleGirl/img/tickle/07.png +0 -0
- package/assets/whaleGirl/img/tickle/08.png +0 -0
- package/assets/whaleGirl/img/tickle/09.png +0 -0
- package/assets/whaleGirl/img/tickle/10.png +0 -0
- package/assets/whaleGirl/img/tickle/11.png +0 -0
- package/assets/whaleGirl/img/tickle/12.png +0 -0
- package/assets/whaleGirl/img/tickle/13.png +0 -0
- package/assets/whaleGirl/img/timings.json +1 -0
- package/assets/whaleGirl/img/typing/00.png +0 -0
- package/assets/whaleGirl/img/typing/01.png +0 -0
- package/assets/whaleGirl/img/typing/02.png +0 -0
- package/assets/whaleGirl/img/typing/03.png +0 -0
- package/assets/whaleGirl/img/typing/04.png +0 -0
- package/assets/whaleGirl/img/typing/05.png +0 -0
- package/assets/whaleGirl/img/typing/06.png +0 -0
- package/assets/whaleGirl/img/typing/07.png +0 -0
- package/assets/whaleGirl/img/typing/08.png +0 -0
- package/assets/whaleGirl/img/typing/09.png +0 -0
- package/assets/whaleGirl/img/typing/10.png +0 -0
- package/assets/whaleGirl/img/typing/11.png +0 -0
- package/assets/whaleGirl/img/typing/12.png +0 -0
- package/assets/whaleGirl/img/typing/13.png +0 -0
- package/assets/whaleGirl/img/waking/00.png +0 -0
- package/assets/whaleGirl/img/waking/01.png +0 -0
- package/assets/whaleGirl/img/waking/02.png +0 -0
- package/assets/whaleGirl/img/waking/03.png +0 -0
- package/assets/whaleGirl/img/waking/04.png +0 -0
- package/assets/whaleGirl/img/waking/05.png +0 -0
- package/assets/whaleGirl/img/waking/06.png +0 -0
- package/assets/whaleGirl/img/waking/07.png +0 -0
- package/assets/whaleGirl/img/waking/08.png +0 -0
- package/assets/whaleGirl/img/waking/09.png +0 -0
- package/assets/whaleGirl/img/waking/10.png +0 -0
- package/bin/dsh-tui.js +38 -6
- package/cordis.patch.yml +31 -6
- package/guide/dsh-tui-guide/SKILL.md +37 -0
- package/guide/dsh-tui-guide/configuration.en.md +415 -0
- package/guide/dsh-tui-guide/configuration.md +354 -0
- package/guide/dsh-tui-guide/getting-started.en.md +401 -0
- package/guide/dsh-tui-guide/getting-started.md +399 -0
- package/guide/dsh-tui-guide/interaction.en.md +738 -0
- package/guide/dsh-tui-guide/interaction.md +793 -0
- package/guide/dsh-tui-guide/migrate.en.md +166 -0
- package/guide/dsh-tui-guide/migrate.md +132 -0
- package/guide/dsh-tui-guide/plugins.en.md +78 -0
- package/guide/dsh-tui-guide/plugins.md +64 -0
- package/guide/dsh-tui-guide/themes.en.md +197 -0
- package/guide/dsh-tui-guide/themes.md +188 -0
- package/guide/dsh-tui-guide/user-guide.en.md +711 -0
- package/guide/dsh-tui-guide/user-guide.md +666 -0
- package/guide/dsh-tui-guide/vscode.en.md +301 -0
- package/guide/dsh-tui-guide/vscode.md +272 -0
- package/lib/settings.json +219 -5
- package/lib/types/adapter/channel/ui-policy.d.ts +7 -2
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +18 -1
- package/lib/types/adapter/index.d.ts +1 -1
- package/lib/types/adapter/index.js +1 -1
- package/lib/types/adapter/kernel/host-facade.d.ts +4 -1
- package/lib/types/adapter/kernel/host-facade.d.ts.map +1 -1
- package/lib/types/adapter/kernel/host-facade.js +8 -1
- package/lib/types/adapter/kernel/runtime.d.ts.map +1 -1
- package/lib/types/adapter/kernel/runtime.js +13 -0
- package/lib/types/adapter/kernel/slices/index.d.ts +1 -0
- package/lib/types/adapter/kernel/slices/index.d.ts.map +1 -1
- package/lib/types/adapter/kernel/slices/index.js +3 -0
- package/lib/types/adapter/kernel/slices/panels.d.ts +3 -0
- package/lib/types/adapter/kernel/slices/panels.d.ts.map +1 -0
- package/lib/types/adapter/kernel/slices/panels.js +14 -0
- package/lib/types/adapter/ports/channel-capabilities.d.ts +48 -0
- package/lib/types/adapter/ports/channel-capabilities.d.ts.map +1 -0
- package/lib/types/adapter/ports/channel-capabilities.js +2 -0
- package/lib/types/adapter/ports/channel-catalog.d.ts +7 -0
- package/lib/types/adapter/ports/channel-catalog.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-display.d.ts +10 -0
- package/lib/types/adapter/ports/channel-display.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-settings.d.ts +2 -1
- package/lib/types/adapter/ports/channel-settings.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-ui.d.ts +91 -4
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +137 -9
- package/lib/types/adapter/ports/channel-view.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel.d.ts +1 -1
- package/lib/types/adapter/ports/channel.js +1 -1
- package/lib/types/adapter/ports/descriptor.d.ts +1 -1
- package/lib/types/adapter/ports/descriptor.js +1 -1
- package/lib/types/adapter/ports/index.d.ts +1 -1
- package/lib/types/adapter/ports/index.js +1 -1
- package/lib/types/adapter/ports/panels.d.ts +28 -0
- package/lib/types/adapter/ports/panels.d.ts.map +1 -0
- package/lib/types/adapter/ports/panels.js +8 -0
- package/lib/types/adapter/ports/workspace.d.ts +1 -1
- package/lib/types/adapter/ports/workspace.js +1 -1
- package/lib/types/adapter/spec/index.d.ts +2 -2
- package/lib/types/adapter/spec/index.js +2 -2
- package/lib/types/adapter/spec/profile.d.ts +6 -6
- package/lib/types/adapter/spec/profile.d.ts.map +1 -1
- package/lib/types/adapter/spec/profile.js +6 -6
- package/lib/types/adapter/spec/protocol-constants.d.ts +3 -3
- package/lib/types/adapter/spec/protocol-constants.d.ts.map +1 -1
- package/lib/types/adapter/spec/protocol-constants.js +5 -5
- package/lib/types/adapter/spec/tui-contributions.d.ts +4 -4
- package/lib/types/adapter/spec/tui-contributions.d.ts.map +1 -1
- package/lib/types/adapter/spec/tui-contributions.js +5 -5
- package/lib/types/adapter/standard/descriptor.js +1 -1
- package/lib/types/adapter/standard/index.d.ts +3 -3
- package/lib/types/adapter/standard/index.js +3 -3
- package/lib/types/adapter/standard/registry.d.ts +3 -2
- package/lib/types/adapter/standard/registry.d.ts.map +1 -1
- package/lib/types/adapter/standard/registry.js +6 -5
- package/lib/types/adapter/standard/tui-extension.d.ts +1 -1
- package/lib/types/adapter/standard/tui-extension.js +1 -1
- package/lib/types/adapter/upstream/index.d.ts +1 -0
- package/lib/types/adapter/upstream/index.d.ts.map +1 -1
- package/lib/types/adapter/upstream/index.js +1 -0
- package/lib/types/adapter/upstream/panels-driver.d.ts +18 -0
- package/lib/types/adapter/upstream/panels-driver.d.ts.map +1 -0
- package/lib/types/adapter/upstream/panels-driver.js +159 -0
- package/lib/types/api.d.ts +2 -0
- package/lib/types/api.d.ts.map +1 -1
- package/lib/types/api.js +3 -1
- package/lib/types/commands.d.ts.map +1 -1
- package/lib/types/commands.js +12 -4
- package/lib/types/components/ActivityLine.d.ts +6 -9
- package/lib/types/components/ActivityLine.d.ts.map +1 -1
- package/lib/types/components/ActivityLine.js +7 -8
- package/lib/types/components/Chat/JobCard.d.ts +27 -1
- package/lib/types/components/Chat/JobCard.d.ts.map +1 -1
- package/lib/types/components/Chat/JobCard.js +128 -33
- package/lib/types/components/Chat/JobGroupHeader.d.ts +27 -0
- package/lib/types/components/Chat/JobGroupHeader.d.ts.map +1 -0
- package/lib/types/components/Chat/JobGroupHeader.js +62 -0
- package/lib/types/components/Chat/SubagentMessage.js +6 -6
- package/lib/types/components/GoalTodoPanel.d.ts +13 -1
- package/lib/types/components/GoalTodoPanel.d.ts.map +1 -1
- package/lib/types/components/GoalTodoPanel.js +55 -14
- package/lib/types/components/JobsPanel.d.ts +42 -2
- package/lib/types/components/JobsPanel.d.ts.map +1 -1
- package/lib/types/components/JobsPanel.js +220 -40
- package/lib/types/components/LogoV2.d.ts +43 -3
- package/lib/types/components/LogoV2.d.ts.map +1 -1
- package/lib/types/components/LogoV2.js +42 -15
- package/lib/types/components/MessageList.d.ts +8 -2
- package/lib/types/components/MessageList.d.ts.map +1 -1
- package/lib/types/components/MessageList.js +215 -21
- package/lib/types/components/OverlayAbove.d.ts +11 -1
- package/lib/types/components/OverlayAbove.d.ts.map +1 -1
- package/lib/types/components/OverlayAbove.js +2 -12
- package/lib/types/components/PageMargin.d.ts.map +1 -1
- package/lib/types/components/PageMargin.js +3 -1
- package/lib/types/components/PluginSceneBoundary.d.ts +1 -1
- package/lib/types/components/PluginSceneBoundary.js +1 -1
- package/lib/types/components/PresetPicker.d.ts +4 -0
- package/lib/types/components/PresetPicker.d.ts.map +1 -1
- package/lib/types/components/PresetPicker.js +5 -1
- package/lib/types/components/PromptInput.d.ts +20 -22
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +425 -157
- package/lib/types/components/SearchBox.d.ts +22 -5
- package/lib/types/components/SearchBox.d.ts.map +1 -1
- package/lib/types/components/SearchBox.js +17 -13
- package/lib/types/components/StarPrompt.d.ts +6 -0
- package/lib/types/components/StarPrompt.d.ts.map +1 -1
- package/lib/types/components/StarPrompt.js +45 -0
- package/lib/types/components/SubagentCard.d.ts.map +1 -1
- package/lib/types/components/SubagentCard.js +24 -9
- package/lib/types/components/SubagentDashboard.d.ts +18 -3
- package/lib/types/components/SubagentDashboard.d.ts.map +1 -1
- package/lib/types/components/SubagentDashboard.js +53 -5
- package/lib/types/components/SubagentDetailScene.d.ts +7 -1
- package/lib/types/components/SubagentDetailScene.d.ts.map +1 -1
- package/lib/types/components/SubagentDetailScene.js +160 -13
- package/lib/types/components/SurfaceEdges.d.ts +21 -0
- package/lib/types/components/SurfaceEdges.d.ts.map +1 -0
- package/lib/types/components/SurfaceEdges.js +7 -0
- package/lib/types/components/ThemePicker.d.ts +9 -0
- package/lib/types/components/ThemePicker.d.ts.map +1 -1
- package/lib/types/components/ThemePicker.js +74 -10
- package/lib/types/components/ThemePreviewPane.d.ts +26 -0
- package/lib/types/components/ThemePreviewPane.d.ts.map +1 -0
- package/lib/types/components/ThemePreviewPane.js +99 -0
- package/lib/types/components/WhaleGirl.d.ts +6 -0
- package/lib/types/components/WhaleGirl.d.ts.map +1 -1
- package/lib/types/components/WhaleGirl.js +18 -0
- package/lib/types/components/design-system/Divider.d.ts.map +1 -1
- package/lib/types/components/design-system/Divider.js +14 -9
- package/lib/types/components/launchpadActions.d.ts +73 -0
- package/lib/types/components/launchpadActions.d.ts.map +1 -0
- package/lib/types/components/launchpadActions.js +111 -0
- package/lib/types/components/launchpadLayout.d.ts +62 -0
- package/lib/types/components/launchpadLayout.d.ts.map +1 -0
- package/lib/types/components/launchpadLayout.js +176 -0
- package/lib/types/components/messages/AssistantThinkingMessage.js +4 -4
- package/lib/types/components/onboardingModel.d.ts +83 -0
- package/lib/types/components/onboardingModel.d.ts.map +1 -0
- package/lib/types/components/onboardingModel.js +128 -0
- package/lib/types/components/sidePanel/InfoPanel.d.ts +17 -0
- package/lib/types/components/sidePanel/InfoPanel.d.ts.map +1 -0
- package/lib/types/components/sidePanel/InfoPanel.js +124 -0
- package/lib/types/components/sidePanel/PanelBar.d.ts +45 -0
- package/lib/types/components/sidePanel/PanelBar.d.ts.map +1 -0
- package/lib/types/components/sidePanel/PanelBar.js +104 -0
- package/lib/types/components/sidePanel/PanelErrorBoundary.d.ts +21 -0
- package/lib/types/components/sidePanel/PanelErrorBoundary.d.ts.map +1 -0
- package/lib/types/components/sidePanel/PanelErrorBoundary.js +30 -0
- package/lib/types/components/sidePanel/PanelHost.d.ts +36 -0
- package/lib/types/components/sidePanel/PanelHost.d.ts.map +1 -0
- package/lib/types/components/sidePanel/PanelHost.js +81 -0
- package/lib/types/components/sidePanel/PanelPicker.d.ts +24 -0
- package/lib/types/components/sidePanel/PanelPicker.d.ts.map +1 -0
- package/lib/types/components/sidePanel/PanelPicker.js +45 -0
- package/lib/types/components/sidePanel/PanelStore.d.ts +55 -0
- package/lib/types/components/sidePanel/PanelStore.d.ts.map +1 -0
- package/lib/types/components/sidePanel/PanelStore.js +109 -0
- package/lib/types/components/sidePanel/SidePanelColumn.d.ts +31 -0
- package/lib/types/components/sidePanel/SidePanelColumn.d.ts.map +1 -0
- package/lib/types/components/sidePanel/SidePanelColumn.js +70 -0
- package/lib/types/components/sidePanel/SidePanelLayout.d.ts +54 -0
- package/lib/types/components/sidePanel/SidePanelLayout.d.ts.map +1 -0
- package/lib/types/components/sidePanel/SidePanelLayout.js +81 -0
- package/lib/types/components/sidePanel/SidePanelRuntimeContext.d.ts +43 -0
- package/lib/types/components/sidePanel/SidePanelRuntimeContext.d.ts.map +1 -0
- package/lib/types/components/sidePanel/SidePanelRuntimeContext.js +26 -0
- package/lib/types/components/sidePanel/TrajectoryPanel.d.ts +7 -0
- package/lib/types/components/sidePanel/TrajectoryPanel.d.ts.map +1 -0
- package/lib/types/components/sidePanel/TrajectoryPanel.js +263 -0
- package/lib/types/components/sidePanel/WorkspacePanel.d.ts +4 -0
- package/lib/types/components/sidePanel/WorkspacePanel.d.ts.map +1 -0
- package/lib/types/components/sidePanel/WorkspacePanel.js +171 -0
- package/lib/types/components/sidePanel/builtinPanels.d.ts +3 -0
- package/lib/types/components/sidePanel/builtinPanels.d.ts.map +1 -0
- package/lib/types/components/sidePanel/builtinPanels.js +229 -0
- package/lib/types/components/sidePanel/companion/CompanionPanel.d.ts +53 -0
- package/lib/types/components/sidePanel/companion/CompanionPanel.d.ts.map +1 -0
- package/lib/types/components/sidePanel/companion/CompanionPanel.js +528 -0
- package/lib/types/components/sidePanel/companion/SplashMascot.d.ts +32 -0
- package/lib/types/components/sidePanel/companion/SplashMascot.d.ts.map +1 -0
- package/lib/types/components/sidePanel/companion/SplashMascot.js +103 -0
- package/lib/types/components/sidePanel/companion/deepy.d.ts +75 -0
- package/lib/types/components/sidePanel/companion/deepy.d.ts.map +1 -0
- package/lib/types/components/sidePanel/companion/deepy.js +222 -0
- package/lib/types/components/sidePanel/companion/mood.d.ts +176 -0
- package/lib/types/components/sidePanel/companion/mood.d.ts.map +1 -0
- package/lib/types/components/sidePanel/companion/mood.js +212 -0
- package/lib/types/components/sidePanel/companion/pose.d.ts +43 -0
- package/lib/types/components/sidePanel/companion/pose.d.ts.map +1 -0
- package/lib/types/components/sidePanel/companion/pose.js +34 -0
- package/lib/types/components/sidePanel/companion/skins.d.ts +102 -0
- package/lib/types/components/sidePanel/companion/skins.d.ts.map +1 -0
- package/lib/types/components/sidePanel/companion/skins.js +408 -0
- package/lib/types/components/sidePanel/dimensions.d.ts +60 -0
- package/lib/types/components/sidePanel/dimensions.d.ts.map +1 -0
- package/lib/types/components/sidePanel/dimensions.js +75 -0
- package/lib/types/components/sidePanel/jobsFocusStore.d.ts +21 -0
- package/lib/types/components/sidePanel/jobsFocusStore.d.ts.map +1 -0
- package/lib/types/components/sidePanel/jobsFocusStore.js +30 -0
- package/lib/types/components/sidePanel/panelBridge.d.ts +44 -0
- package/lib/types/components/sidePanel/panelBridge.d.ts.map +1 -0
- package/lib/types/components/sidePanel/panelBridge.js +55 -0
- package/lib/types/components/sidePanel/pluginPanelAdapter.d.ts +22 -0
- package/lib/types/components/sidePanel/pluginPanelAdapter.d.ts.map +1 -0
- package/lib/types/components/sidePanel/pluginPanelAdapter.js +148 -0
- package/lib/types/components/sidePanel/types.d.ts +110 -0
- package/lib/types/components/sidePanel/types.d.ts.map +1 -0
- package/lib/types/components/sidePanel/types.js +1 -0
- package/lib/types/components/sidePanel/usePanelInput.d.ts +5 -0
- package/lib/types/components/sidePanel/usePanelInput.d.ts.map +1 -0
- package/lib/types/components/sidePanel/usePanelInput.js +44 -0
- package/lib/types/components/sidePanel/useSidePanel.d.ts +47 -0
- package/lib/types/components/sidePanel/useSidePanel.d.ts.map +1 -0
- package/lib/types/components/sidePanel/useSidePanel.js +284 -0
- package/lib/types/components/trajectory/MiniWake.d.ts +11 -1
- package/lib/types/components/trajectory/MiniWake.d.ts.map +1 -1
- package/lib/types/components/trajectory/MiniWake.js +9 -3
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts +3 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.d.ts.map +1 -1
- package/lib/types/components/workspaces/HomeWorkspaceRow.js +3 -2
- package/lib/types/deepseekPricing.d.ts +10 -9
- package/lib/types/deepseekPricing.d.ts.map +1 -1
- package/lib/types/deepseekPricing.js +18 -11
- package/lib/types/dsh-adapter/channel/attached-context.d.ts +58 -0
- package/lib/types/dsh-adapter/channel/attached-context.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/attached-context.js +109 -0
- package/lib/types/dsh-adapter/channel/binding-events.d.ts +6 -0
- package/lib/types/dsh-adapter/channel/binding-events.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/binding-events.js +43 -0
- package/lib/types/dsh-adapter/channel/capabilities.d.ts +82 -0
- package/lib/types/dsh-adapter/channel/capabilities.d.ts.map +1 -0
- package/lib/types/dsh-adapter/channel/capabilities.js +165 -0
- package/lib/types/dsh-adapter/channel/command-completions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/command-completions.js +8 -0
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts +4 -12
- package/lib/types/dsh-adapter/channel/context-bookkeeping.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/context-bookkeeping.js +9 -4
- package/lib/types/dsh-adapter/channel/external-commands.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/external-commands.js +8 -2
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts +13 -2
- package/lib/types/dsh-adapter/channel/input-delivery.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/input-delivery.js +18 -1
- package/lib/types/dsh-adapter/channel/job-projection.d.ts +1 -0
- package/lib/types/dsh-adapter/channel/job-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/job-projection.js +88 -3
- package/lib/types/dsh-adapter/channel/mode-actions.d.ts +13 -3
- package/lib/types/dsh-adapter/channel/mode-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mode-actions.js +55 -9
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts +8 -1
- package/lib/types/dsh-adapter/channel/mode-permission-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mode-permission-actions.js +25 -10
- package/lib/types/dsh-adapter/channel/preferences.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/preferences.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/preferences.js +26 -8
- package/lib/types/dsh-adapter/channel/projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/projection.js +42 -37
- package/lib/types/dsh-adapter/channel/reports.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/reports.js +13 -4
- package/lib/types/dsh-adapter/channel/session-reset.d.ts +5 -1
- package/lib/types/dsh-adapter/channel/session-reset.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/session-reset.js +1 -0
- package/lib/types/dsh-adapter/channel/state.d.ts +21 -3
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +3 -2
- package/lib/types/dsh-adapter/channel/subagent-projection.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/subagent-projection.js +5 -0
- package/lib/types/dsh-adapter/channel/types.d.ts +1 -1
- package/lib/types/dsh-adapter/channel/types.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/usage.d.ts +18 -1
- package/lib/types/dsh-adapter/channel/usage.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/usage.js +97 -2
- package/lib/types/dsh-adapter/channel.d.ts +1 -1
- package/lib/types/dsh-adapter/channel.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel.js +72 -4
- package/lib/types/dsh-adapter/context-occupancy.d.ts +204 -0
- package/lib/types/dsh-adapter/context-occupancy.d.ts.map +1 -0
- package/lib/types/dsh-adapter/context-occupancy.js +299 -0
- package/lib/types/dsh-adapter/contract.d.ts +19 -4
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +33 -3
- package/lib/types/dsh-adapter/index.d.ts +32 -0
- package/lib/types/dsh-adapter/index.d.ts.map +1 -1
- package/lib/types/dsh-adapter/index.js +20 -1
- package/lib/types/dsh-adapter/jobs.d.ts +82 -16
- package/lib/types/dsh-adapter/jobs.d.ts.map +1 -1
- package/lib/types/dsh-adapter/jobs.js +104 -9
- package/lib/types/dsh-adapter/migrate/sessionize.d.ts.map +1 -1
- package/lib/types/dsh-adapter/migrate/sessionize.js +11 -12
- package/lib/types/dsh-adapter/oauth/bonus.d.ts +27 -0
- package/lib/types/dsh-adapter/oauth/bonus.d.ts.map +1 -0
- package/lib/types/dsh-adapter/oauth/bonus.js +69 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/command.d.ts +2 -1
- package/lib/types/dsh-adapter/oauth/command.d.ts.map +1 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/command.js +7 -4
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/credentials.d.ts +13 -10
- package/lib/types/dsh-adapter/oauth/credentials.d.ts.map +1 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/credentials.js +61 -23
- package/lib/types/dsh-adapter/oauth/deepseek.d.ts +39 -0
- package/lib/types/dsh-adapter/oauth/deepseek.d.ts.map +1 -0
- package/lib/types/dsh-adapter/oauth/deepseek.js +189 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/index.d.ts +24 -16
- package/lib/types/dsh-adapter/oauth/index.d.ts.map +1 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/index.js +34 -20
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/interaction.d.ts +14 -12
- package/lib/types/dsh-adapter/oauth/interaction.d.ts.map +1 -0
- package/lib/types/dsh-adapter/oauth/interaction.js +283 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/opener.d.ts +2 -1
- package/lib/types/dsh-adapter/oauth/opener.d.ts.map +1 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/opener.js +1 -1
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/pi-ai.d.ts +10 -3
- package/lib/types/dsh-adapter/oauth/pi-ai.d.ts.map +1 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/pi-ai.js +8 -3
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/profiles.d.ts +6 -3
- package/lib/types/dsh-adapter/oauth/profiles.d.ts.map +1 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/profiles.js +11 -3
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/service.d.ts +14 -7
- package/lib/types/dsh-adapter/oauth/service.d.ts.map +1 -0
- package/{node_modules/@deepseek-harness-tui/dsh-auth/lib → lib/types/dsh-adapter/oauth}/service.js +82 -17
- package/lib/types/dsh-adapter/panel-runtime-registry.d.ts +39 -0
- package/lib/types/dsh-adapter/panel-runtime-registry.d.ts.map +1 -0
- package/lib/types/dsh-adapter/panel-runtime-registry.js +84 -0
- package/lib/types/dsh-adapter/panels.d.ts +251 -0
- package/lib/types/dsh-adapter/panels.d.ts.map +1 -0
- package/lib/types/dsh-adapter/panels.js +407 -0
- package/lib/types/dsh-adapter/plugin-host.js +1 -1
- package/lib/types/dsh-adapter/plugin.d.ts +25 -2
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +241 -44
- package/lib/types/dsh-adapter/presets.d.ts +26 -4
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +29 -5
- package/lib/types/dsh-adapter/providerWizard.d.ts.map +1 -1
- package/lib/types/dsh-adapter/providerWizard.js +6 -2
- package/lib/types/dsh-adapter/startup-args.d.ts +8 -0
- package/lib/types/dsh-adapter/startup-args.d.ts.map +1 -0
- package/lib/types/dsh-adapter/startup-args.js +34 -0
- package/lib/types/dsh-adapter/subagents.d.ts +1 -0
- package/lib/types/dsh-adapter/subagents.d.ts.map +1 -1
- package/lib/types/dsh-adapter/subagents.js +10 -1
- package/lib/types/history.d.ts +24 -7
- package/lib/types/history.d.ts.map +1 -1
- package/lib/types/history.js +77 -18
- package/lib/types/i18n.d.ts +908 -33
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +355 -17
- package/lib/types/ink/components/App.d.ts +14 -1
- package/lib/types/ink/components/App.d.ts.map +1 -1
- package/lib/types/ink/components/App.js +71 -61
- package/lib/types/ink/components/TerminalSizeContext.d.ts +7 -0
- package/lib/types/ink/components/TerminalSizeContext.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-input.d.ts +11 -0
- package/lib/types/ink/hooks/use-input.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-input.js +8 -2
- package/lib/types/ink/hooks/use-terminal-viewport.d.ts.map +1 -1
- package/lib/types/ink/hooks/use-terminal-viewport.js +3 -1
- package/lib/types/ink/ink.d.ts +18 -0
- package/lib/types/ink/ink.d.ts.map +1 -1
- package/lib/types/ink/ink.js +51 -8
- package/lib/types/ink/output.d.ts +10 -1
- package/lib/types/ink/output.d.ts.map +1 -1
- package/lib/types/ink/output.js +3 -3
- package/lib/types/ink/parse-keypress.d.ts +71 -3
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +815 -133
- package/lib/types/ink/render-node-to-output.d.ts +1 -1
- package/lib/types/ink/render-node-to-output.d.ts.map +1 -1
- package/lib/types/ink/render-node-to-output.js +37 -5
- package/lib/types/ink/screen.d.ts +26 -1
- package/lib/types/ink/screen.d.ts.map +1 -1
- package/lib/types/ink/screen.js +96 -1
- package/lib/types/ink/selection.d.ts +23 -1
- package/lib/types/ink/selection.d.ts.map +1 -1
- package/lib/types/ink/selection.js +102 -26
- package/lib/types/ink/sixel-codec.d.ts +11 -0
- package/lib/types/ink/sixel-codec.d.ts.map +1 -1
- package/lib/types/ink/sixel-codec.js +42 -8
- package/lib/types/ink/terminal-querier.d.ts +25 -0
- package/lib/types/ink/terminal-querier.d.ts.map +1 -1
- package/lib/types/ink/terminal-querier.js +42 -0
- package/lib/types/ink/update-overflow-guard.d.ts +24 -0
- package/lib/types/ink/update-overflow-guard.d.ts.map +1 -1
- package/lib/types/ink/update-overflow-guard.js +25 -3
- package/lib/types/math/renderer.d.ts +2 -0
- package/lib/types/math/renderer.d.ts.map +1 -1
- package/lib/types/math/renderer.js +4 -0
- package/lib/types/minimalUiMode.d.ts +19 -0
- package/lib/types/minimalUiMode.d.ts.map +1 -0
- package/lib/types/minimalUiMode.js +23 -0
- package/lib/types/oauth.d.ts +5 -10
- package/lib/types/oauth.d.ts.map +1 -1
- package/lib/types/oauth.js +5 -10
- package/lib/types/onboardingPrefs.d.ts +52 -0
- package/lib/types/onboardingPrefs.d.ts.map +1 -0
- package/lib/types/onboardingPrefs.js +107 -0
- package/lib/types/panels.d.ts +4 -0
- package/lib/types/panels.d.ts.map +1 -0
- package/lib/types/panels.js +4 -0
- package/lib/types/screens/Chat.d.ts +25 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +1149 -302
- package/lib/types/screens/Launchpad.d.ts +194 -0
- package/lib/types/screens/Launchpad.d.ts.map +1 -0
- package/lib/types/screens/Launchpad.js +607 -0
- package/lib/types/screens/Onboarding.d.ts +37 -0
- package/lib/types/screens/Onboarding.d.ts.map +1 -0
- package/lib/types/screens/Onboarding.js +492 -0
- package/lib/types/screens/SessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/SessionSupervisor.js +18 -12
- package/lib/types/screens/StatusLine.d.ts +4 -0
- package/lib/types/screens/StatusLine.d.ts.map +1 -1
- package/lib/types/screens/StatusLine.js +43 -25
- package/lib/types/screens/StatusMetrics.d.ts +22 -0
- package/lib/types/screens/StatusMetrics.d.ts.map +1 -1
- package/lib/types/screens/StatusMetrics.js +20 -0
- package/lib/types/screens/chatOverlay.d.ts +18 -1
- package/lib/types/screens/chatOverlay.d.ts.map +1 -1
- package/lib/types/screens/chatOverlay.js +3 -0
- package/lib/types/screens/sessionSupervisor/model.d.ts +1 -2
- package/lib/types/screens/sessionSupervisor/model.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/model.js +4 -2
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.d.ts.map +1 -1
- package/lib/types/screens/sessionSupervisor/useSessionSupervisor.js +7 -3
- package/lib/types/settings/definitions.d.ts +93 -0
- package/lib/types/settings/definitions.d.ts.map +1 -1
- package/lib/types/settings/definitions.js +87 -4
- package/lib/types/tips.d.ts.map +1 -1
- package/lib/types/tips.js +13 -7
- package/lib/types/tuiDisplayPrefs.d.ts +42 -2
- package/lib/types/tuiDisplayPrefs.d.ts.map +1 -1
- package/lib/types/tuiDisplayPrefs.js +74 -0
- package/lib/types/update.d.ts +53 -9
- package/lib/types/update.d.ts.map +1 -1
- package/lib/types/update.js +103 -46
- package/lib/types/utils/bmp.d.ts.map +1 -1
- package/lib/types/utils/bmp.js +8 -1
- package/lib/types/utils/clipboard.d.ts.map +1 -1
- package/lib/types/utils/clipboard.js +25 -6
- package/lib/types/utils/credentials.d.ts.map +1 -1
- package/lib/types/utils/credentials.js +5 -1
- package/lib/types/utils/draftWordBoundary.d.ts +23 -0
- package/lib/types/utils/draftWordBoundary.d.ts.map +1 -0
- package/lib/types/utils/draftWordBoundary.js +161 -0
- package/lib/types/utils/fileTarget.d.ts.map +1 -1
- package/lib/types/utils/fileTarget.js +7 -9
- package/lib/types/utils/inputPaste.d.ts +62 -0
- package/lib/types/utils/inputPaste.d.ts.map +1 -0
- package/lib/types/utils/inputPaste.js +111 -0
- package/lib/types/utils/intl.d.ts +8 -0
- package/lib/types/utils/intl.d.ts.map +1 -1
- package/lib/types/utils/intl.js +11 -0
- package/lib/types/utils/keymap.d.ts +13 -3
- package/lib/types/utils/keymap.d.ts.map +1 -1
- package/lib/types/utils/keymap.js +27 -5
- package/lib/types/utils/pastedImagePath.d.ts +8 -0
- package/lib/types/utils/pastedImagePath.d.ts.map +1 -1
- package/lib/types/utils/pastedImagePath.js +29 -5
- package/package.json +128 -106
- package/presets/liangshen/agent.cordis.yml +4 -1
- package/presets/liangshen/preset.yml +1 -1
- package/{dsh-ecosystem-spec → tui-profile}/registry/README.md +1 -1
- package/{dsh-ecosystem-spec → tui-profile}/registry/registry-0.15.json +1 -1
- package/lib/types/minimalMode.d.ts +0 -13
- package/lib/types/minimalMode.d.ts.map +0 -1
- package/lib/types/minimalMode.js +0 -17
- package/node_modules/@deepseek-harness-tui/dsh-auth/LICENSE +0 -21
- package/node_modules/@deepseek-harness-tui/dsh-auth/README.md +0 -143
- package/node_modules/@deepseek-harness-tui/dsh-auth/cordis.patch.yml +0 -11
- package/node_modules/@deepseek-harness-tui/dsh-auth/dsh-plugin.json +0 -44
- package/node_modules/@deepseek-harness-tui/dsh-auth/lib/interaction.js +0 -193
- package/node_modules/@deepseek-harness-tui/dsh-auth/package.json +0 -69
- /package/{dsh-ecosystem-spec → tui-profile}/protocols/profile-definitions.d.ts +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/protocols/profile-definitions.js +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/protocols/tui-channel-http.d.ts +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/protocols/tui-channel-http.js +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/protocols/tui-channel.d.ts +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/protocols/tui-channel.js +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/protocols/tui-contributions.d.ts +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/protocols/tui-contributions.js +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/registry/contracts/decision-events-v1alpha1.json +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/registry/contracts/scene-v1alpha1.json +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/registry/contracts/settings-section-v1alpha1.json +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/registry/contracts/tui-channel-v1alpha1.json +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/registry/contracts/workspace-provider-v1alpha1.json +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/registry/host-descriptor.tui.example.json +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/registry/permissions-0.1.json +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/schemas/conformance-claim.schema.json +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/schemas/effect-ledger-record.schema.json +0 -0
- /package/{dsh-ecosystem-spec → tui-profile}/schemas/host-descriptor.schema.json +0 -0
|
@@ -5,11 +5,13 @@ import { createCommandCompletions } from './channel/command-completions.js';
|
|
|
5
5
|
import { createLocalActions } from './channel/local-actions.js';
|
|
6
6
|
import { createDetachedHandleFactory } from './channel/lifetime-resources.js';
|
|
7
7
|
import { createContextBookkeeping } from './channel/context-bookkeeping.js';
|
|
8
|
+
import { resolveContextOccupancy } from './context-occupancy.js';
|
|
8
9
|
import { createChannelActionMethods, createChannelActionReadiness } from './channel/action-readiness.js';
|
|
9
10
|
import { createBindingEvents } from './channel/binding-events.js';
|
|
10
11
|
import { createInitialChannelView } from './channel/state.js';
|
|
11
12
|
import { createChannelProjection } from './channel/projection.js';
|
|
12
13
|
import { createManualCompaction } from './channel/compaction.js';
|
|
14
|
+
import { agentCapabilityEvidence, annotateCommandCapabilities, resolveAgentCapabilities } from './channel/capabilities.js';
|
|
13
15
|
import { createSessionAdoption } from './channel/session-adoption.js';
|
|
14
16
|
import { createRewindPromptAction } from './channel/session-actions.js';
|
|
15
17
|
import { createForkSessionAction } from './channel/session-fork.js';
|
|
@@ -32,6 +34,7 @@ import { createSkillCatalog } from './channel/skill-catalog.js';
|
|
|
32
34
|
import { createBackgroundCurrentAction } from './channel/background-action.js';
|
|
33
35
|
import { createSubagentProjection } from './channel/subagent-projection.js';
|
|
34
36
|
import { createChannelNotifications } from './channel/notifications.js';
|
|
37
|
+
import { createAttachedContextRegistry } from './channel/attached-context.js';
|
|
35
38
|
import { createSelectionAttachments } from './channel/ide-selection.js';
|
|
36
39
|
import { IdeChannel, ideLockDir } from './ide-channel.js';
|
|
37
40
|
import { adapterRuntimeFor } from '../adapter/kernel/runtime-context.js';
|
|
@@ -162,6 +165,7 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
162
165
|
const jobControl = jobProjection.control;
|
|
163
166
|
const attachJobs = jobProjection.attach;
|
|
164
167
|
const resetJobProjection = jobProjection.reset;
|
|
168
|
+
const reanchorJobProjection = jobProjection.reanchor;
|
|
165
169
|
// The DSH slash-command registry (optional service): /plan, /goal and
|
|
166
170
|
// friends register here; the TUI merges their descriptors into the slash
|
|
167
171
|
// menu and dispatches through `execute` (which logs the paired
|
|
@@ -275,8 +279,13 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
275
279
|
void ideChannel.rebind(state.cwd).catch(() => { });
|
|
276
280
|
};
|
|
277
281
|
const selectionAttachments = createSelectionAttachments();
|
|
282
|
+
// "Send to Chat" (side-panel §6.7): staged panel contexts are a session-scoped
|
|
283
|
+
// projection like the selection above — the registry writes through the live
|
|
284
|
+
// state (so the shared `session-projection reset` clears them with everything
|
|
285
|
+
// else) and the submit path takes them off in one step.
|
|
286
|
+
const contextRegistry = createAttachedContextRegistry(() => state, () => state.emit());
|
|
278
287
|
const composer = createComposerImages(ctx, owner, { generation: () => state.agentBindingGeneration });
|
|
279
|
-
const inputDelivery = createInputDelivery(ctx, owner, binding, () => state, (...args) => notify(...args), trackPending, untrackPending, composer, () => currentSelection, (messageId, info) => selectionAttachments.remember(messageId, info));
|
|
288
|
+
const inputDelivery = createInputDelivery(ctx, owner, binding, () => state, (...args) => notify(...args), trackPending, untrackPending, composer, () => currentSelection, (messageId, info) => selectionAttachments.remember(messageId, info), () => contextRegistry.consume());
|
|
280
289
|
const { dispatchUserText, deliverUserText, retireAttachment, withDecisionPending, clearStagedImages } = inputDelivery;
|
|
281
290
|
/**
|
|
282
291
|
* The `tui/session-switch` decision event (pi's `session_before_switch`),
|
|
@@ -390,6 +399,13 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
390
399
|
return actionReadiness.getReadyActions();
|
|
391
400
|
};
|
|
392
401
|
const actionMethods = createChannelActionMethods(getReadyActions);
|
|
402
|
+
// Capability facts for the bound agent (channel/capabilities.ts). Reads are
|
|
403
|
+
// service lookups, so both consumers may call it freely: the public
|
|
404
|
+
// `capabilities()` accessor and the command-list annotation below.
|
|
405
|
+
const capabilitiesOf = () => resolveAgentCapabilities(agentCapabilityEvidence(ctx, binding.agent));
|
|
406
|
+
// Official occupancy source (absent in compositions without the token meter):
|
|
407
|
+
// `read` is a cached lookup, so the accessor on the state below stays cheap.
|
|
408
|
+
const contextPressure = options.contextPressure;
|
|
393
409
|
const state = {
|
|
394
410
|
...createInputActions(() => state, () => binding.agent, owner, inputConvergence, composer, (text, placement, images) => dispatchUserText(text, placement, images), (command, includeInContext) => getReadyActions().runLocalCommand(command, includeInContext)),
|
|
395
411
|
subscribe: emitter.subscribe,
|
|
@@ -413,7 +429,30 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
413
429
|
mode: sessionModes[0],
|
|
414
430
|
cwdDescription: workspaceService.describe(options.cwd).description ?? options.cwd,
|
|
415
431
|
}),
|
|
416
|
-
|
|
432
|
+
// Deprecated pre-rename alias of `minimalUi`. An accessor is required here
|
|
433
|
+
// (a field set in createInitialChannelView would be copied by the spread
|
|
434
|
+
// into a stale data property). Read-only on purpose: the only supported
|
|
435
|
+
// write path is `setMinimalUi()` / its `setMinimal()` alias, and the
|
|
436
|
+
// frozen `ChannelUi` view third-party scenes receive exposes it read-only
|
|
437
|
+
// anyway.
|
|
438
|
+
get minimal() {
|
|
439
|
+
return state.minimalUi;
|
|
440
|
+
},
|
|
441
|
+
/**
|
|
442
|
+
* Context occupancy is DERIVED here, not stored: it combines the cached
|
|
443
|
+
* host projection value (a map lookup) with this channel's own fallback
|
|
444
|
+
* sample and capacity. An accessor is what keeps "one source of truth"
|
|
445
|
+
* true without republishing a derived value from every mutation site that
|
|
446
|
+
* can move the window or the sample (replay, resume, model switch, reset).
|
|
447
|
+
*/
|
|
448
|
+
get contextOccupancy() {
|
|
449
|
+
return resolveContextOccupancy(contextPressure?.read(state.sessionId), state.lastUsage, state.contextWindow);
|
|
450
|
+
},
|
|
451
|
+
// Annotated from the start: Help and `/` completion read `commandList`
|
|
452
|
+
// before the first skill-catalog refresh publishes a new one, and a command
|
|
453
|
+
// whose capability is missing must never look usable in that window.
|
|
454
|
+
commandList: annotateCommandCapabilities(LOCAL_COMMANDS, capabilitiesOf()),
|
|
455
|
+
capabilities: capabilitiesOf,
|
|
417
456
|
...actionMethods,
|
|
418
457
|
subagentControl,
|
|
419
458
|
jobControl,
|
|
@@ -424,6 +463,11 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
424
463
|
discardStagedImage: composer.discardStagedImage,
|
|
425
464
|
stagedImage: composer.stagedImage,
|
|
426
465
|
stagedImageLimits: composer.stagedImageLimits,
|
|
466
|
+
// "Send to Chat" projection + actions (see `contextRegistry` above; its
|
|
467
|
+
// methods close over the registry's own state, so they carry no `this`).
|
|
468
|
+
attachedContexts: [],
|
|
469
|
+
attachContext: contextRegistry.attach,
|
|
470
|
+
detachContext: contextRegistry.detach,
|
|
427
471
|
/**
|
|
428
472
|
* The `tui/rewind-prompt` decision event (pi's `session_before_fork`):
|
|
429
473
|
* fired when the rewind picker confirms a message, before any fork
|
|
@@ -493,6 +537,18 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
493
537
|
// callback. The renderer lease binds its external authority later, but this
|
|
494
538
|
// owner already makes teardown and construction failure fail closed.
|
|
495
539
|
registerChannelOwner(state, owner);
|
|
540
|
+
// The projection's change feed is the only thing that can move occupancy
|
|
541
|
+
// between session events (a compaction rewriting the surface, the prompt
|
|
542
|
+
// growing before the next request); republish so the footer, the status
|
|
543
|
+
// commands and the warning read the fresh value immediately. The store is
|
|
544
|
+
// host-wide, so the emit is unconditional — the accessor already ignores
|
|
545
|
+
// another session's value.
|
|
546
|
+
if (contextPressure !== undefined) {
|
|
547
|
+
owner.own(contextPressure.subscribe(() => {
|
|
548
|
+
if (owner.current())
|
|
549
|
+
state.emit();
|
|
550
|
+
}));
|
|
551
|
+
}
|
|
496
552
|
// Agent-view is activated after the complete state/action surface exists:
|
|
497
553
|
// no roster callback or persistence continuation can observe an unbound UI.
|
|
498
554
|
agentView = createAgentViewProjection(ctx, {
|
|
@@ -528,7 +584,13 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
528
584
|
commandService,
|
|
529
585
|
agent: () => binding.agent,
|
|
530
586
|
cwd: () => state.cwd,
|
|
531
|
-
setCommands(commands) {
|
|
587
|
+
setCommands(commands) {
|
|
588
|
+
// Annotate before publishing: Help and `/` completion both read
|
|
589
|
+
// `commandList`, so a command whose capability is missing says so
|
|
590
|
+
// instead of looking usable and failing on use.
|
|
591
|
+
state.commandList = annotateCommandCapabilities(commands, capabilitiesOf());
|
|
592
|
+
state.emit();
|
|
593
|
+
},
|
|
532
594
|
commandDescriptions: name => commandTrees?.descriptions(name),
|
|
533
595
|
// Attached-context pass-through (T03 consumes the third parameter in the
|
|
534
596
|
// fallback branch): the skill catalog never loses the FIFO/decision fence.
|
|
@@ -705,6 +767,7 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
705
767
|
binding,
|
|
706
768
|
state,
|
|
707
769
|
seedActivity: options.seedActivity,
|
|
770
|
+
seedContextOccupancy: options.seedContextOccupancy,
|
|
708
771
|
inputConvergence,
|
|
709
772
|
selection,
|
|
710
773
|
modelActions,
|
|
@@ -715,7 +778,12 @@ function createChannelWithOwner(ctx, initialAgent, options, owner) {
|
|
|
715
778
|
messageObserver,
|
|
716
779
|
retireAttachment,
|
|
717
780
|
});
|
|
718
|
-
const
|
|
781
|
+
const rawBindAgent = bindingEvents.bind;
|
|
782
|
+
/** Bind the new agent, then re-anchor the job projection: its event
|
|
783
|
+
* subscription is deliberately owner-agnostic, so this is what makes the
|
|
784
|
+
* /jobs roster follow a session switch immediately instead of waiting for
|
|
785
|
+
* the new session's first job event. */
|
|
786
|
+
const bindAgent = () => { rawBindAgent(); reanchorJobProjection(); };
|
|
719
787
|
const sessionAdoption = createSessionAdoption(state, {
|
|
720
788
|
binding,
|
|
721
789
|
rowIds,
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Official context occupancy for the footer, the status commands and the
|
|
3
|
+
* context-low warning.
|
|
4
|
+
*
|
|
5
|
+
* Occupancy answers "how full is the window", which is NOT the question the
|
|
6
|
+
* provider usage of the last settled `assistant/message` answers. That sample
|
|
7
|
+
* has two blind spots this module removes:
|
|
8
|
+
*
|
|
9
|
+
* 1. **It is a sample of a *past* request.** A rejected/overflowed request
|
|
10
|
+
* writes no `assistant/message`, so the sample stays small exactly when the
|
|
11
|
+
* provider says the prompt is too big.
|
|
12
|
+
* 2. **It cannot see a compaction.** A checkpoint replaces the surface without
|
|
13
|
+
* reporting usage of its own.
|
|
14
|
+
*
|
|
15
|
+
* DSH's token meter already projects both away: `contextPressure.projectedTokens`
|
|
16
|
+
* is the provider-anchored sample plus the signed surface movement since it was
|
|
17
|
+
* taken, i.e. the occupancy of the NEXT request. The Web UI reads that value
|
|
18
|
+
* through `ui-conversation`'s `contextOccupancy()`; this module reads the same
|
|
19
|
+
* projection through the same legal seam `activity-store.ts` uses
|
|
20
|
+
* (`ctx.inject(['sessionProjections'])` + the structural registry duck type +
|
|
21
|
+
* a cleanup on the injected fiber).
|
|
22
|
+
*
|
|
23
|
+
* Two properties shape the transport here:
|
|
24
|
+
*
|
|
25
|
+
* 1. **The change feed carries the whole value.** `onChanged` hands one unit's
|
|
26
|
+
* schema-validated wire view (`session-projection/index.d.ts`), so this
|
|
27
|
+
* module never folds history to stay current — only the session BIND reads
|
|
28
|
+
* one snapshot, because a value that has not changed since it was published
|
|
29
|
+
* never arrives again and a resumed session would otherwise show nothing.
|
|
30
|
+
* 2. **Absence is normal.** A bare `cordis.yml` composition has no dsh-base
|
|
31
|
+
* bundle and therefore no token meter; the projection key is simply not
|
|
32
|
+
* registered. The store stays empty and the channel falls back to the
|
|
33
|
+
* last-request sample it has always shown (see `resolveContextOccupancy`).
|
|
34
|
+
* @module dsh-tui/dsh-adapter/context-occupancy
|
|
35
|
+
*/
|
|
36
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
37
|
+
import type { ContextOccupancy } from '../adapter/ports/channel-view.js';
|
|
38
|
+
import type { ProjectionRegistryLike } from './activity-store.js';
|
|
39
|
+
/** The projection key the host token meter publishes. */
|
|
40
|
+
export declare const CONTEXT_PRESSURE_PROJECTION_KEY = "contextPressure";
|
|
41
|
+
/**
|
|
42
|
+
* The official `contextPressure` wire value.
|
|
43
|
+
*
|
|
44
|
+
* Structural copy of `@deepseek-ai/dsh-token-meter`'s `ContextPressureProjection`:
|
|
45
|
+
* the value is host data, so this app declares the shape it reads instead of
|
|
46
|
+
* importing the meter (the same discipline `activity-store.ts` applies to
|
|
47
|
+
* `workingActivity`).
|
|
48
|
+
*/
|
|
49
|
+
export interface ContextPressureView {
|
|
50
|
+
/** Provider-reported prompt size (uncached input + cache reads/writes) of the newest request. */
|
|
51
|
+
readonly pressureTokens?: number;
|
|
52
|
+
/** What the NEXT request's prompt would cost: {@link pressureTokens} plus the surface's movement since. */
|
|
53
|
+
readonly projectedTokens?: number;
|
|
54
|
+
/** Newest recorded route capacity, when an adapter advertised one. */
|
|
55
|
+
readonly contextWindow?: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The reader the channel gets: a cached lookup plus a change feed.
|
|
59
|
+
*
|
|
60
|
+
* Reading is a map hit (never a fold), so a render may call it freely; the
|
|
61
|
+
* subscription is what lets the channel republish when the projection moves
|
|
62
|
+
* between session events (compaction, surface growth).
|
|
63
|
+
*/
|
|
64
|
+
export interface ContextPressureSource {
|
|
65
|
+
read(sessionId: string): ContextPressureView | undefined;
|
|
66
|
+
subscribe(listener: () => void): () => void;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Narrow one projection value: anything that is not a context-pressure view is
|
|
70
|
+
* dropped rather than rendered half-formed.
|
|
71
|
+
*
|
|
72
|
+
* A well-formed value is passed THROUGH (not copied), the same discipline
|
|
73
|
+
* `activity-store.ts` applies: the host reuses the wire object while its state
|
|
74
|
+
* is unchanged, so identity is the store's change test, and a copy would make
|
|
75
|
+
* every read look like a change.
|
|
76
|
+
* @param value - Raw projection value.
|
|
77
|
+
* @returns the value as a context-pressure view, or `undefined`.
|
|
78
|
+
*/
|
|
79
|
+
export declare function asContextPressureView(value: unknown): ContextPressureView | undefined;
|
|
80
|
+
/**
|
|
81
|
+
* The official numerator: `projectedTokens ?? pressureTokens`.
|
|
82
|
+
*
|
|
83
|
+
* This is the precedence `ui-conversation/src/client/context-occupancy.ts`
|
|
84
|
+
* uses. `projectedTokens` is preferred because it is the only field that
|
|
85
|
+
* answers for the next request; `pressureTokens` is the bare sample and is all
|
|
86
|
+
* a session whose surface total is unknown can offer.
|
|
87
|
+
* @param view - The projection value.
|
|
88
|
+
* @returns the occupancy numerator, or `undefined` before any provider sample.
|
|
89
|
+
*/
|
|
90
|
+
export declare function contextPressureUsedTokens(view: ContextPressureView): number | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Resolve the ONE occupancy reading the footer, the segmented bar, the working
|
|
93
|
+
* line's pressure prefix, the status commands and the context-low warning share.
|
|
94
|
+
*
|
|
95
|
+
* DIVERGENCE FROM THE OFFICIAL RENDERER (deliberate, see the PR body): the Web
|
|
96
|
+
* UI renders nothing when the projection carries neither pressure nor a window.
|
|
97
|
+
* The TUI keeps its pre-projection sample readout instead, so a bare
|
|
98
|
+
* `cordis.yml` composition (no dsh-base bundle ⇒ no token meter) does not
|
|
99
|
+
* silently lose a number it has always shown; {@link ContextOccupancy.source}
|
|
100
|
+
* names which path answered. A composition WITH a meter — every normal
|
|
101
|
+
* deployment, where the base bundle mounts token-meter on the host plane —
|
|
102
|
+
* takes the projection branch as soon as a request reports usage, and the
|
|
103
|
+
* fallback becomes unreachable.
|
|
104
|
+
* @param projected - Cached `contextPressure` value, `undefined` without a meter.
|
|
105
|
+
* @param sample - Last settled request's billed usage (the fallback numerator).
|
|
106
|
+
* @param requestWindow - `request/context` capacity (the fallback denominator).
|
|
107
|
+
* @returns the reading, or `undefined` when neither path knows anything.
|
|
108
|
+
*/
|
|
109
|
+
export declare function resolveContextOccupancy(projected: ContextPressureView | undefined, sample: {
|
|
110
|
+
input: number;
|
|
111
|
+
cacheRead: number;
|
|
112
|
+
cacheWrite: number;
|
|
113
|
+
} | undefined, requestWindow: number | undefined): ContextOccupancy | undefined;
|
|
114
|
+
/**
|
|
115
|
+
* The latest `contextPressure` value for the session on screen.
|
|
116
|
+
*
|
|
117
|
+
* Effectively single-current, mirroring {@link ActivityStore}: binding a
|
|
118
|
+
* session names the one the UI shows, and every other id is dropped — the
|
|
119
|
+
* projection feed is host-wide, and a background session must not overwrite the
|
|
120
|
+
* footer of the session on screen.
|
|
121
|
+
*
|
|
122
|
+
* The store holds VALUES, never sessions to re-read: the feed delivers the
|
|
123
|
+
* whole value, so there is nothing to poll. Only {@link seed} reads a snapshot,
|
|
124
|
+
* and only because a resumed session's value may not have changed (and
|
|
125
|
+
* therefore never been published) since it was last folded.
|
|
126
|
+
*/
|
|
127
|
+
export declare class ContextOccupancyStore implements ContextPressureSource {
|
|
128
|
+
private readonly values;
|
|
129
|
+
private readonly listeners;
|
|
130
|
+
/** The session the UI is showing (the last {@link seed}); the only id kept. */
|
|
131
|
+
private currentId;
|
|
132
|
+
/** Session object behind {@link currentId}, so a late registry can still seed. */
|
|
133
|
+
private currentSession;
|
|
134
|
+
/** Host registry, remembered so a bind can read a baseline on demand. */
|
|
135
|
+
private registry;
|
|
136
|
+
/** Read failures are reported once: a broken registry must not spam the log. */
|
|
137
|
+
private warned;
|
|
138
|
+
private readonly warn;
|
|
139
|
+
constructor(warn?: (message: string) => void);
|
|
140
|
+
/**
|
|
141
|
+
* Remember the host registry. A registry that arrives after the session bound
|
|
142
|
+
* is immediately used to read the baseline {@link seed} could not: the unit
|
|
143
|
+
* and its registry are mounted by other plugins, so the order is not ours.
|
|
144
|
+
* @param registry - The host projection registry.
|
|
145
|
+
*/
|
|
146
|
+
attachRegistry(registry: ProjectionRegistryLike): void;
|
|
147
|
+
/**
|
|
148
|
+
* Bind one session and read its current projection value once.
|
|
149
|
+
*
|
|
150
|
+
* The bind also defines the session on screen: every other id is pruned, so a
|
|
151
|
+
* later background event can no longer fill this store.
|
|
152
|
+
* @param session - Session being bound.
|
|
153
|
+
*/
|
|
154
|
+
seed(session: unknown): void;
|
|
155
|
+
/**
|
|
156
|
+
* Record one value from the projection change feed.
|
|
157
|
+
* @param sessionId - Session the value belongs to.
|
|
158
|
+
* @param value - The published wire value.
|
|
159
|
+
*/
|
|
160
|
+
update(sessionId: string, value: unknown): void;
|
|
161
|
+
/** The current value for one session, stable between updates. */
|
|
162
|
+
read(sessionId: string): ContextPressureView | undefined;
|
|
163
|
+
/** Subscribe to value changes; returns the unsubscribe function. */
|
|
164
|
+
subscribe(listener: () => void): () => void;
|
|
165
|
+
/**
|
|
166
|
+
* Report a failed registry read once. The sink is the composition root's
|
|
167
|
+
* logger — this module stays free of cordis types.
|
|
168
|
+
* @param error - What the failed read threw.
|
|
169
|
+
*/
|
|
170
|
+
noteReadFailure(error: unknown): void;
|
|
171
|
+
/** Store one already-narrowed value for the current session and emit on change. */
|
|
172
|
+
private remember;
|
|
173
|
+
/** Drop every id that is not the current one; emit when a value went. */
|
|
174
|
+
private pruneToCurrent;
|
|
175
|
+
private emit;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Wire one store to the host's projection registry.
|
|
179
|
+
*
|
|
180
|
+
* Registration is deferred through `inject` because the plugin that *publishes*
|
|
181
|
+
* the unit is mounted alongside this one: the registry may not exist yet, and
|
|
182
|
+
* the unit may not be registered until later still. Both absences are normal —
|
|
183
|
+
* a composition without the token meter simply never fills the store, and the
|
|
184
|
+
* channel falls back to its own sample.
|
|
185
|
+
*
|
|
186
|
+
* The feed is event-driven and carries the whole value, so a change costs one
|
|
187
|
+
* narrow + one map write. A long resumed session (thousands of replayed events)
|
|
188
|
+
* therefore pays O(changes of this unit) and never a per-event fold; rendering
|
|
189
|
+
* pays a map lookup, never a `snapshot()`.
|
|
190
|
+
* @param ctx - Host context of the composition root.
|
|
191
|
+
* @param store - Store to fill.
|
|
192
|
+
*/
|
|
193
|
+
export declare function attachContextPressureProjection(ctx: Context, store: ContextOccupancyStore): void;
|
|
194
|
+
/**
|
|
195
|
+
* Create the composition root's occupancy store and wire it to the host.
|
|
196
|
+
*
|
|
197
|
+
* Unlike the activity store there is no config gate: occupancy feeds the
|
|
198
|
+
* footer's ctx field, the segmented bar and the context-low warning, so hiding
|
|
199
|
+
* one surface must not stop the others from being correct.
|
|
200
|
+
* @param ctx - Host context of the composition root.
|
|
201
|
+
* @returns the store the channel reads from.
|
|
202
|
+
*/
|
|
203
|
+
export declare function createContextOccupancyStore(ctx: Context): ContextOccupancyStore;
|
|
204
|
+
//# sourceMappingURL=context-occupancy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context-occupancy.d.ts","sourceRoot":"","sources":["../../../src/dsh-adapter/context-occupancy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAGxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAEjE,yDAAyD;AACzD,eAAO,MAAM,+BAA+B,oBAAoB,CAAA;AAEhE;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,iGAAiG;IACjG,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;IAChC,2GAA2G;IAC3G,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAA;IACjC,sEAAsE;IACtE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAChC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAAA;IACxD,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAA;CAC5C;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,mBAAmB,GAAG,SAAS,CAYrF;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,GAAG,SAAS,CAEvF;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,mBAAmB,GAAG,SAAS,EAC1C,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,EAC5E,aAAa,EAAE,MAAM,GAAG,SAAS,GAChC,gBAAgB,GAAG,SAAS,CAY9B;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,qBAAsB,YAAW,qBAAqB;IACjE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyC;IAChE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAwB;IAClD,+EAA+E;IAC/E,OAAO,CAAC,SAAS,CAAoB;IACrC,kFAAkF;IAClF,OAAO,CAAC,cAAc,CAAS;IAC/B,yEAAyE;IACzE,OAAO,CAAC,QAAQ,CAAoC;IACpD,gFAAgF;IAChF,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAyC;gBAElD,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI;IAI5C;;;;;OAKG;IACH,cAAc,CAAC,QAAQ,EAAE,sBAAsB,GAAG,IAAI;IAKtD;;;;;;OAMG;IACH,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAe5B;;;;OAIG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAI/C,iEAAiE;IACjE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS;IAIxD,oEAAoE;IACpE,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAK3C;;;;OAIG;IACH,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAOrC,mFAAmF;IACnF,OAAO,CAAC,QAAQ;IAiBhB,yEAAyE;IACzE,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,IAAI;CAGb;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,+BAA+B,CAAC,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,qBAAqB,GAAG,IAAI,CAwBhG;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,OAAO,GAAG,qBAAqB,CAI/E"}
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Official context occupancy for the footer, the status commands and the
|
|
3
|
+
* context-low warning.
|
|
4
|
+
*
|
|
5
|
+
* Occupancy answers "how full is the window", which is NOT the question the
|
|
6
|
+
* provider usage of the last settled `assistant/message` answers. That sample
|
|
7
|
+
* has two blind spots this module removes:
|
|
8
|
+
*
|
|
9
|
+
* 1. **It is a sample of a *past* request.** A rejected/overflowed request
|
|
10
|
+
* writes no `assistant/message`, so the sample stays small exactly when the
|
|
11
|
+
* provider says the prompt is too big.
|
|
12
|
+
* 2. **It cannot see a compaction.** A checkpoint replaces the surface without
|
|
13
|
+
* reporting usage of its own.
|
|
14
|
+
*
|
|
15
|
+
* DSH's token meter already projects both away: `contextPressure.projectedTokens`
|
|
16
|
+
* is the provider-anchored sample plus the signed surface movement since it was
|
|
17
|
+
* taken, i.e. the occupancy of the NEXT request. The Web UI reads that value
|
|
18
|
+
* through `ui-conversation`'s `contextOccupancy()`; this module reads the same
|
|
19
|
+
* projection through the same legal seam `activity-store.ts` uses
|
|
20
|
+
* (`ctx.inject(['sessionProjections'])` + the structural registry duck type +
|
|
21
|
+
* a cleanup on the injected fiber).
|
|
22
|
+
*
|
|
23
|
+
* Two properties shape the transport here:
|
|
24
|
+
*
|
|
25
|
+
* 1. **The change feed carries the whole value.** `onChanged` hands one unit's
|
|
26
|
+
* schema-validated wire view (`session-projection/index.d.ts`), so this
|
|
27
|
+
* module never folds history to stay current — only the session BIND reads
|
|
28
|
+
* one snapshot, because a value that has not changed since it was published
|
|
29
|
+
* never arrives again and a resumed session would otherwise show nothing.
|
|
30
|
+
* 2. **Absence is normal.** A bare `cordis.yml` composition has no dsh-base
|
|
31
|
+
* bundle and therefore no token meter; the projection key is simply not
|
|
32
|
+
* registered. The store stays empty and the channel falls back to the
|
|
33
|
+
* last-request sample it has always shown (see `resolveContextOccupancy`).
|
|
34
|
+
* @module dsh-tui/dsh-adapter/context-occupancy
|
|
35
|
+
*/
|
|
36
|
+
/** The projection key the host token meter publishes. */
|
|
37
|
+
export const CONTEXT_PRESSURE_PROJECTION_KEY = 'contextPressure';
|
|
38
|
+
function finiteNumber(value) {
|
|
39
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : undefined;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Narrow one projection value: anything that is not a context-pressure view is
|
|
43
|
+
* dropped rather than rendered half-formed.
|
|
44
|
+
*
|
|
45
|
+
* A well-formed value is passed THROUGH (not copied), the same discipline
|
|
46
|
+
* `activity-store.ts` applies: the host reuses the wire object while its state
|
|
47
|
+
* is unchanged, so identity is the store's change test, and a copy would make
|
|
48
|
+
* every read look like a change.
|
|
49
|
+
* @param value - Raw projection value.
|
|
50
|
+
* @returns the value as a context-pressure view, or `undefined`.
|
|
51
|
+
*/
|
|
52
|
+
export function asContextPressureView(value) {
|
|
53
|
+
if (value === null || typeof value !== 'object' || Array.isArray(value))
|
|
54
|
+
return undefined;
|
|
55
|
+
const record = value;
|
|
56
|
+
const fields = ['pressureTokens', 'projectedTokens', 'contextWindow'];
|
|
57
|
+
let known = false;
|
|
58
|
+
for (const field of fields) {
|
|
59
|
+
const raw = record[field];
|
|
60
|
+
if (raw === undefined)
|
|
61
|
+
continue;
|
|
62
|
+
if (finiteNumber(raw) === undefined)
|
|
63
|
+
return undefined;
|
|
64
|
+
known = true;
|
|
65
|
+
}
|
|
66
|
+
return known ? value : undefined;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The official numerator: `projectedTokens ?? pressureTokens`.
|
|
70
|
+
*
|
|
71
|
+
* This is the precedence `ui-conversation/src/client/context-occupancy.ts`
|
|
72
|
+
* uses. `projectedTokens` is preferred because it is the only field that
|
|
73
|
+
* answers for the next request; `pressureTokens` is the bare sample and is all
|
|
74
|
+
* a session whose surface total is unknown can offer.
|
|
75
|
+
* @param view - The projection value.
|
|
76
|
+
* @returns the occupancy numerator, or `undefined` before any provider sample.
|
|
77
|
+
*/
|
|
78
|
+
export function contextPressureUsedTokens(view) {
|
|
79
|
+
return view.projectedTokens ?? view.pressureTokens;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Resolve the ONE occupancy reading the footer, the segmented bar, the working
|
|
83
|
+
* line's pressure prefix, the status commands and the context-low warning share.
|
|
84
|
+
*
|
|
85
|
+
* DIVERGENCE FROM THE OFFICIAL RENDERER (deliberate, see the PR body): the Web
|
|
86
|
+
* UI renders nothing when the projection carries neither pressure nor a window.
|
|
87
|
+
* The TUI keeps its pre-projection sample readout instead, so a bare
|
|
88
|
+
* `cordis.yml` composition (no dsh-base bundle ⇒ no token meter) does not
|
|
89
|
+
* silently lose a number it has always shown; {@link ContextOccupancy.source}
|
|
90
|
+
* names which path answered. A composition WITH a meter — every normal
|
|
91
|
+
* deployment, where the base bundle mounts token-meter on the host plane —
|
|
92
|
+
* takes the projection branch as soon as a request reports usage, and the
|
|
93
|
+
* fallback becomes unreachable.
|
|
94
|
+
* @param projected - Cached `contextPressure` value, `undefined` without a meter.
|
|
95
|
+
* @param sample - Last settled request's billed usage (the fallback numerator).
|
|
96
|
+
* @param requestWindow - `request/context` capacity (the fallback denominator).
|
|
97
|
+
* @returns the reading, or `undefined` when neither path knows anything.
|
|
98
|
+
*/
|
|
99
|
+
export function resolveContextOccupancy(projected, sample, requestWindow) {
|
|
100
|
+
const contextWindow = projected?.contextWindow ?? requestWindow;
|
|
101
|
+
const projectedUsed = projected === undefined ? undefined : contextPressureUsedTokens(projected);
|
|
102
|
+
if (projectedUsed !== undefined) {
|
|
103
|
+
return { usedTokens: projectedUsed, contextWindow, source: 'projection' };
|
|
104
|
+
}
|
|
105
|
+
if (sample === undefined)
|
|
106
|
+
return undefined;
|
|
107
|
+
return {
|
|
108
|
+
usedTokens: sample.input + sample.cacheRead + sample.cacheWrite,
|
|
109
|
+
contextWindow,
|
|
110
|
+
source: 'sample',
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The latest `contextPressure` value for the session on screen.
|
|
115
|
+
*
|
|
116
|
+
* Effectively single-current, mirroring {@link ActivityStore}: binding a
|
|
117
|
+
* session names the one the UI shows, and every other id is dropped — the
|
|
118
|
+
* projection feed is host-wide, and a background session must not overwrite the
|
|
119
|
+
* footer of the session on screen.
|
|
120
|
+
*
|
|
121
|
+
* The store holds VALUES, never sessions to re-read: the feed delivers the
|
|
122
|
+
* whole value, so there is nothing to poll. Only {@link seed} reads a snapshot,
|
|
123
|
+
* and only because a resumed session's value may not have changed (and
|
|
124
|
+
* therefore never been published) since it was last folded.
|
|
125
|
+
*/
|
|
126
|
+
export class ContextOccupancyStore {
|
|
127
|
+
values = new Map();
|
|
128
|
+
listeners = new Set();
|
|
129
|
+
/** The session the UI is showing (the last {@link seed}); the only id kept. */
|
|
130
|
+
currentId;
|
|
131
|
+
/** Session object behind {@link currentId}, so a late registry can still seed. */
|
|
132
|
+
currentSession;
|
|
133
|
+
/** Host registry, remembered so a bind can read a baseline on demand. */
|
|
134
|
+
registry;
|
|
135
|
+
/** Read failures are reported once: a broken registry must not spam the log. */
|
|
136
|
+
warned = false;
|
|
137
|
+
warn;
|
|
138
|
+
constructor(warn) {
|
|
139
|
+
this.warn = warn;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Remember the host registry. A registry that arrives after the session bound
|
|
143
|
+
* is immediately used to read the baseline {@link seed} could not: the unit
|
|
144
|
+
* and its registry are mounted by other plugins, so the order is not ours.
|
|
145
|
+
* @param registry - The host projection registry.
|
|
146
|
+
*/
|
|
147
|
+
attachRegistry(registry) {
|
|
148
|
+
this.registry = registry;
|
|
149
|
+
if (this.currentSession !== undefined)
|
|
150
|
+
this.seed(this.currentSession);
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Bind one session and read its current projection value once.
|
|
154
|
+
*
|
|
155
|
+
* The bind also defines the session on screen: every other id is pruned, so a
|
|
156
|
+
* later background event can no longer fill this store.
|
|
157
|
+
* @param session - Session being bound.
|
|
158
|
+
*/
|
|
159
|
+
seed(session) {
|
|
160
|
+
if (session === null || session === undefined)
|
|
161
|
+
return;
|
|
162
|
+
this.currentId = String(session.id);
|
|
163
|
+
this.currentSession = session;
|
|
164
|
+
this.pruneToCurrent();
|
|
165
|
+
const registry = this.registry;
|
|
166
|
+
if (registry === undefined)
|
|
167
|
+
return;
|
|
168
|
+
try {
|
|
169
|
+
const values = registry.snapshot(session, [CONTEXT_PRESSURE_PROJECTION_KEY]).values;
|
|
170
|
+
this.remember(this.currentId, asContextPressureView(values[CONTEXT_PRESSURE_PROJECTION_KEY]));
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
this.noteReadFailure(error);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Record one value from the projection change feed.
|
|
178
|
+
* @param sessionId - Session the value belongs to.
|
|
179
|
+
* @param value - The published wire value.
|
|
180
|
+
*/
|
|
181
|
+
update(sessionId, value) {
|
|
182
|
+
this.remember(sessionId, asContextPressureView(value));
|
|
183
|
+
}
|
|
184
|
+
/** The current value for one session, stable between updates. */
|
|
185
|
+
read(sessionId) {
|
|
186
|
+
return this.values.get(sessionId);
|
|
187
|
+
}
|
|
188
|
+
/** Subscribe to value changes; returns the unsubscribe function. */
|
|
189
|
+
subscribe(listener) {
|
|
190
|
+
this.listeners.add(listener);
|
|
191
|
+
return () => { this.listeners.delete(listener); };
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Report a failed registry read once. The sink is the composition root's
|
|
195
|
+
* logger — this module stays free of cordis types.
|
|
196
|
+
* @param error - What the failed read threw.
|
|
197
|
+
*/
|
|
198
|
+
noteReadFailure(error) {
|
|
199
|
+
if (this.warned)
|
|
200
|
+
return;
|
|
201
|
+
this.warned = true;
|
|
202
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
203
|
+
this.warn?.(`dsh-tui: context-pressure projection read failed: ${detail}`);
|
|
204
|
+
}
|
|
205
|
+
/** Store one already-narrowed value for the current session and emit on change. */
|
|
206
|
+
remember(sessionId, view) {
|
|
207
|
+
if (this.currentId !== undefined && sessionId !== this.currentId)
|
|
208
|
+
return;
|
|
209
|
+
const previous = this.values.get(sessionId);
|
|
210
|
+
if (view === undefined) {
|
|
211
|
+
if (previous === undefined)
|
|
212
|
+
return;
|
|
213
|
+
this.values.delete(sessionId);
|
|
214
|
+
this.emit();
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
// The host reuses the view reference while its state is unchanged
|
|
218
|
+
// (`Object.is` suppression in the registry), so an identity check is the
|
|
219
|
+
// whole change test.
|
|
220
|
+
if (previous === view)
|
|
221
|
+
return;
|
|
222
|
+
this.values.set(sessionId, view);
|
|
223
|
+
this.emit();
|
|
224
|
+
}
|
|
225
|
+
/** Drop every id that is not the current one; emit when a value went. */
|
|
226
|
+
pruneToCurrent() {
|
|
227
|
+
if (this.currentId === undefined)
|
|
228
|
+
return;
|
|
229
|
+
let removed = false;
|
|
230
|
+
for (const id of [...this.values.keys()]) {
|
|
231
|
+
if (id === this.currentId)
|
|
232
|
+
continue;
|
|
233
|
+
this.values.delete(id);
|
|
234
|
+
removed = true;
|
|
235
|
+
}
|
|
236
|
+
if (removed)
|
|
237
|
+
this.emit();
|
|
238
|
+
}
|
|
239
|
+
emit() {
|
|
240
|
+
for (const listener of [...this.listeners])
|
|
241
|
+
listener();
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Wire one store to the host's projection registry.
|
|
246
|
+
*
|
|
247
|
+
* Registration is deferred through `inject` because the plugin that *publishes*
|
|
248
|
+
* the unit is mounted alongside this one: the registry may not exist yet, and
|
|
249
|
+
* the unit may not be registered until later still. Both absences are normal —
|
|
250
|
+
* a composition without the token meter simply never fills the store, and the
|
|
251
|
+
* channel falls back to its own sample.
|
|
252
|
+
*
|
|
253
|
+
* The feed is event-driven and carries the whole value, so a change costs one
|
|
254
|
+
* narrow + one map write. A long resumed session (thousands of replayed events)
|
|
255
|
+
* therefore pays O(changes of this unit) and never a per-event fold; rendering
|
|
256
|
+
* pays a map lookup, never a `snapshot()`.
|
|
257
|
+
* @param ctx - Host context of the composition root.
|
|
258
|
+
* @param store - Store to fill.
|
|
259
|
+
*/
|
|
260
|
+
export function attachContextPressureProjection(ctx, store) {
|
|
261
|
+
ctx.inject(['sessionProjections'], ((projectionCtx) => {
|
|
262
|
+
const registry = projectionCtx.sessionProjections;
|
|
263
|
+
if (registry === undefined)
|
|
264
|
+
return;
|
|
265
|
+
store.attachRegistry(registry);
|
|
266
|
+
let offFeed;
|
|
267
|
+
try {
|
|
268
|
+
offFeed = registry.onChanged((session, key, value) => {
|
|
269
|
+
if (key !== CONTEXT_PRESSURE_PROJECTION_KEY)
|
|
270
|
+
return;
|
|
271
|
+
store.update(String(session.id), value);
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
catch (error) {
|
|
275
|
+
store.noteReadFailure(error);
|
|
276
|
+
}
|
|
277
|
+
// The cleanup belongs to the injected fiber, not the outer ctx: a service
|
|
278
|
+
// re-provide re-runs the callback above, and registering on the outer ctx
|
|
279
|
+
// would stack feed listeners (the old listener's disposer would only run
|
|
280
|
+
// when the whole composition root goes down).
|
|
281
|
+
projectionCtx.effect(() => () => {
|
|
282
|
+
offFeed?.();
|
|
283
|
+
}, 'dsh-tui context-pressure projection feed');
|
|
284
|
+
}));
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Create the composition root's occupancy store and wire it to the host.
|
|
288
|
+
*
|
|
289
|
+
* Unlike the activity store there is no config gate: occupancy feeds the
|
|
290
|
+
* footer's ctx field, the segmented bar and the context-low warning, so hiding
|
|
291
|
+
* one surface must not stop the others from being correct.
|
|
292
|
+
* @param ctx - Host context of the composition root.
|
|
293
|
+
* @returns the store the channel reads from.
|
|
294
|
+
*/
|
|
295
|
+
export function createContextOccupancyStore(ctx) {
|
|
296
|
+
const store = new ContextOccupancyStore(message => { ctx.logger.warn(message); });
|
|
297
|
+
attachContextPressureProjection(ctx, store);
|
|
298
|
+
return store;
|
|
299
|
+
}
|