@deepseek-harness-tui/dsh-tui 0.12.0 → 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 +41 -5
- 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 +8 -3
- package/cordis.patch.yml +7 -1
- package/guide/dsh-tui-guide/configuration.en.md +6 -1
- package/guide/dsh-tui-guide/configuration.md +6 -1
- package/guide/dsh-tui-guide/getting-started.en.md +6 -3
- package/guide/dsh-tui-guide/getting-started.md +4 -2
- package/guide/dsh-tui-guide/interaction.en.md +68 -4
- package/guide/dsh-tui-guide/interaction.md +49 -3
- package/guide/dsh-tui-guide/plugins.en.md +16 -6
- package/guide/dsh-tui-guide/plugins.md +14 -6
- package/guide/dsh-tui-guide/themes.en.md +7 -2
- package/guide/dsh-tui-guide/themes.md +5 -2
- package/guide/dsh-tui-guide/user-guide.en.md +124 -21
- package/guide/dsh-tui-guide/user-guide.md +96 -16
- package/lib/settings.json +215 -1
- package/lib/types/adapter/channel/ui-policy.d.ts +6 -2
- package/lib/types/adapter/channel/ui-policy.d.ts.map +1 -1
- package/lib/types/adapter/channel/ui-policy.js +14 -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-ui.d.ts +62 -2
- package/lib/types/adapter/ports/channel-ui.d.ts.map +1 -1
- package/lib/types/adapter/ports/channel-view.d.ts +94 -0
- 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 +18 -1
- package/lib/types/components/Chat/JobCard.d.ts.map +1 -1
- package/lib/types/components/Chat/JobCard.js +90 -22
- 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/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 +147 -14
- 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 +212 -18
- 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/PromptInput.d.ts +20 -22
- package/lib/types/components/PromptInput.d.ts.map +1 -1
- package/lib/types/components/PromptInput.js +413 -156
- 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/SubagentCard.d.ts.map +1 -1
- package/lib/types/components/SubagentCard.js +17 -2
- 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 +54 -5
- 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/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/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/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/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/mode-actions.d.ts +0 -3
- package/lib/types/dsh-adapter/channel/mode-actions.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/mode-actions.js +7 -2
- 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 +0 -1
- 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 +9 -1
- 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 +18 -2
- package/lib/types/dsh-adapter/channel/state.d.ts.map +1 -1
- package/lib/types/dsh-adapter/channel/state.js +2 -1
- 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 +56 -3
- 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 +14 -0
- package/lib/types/dsh-adapter/contract.d.ts.map +1 -1
- package/lib/types/dsh-adapter/contract.js +24 -0
- 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/migrate/sessionize.d.ts.map +1 -1
- package/lib/types/dsh-adapter/migrate/sessionize.js +11 -12
- 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 +17 -1
- package/lib/types/dsh-adapter/plugin.d.ts.map +1 -1
- package/lib/types/dsh-adapter/plugin.js +169 -32
- package/lib/types/dsh-adapter/presets.d.ts +26 -6
- package/lib/types/dsh-adapter/presets.d.ts.map +1 -1
- package/lib/types/dsh-adapter/presets.js +29 -7
- 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/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 +734 -15
- package/lib/types/i18n.d.ts.map +1 -1
- package/lib/types/i18n.js +302 -6
- 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 +62 -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 +36 -3
- package/lib/types/ink/parse-keypress.d.ts.map +1 -1
- package/lib/types/ink/parse-keypress.js +262 -108
- 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/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/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 +22 -1
- package/lib/types/screens/Chat.d.ts.map +1 -1
- package/lib/types/screens/Chat.js +1126 -299
- 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.map +1 -1
- package/lib/types/screens/StatusLine.js +32 -14
- 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 +83 -0
- package/lib/types/tips.js +5 -5
- 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 +101 -44
- 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/package.json +19 -8
- 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/{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
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* PanelHost(设计文档 §6.3 + v2.1 修订):
|
|
4
|
+
* - 计算 bounds 并以 PanelProps 传入;为 Panel 子树再嵌套一层
|
|
5
|
+
* TerminalSizeContext(columns = panel width),现有组件直接放进来
|
|
6
|
+
* 就能拿到正确宽度。
|
|
7
|
+
* - 每个 Panel 独立 PanelErrorBoundary(registrationId 重挂)。
|
|
8
|
+
* - mountPolicy(v2.1):active=只挂 active(插件默认);enabled=启用
|
|
9
|
+
* 即挂载,非 active 时 display:none + focused/visible=false——状态
|
|
10
|
+
* 保留但不动画、不收键(内置 todo/jobs/agents/companion)。
|
|
11
|
+
* - 不自动包 ScrollBox(v2.1):滚动由 Panel 自己决定(右栏内的
|
|
12
|
+
* ScrollBox 按命中节点接收滚轮)。
|
|
13
|
+
* - 打开某 Panel 时清它的 badge(soft follow:后台更新只亮点不切换)。
|
|
14
|
+
* - 键盘:焦点在右栏时,useSidePanel 先经 SidePanelRuntime.dispatchKey
|
|
15
|
+
* 问活动 Panel(usePanelInput 注册),Panel 没吃才轮到宿主回退键。
|
|
16
|
+
* - 不知道 Chat 消息、输入、Thinking、工具。
|
|
17
|
+
*/
|
|
18
|
+
import React from 'react';
|
|
19
|
+
import { Box, Text } from '../../ui.js';
|
|
20
|
+
import { t } from '../../i18n.js';
|
|
21
|
+
import { TerminalSizeContext } from '../../ink/components/TerminalSizeContext.js';
|
|
22
|
+
import { useTerminalSize } from '../../ink/hooks/use-terminal-size.js';
|
|
23
|
+
import { panelStore } from './PanelStore.js';
|
|
24
|
+
import { PanelContext, SidePanelRuntimeContext } from './SidePanelRuntimeContext.js';
|
|
25
|
+
import { PanelErrorBoundary } from './PanelErrorBoundary.js';
|
|
26
|
+
function TooNarrow({ minColumns }) {
|
|
27
|
+
return (_jsx(Box, { flexDirection: "column", flexGrow: 1, alignItems: "center", justifyContent: "center", paddingX: 1, children: _jsx(Text, { dimColor: true, wrap: "truncate-end", children: t('panel-too-narrow', { min: minColumns }) }) }));
|
|
28
|
+
}
|
|
29
|
+
/** 插件 Panel 连续崩溃后的会话内禁用卡(§18.4):不再挂载插件组件,只
|
|
30
|
+
* 提示原因;toast 一次(每 Panel 每会话)。 */
|
|
31
|
+
const disabledToasted = new Set();
|
|
32
|
+
function PluginDisabled({ panelId, channel }) {
|
|
33
|
+
React.useEffect(() => {
|
|
34
|
+
if (disabledToasted.has(panelId))
|
|
35
|
+
return;
|
|
36
|
+
disabledToasted.add(panelId);
|
|
37
|
+
channel.notify(t('panel-plugin-disabled-toast'));
|
|
38
|
+
}, [panelId, channel]);
|
|
39
|
+
return (_jsxs(Box, { flexDirection: "column", flexGrow: 1, alignItems: "center", justifyContent: "center", paddingX: 1, children: [_jsx(Text, { color: "warning", children: t('panel-plugin-disabled') }), _jsx(Box, { height: 1 }), _jsx(Text, { dimColor: true, wrap: "truncate-end", children: t('panel-plugin-disabled-hint') })] }));
|
|
40
|
+
}
|
|
41
|
+
export function PanelHost({ controller, channel, width, height, activity, attention, trajectory, openFullscreen }) {
|
|
42
|
+
const entries = React.useSyncExternalStore(panelStore.subscribe, () => panelStore.list());
|
|
43
|
+
// Forward the real screen rows so panel animations (useAnimationFrame →
|
|
44
|
+
// useTerminalViewport) measure visibility against the screen, not the
|
|
45
|
+
// host's narrowed rows.
|
|
46
|
+
const parentSize = useTerminalSize();
|
|
47
|
+
const screenRows = parentSize.screenRows ?? parentSize.rows;
|
|
48
|
+
const enabledIds = controller.enabledPanelIds;
|
|
49
|
+
// 只画「已启用 ∩ 已注册」的 Panel,顺序 = 设置里的启用顺序。
|
|
50
|
+
const visibleEntries = React.useMemo(() => enabledIds
|
|
51
|
+
.map(id => entries.find(entry => entry.definition.id === id))
|
|
52
|
+
.filter((entry) => entry !== undefined), [enabledIds, entries]);
|
|
53
|
+
const activeEntry = visibleEntries.find(entry => entry.definition.id === controller.activePanelId)
|
|
54
|
+
?? visibleEntries[0];
|
|
55
|
+
// Soft follow:后台更新只亮 PanelBar 状态点;用户打开该 Panel 时清零。
|
|
56
|
+
const activeId = activeEntry?.definition.id;
|
|
57
|
+
React.useEffect(() => {
|
|
58
|
+
if (activeId !== undefined)
|
|
59
|
+
panelStore.clearBadge(activeId);
|
|
60
|
+
}, [activeId]);
|
|
61
|
+
const mode = controller.zoom ? 'zoom' : 'split';
|
|
62
|
+
const runtimeContext = React.useMemo(() => ({ runtime: controller.runtime, channel, activity, attention, trajectory, openFullscreen }), [controller.runtime, channel, activity, attention, trajectory, openFullscreen]);
|
|
63
|
+
return (_jsx(SidePanelRuntimeContext.Provider, { value: runtimeContext, children: visibleEntries.map(entry => {
|
|
64
|
+
const def = entry.definition;
|
|
65
|
+
const isActive = activeEntry !== undefined && def.id === activeEntry.definition.id;
|
|
66
|
+
if (!isActive && def.mountPolicy !== 'enabled')
|
|
67
|
+
return null;
|
|
68
|
+
if (entry.disabled === true) {
|
|
69
|
+
return (_jsx(Box, { flexDirection: "column", flexGrow: 1, overflow: "hidden", display: isActive ? 'flex' : 'none', children: _jsx(PluginDisabled, { panelId: def.id, channel: channel }) }, def.id));
|
|
70
|
+
}
|
|
71
|
+
const tooNarrow = def.minColumns !== undefined && width < def.minColumns;
|
|
72
|
+
const body = tooNarrow ? (_jsx(TooNarrow, { minColumns: def.minColumns })) : (_jsx(PanelErrorBoundary, { panelId: def.id, children: _jsx(PanelContext.Provider, { value: { panelId: def.id }, children: _jsx(TerminalSizeContext.Provider, { value: { columns: width, rows: height, screenRows }, children: React.createElement(def.component, {
|
|
73
|
+
width,
|
|
74
|
+
height,
|
|
75
|
+
focused: controller.focus === 'panel' && isActive,
|
|
76
|
+
visible: isActive,
|
|
77
|
+
mode,
|
|
78
|
+
}) }) }) }, entry.registrationId));
|
|
79
|
+
return (_jsx(Box, { flexDirection: "column", flexGrow: 1, overflow: "hidden", display: isActive ? 'flex' : 'none', children: body }, def.id));
|
|
80
|
+
}) }));
|
|
81
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* /panel 无参的面板选择器:Pane + Select 行列出「已启用 ∩ 已注册」的
|
|
3
|
+
* 面板(内置与插件同席——图标、标题、badge 状态点都来自 PanelStore),
|
|
4
|
+
* 当前活动面板带 current 标记。Enter 打开并聚焦,Esc 取消。
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import type { SidePanelController } from './useSidePanel.js';
|
|
8
|
+
export interface PanelPickerRow {
|
|
9
|
+
readonly id: string;
|
|
10
|
+
readonly title: string;
|
|
11
|
+
readonly icon?: string;
|
|
12
|
+
readonly badge?: {
|
|
13
|
+
readonly level: 'info' | 'warning' | 'error';
|
|
14
|
+
readonly unread: number;
|
|
15
|
+
} | null;
|
|
16
|
+
}
|
|
17
|
+
export declare function usePanelPickerRows(controller: SidePanelController): readonly PanelPickerRow[];
|
|
18
|
+
export declare function PanelPicker({ rows, focusIndex, activeId, onPick, }: {
|
|
19
|
+
readonly rows: readonly PanelPickerRow[];
|
|
20
|
+
readonly focusIndex: number;
|
|
21
|
+
readonly activeId: string | undefined;
|
|
22
|
+
readonly onPick?: (index: number) => void;
|
|
23
|
+
}): React.ReactNode;
|
|
24
|
+
//# sourceMappingURL=PanelPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanelPicker.d.ts","sourceRoot":"","sources":["../../../../src/components/sidePanel/PanelPicker.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AAOzB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAE5D,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,KAAK,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAA;CAClG;AAcD,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,mBAAmB,GAAG,SAAS,cAAc,EAAE,CAW7F;AAED,wBAAgB,WAAW,CAAC,EAC1B,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,MAAM,GACP,EAAE;IACD,QAAQ,CAAC,IAAI,EAAE,SAAS,cAAc,EAAE,CAAA;IACxC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IACrC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CAC1C,GAAG,KAAK,CAAC,SAAS,CAgClB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* /panel 无参的面板选择器:Pane + Select 行列出「已启用 ∩ 已注册」的
|
|
4
|
+
* 面板(内置与插件同席——图标、标题、badge 状态点都来自 PanelStore),
|
|
5
|
+
* 当前活动面板带 current 标记。Enter 打开并聚焦,Esc 取消。
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import { Box, Text } from '../../ui.js';
|
|
9
|
+
import { t } from '../../i18n.js';
|
|
10
|
+
import { Pane } from '../design-system/Pane.js';
|
|
11
|
+
import { Select } from '../Select.js';
|
|
12
|
+
import { HintLine } from '../design-system/HintLine.js';
|
|
13
|
+
import { panelStore } from './PanelStore.js';
|
|
14
|
+
function badgeGlyph(level) {
|
|
15
|
+
if (level === 'warning')
|
|
16
|
+
return '!';
|
|
17
|
+
if (level === 'error')
|
|
18
|
+
return '×';
|
|
19
|
+
return '●';
|
|
20
|
+
}
|
|
21
|
+
function badgeColor(level) {
|
|
22
|
+
if (level === 'warning')
|
|
23
|
+
return 'warning';
|
|
24
|
+
if (level === 'error')
|
|
25
|
+
return 'error';
|
|
26
|
+
return 'accent';
|
|
27
|
+
}
|
|
28
|
+
export function usePanelPickerRows(controller) {
|
|
29
|
+
const entries = React.useSyncExternalStore(panelStore.subscribe, () => panelStore.list());
|
|
30
|
+
return controller.enabledPanelIds
|
|
31
|
+
.map(id => entries.find(entry => entry.definition.id === id))
|
|
32
|
+
.filter((entry) => entry !== undefined)
|
|
33
|
+
.map(entry => ({
|
|
34
|
+
id: entry.definition.id,
|
|
35
|
+
title: entry.definition.titleKey !== undefined ? t(entry.definition.titleKey) : entry.definition.title ?? entry.definition.id,
|
|
36
|
+
icon: entry.definition.icon,
|
|
37
|
+
badge: entry.badge,
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
export function PanelPicker({ rows, focusIndex, activeId, onPick, }) {
|
|
41
|
+
return (_jsx(Pane, { color: "accent", children: _jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: "remember", bold: true, children: t('picker-title-panel') }) }), _jsx(Select, { options: rows.map(row => ({
|
|
42
|
+
value: row.id,
|
|
43
|
+
label: (_jsxs(Text, { children: [_jsx(Text, { dimColor: true, children: (row.icon ?? row.title.slice(0, 1)) + ' ' }), row.title, row.badge != null && (_jsx(Text, { color: badgeColor(row.badge.level), children: ' ' + badgeGlyph(row.badge.level) }))] })),
|
|
44
|
+
})), focusIndex: focusIndex, selectedValue: activeId, onPick: onPick }), _jsx(Text, { dimColor: true, italic: true, children: _jsx(HintLine, { text: t('hint-confirm-exit') }) })] }) }));
|
|
45
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PanelStore:Panel 定义 + 运行时状态(badge / 最近错误)一个 store
|
|
3
|
+
* (设计文档 §6.4 / §16.2——注册即有 badge 槽,释放即清,没有第二条
|
|
4
|
+
* 内置专用路径;插件 API 只是给它加准入外壳)。
|
|
5
|
+
*
|
|
6
|
+
* 通知不轮询:各业务 store(channel / BackgroundJobStore / …)的订阅
|
|
7
|
+
* 回调里由 Adapter 调 setBadge。有界:每 Panel 一条 badge,无历史列表,
|
|
8
|
+
* unread 饱和到 99。
|
|
9
|
+
*/
|
|
10
|
+
import type { PanelBadge, PanelDefinition, PanelEntry, PanelOwner } from './types.js';
|
|
11
|
+
export declare const PANEL_UNREAD_CAP = 99;
|
|
12
|
+
/** 连续崩溃禁用阈值(会话内,时间窗内累计;设计文档 §18.4)。 */
|
|
13
|
+
export declare const PANEL_CRASH_DISABLE_THRESHOLD = 3;
|
|
14
|
+
/** 崩溃计数的滑动时间窗。 */
|
|
15
|
+
export declare const PANEL_CRASH_WINDOW_MS = 60000;
|
|
16
|
+
/** PanelStore 对外事件(subscribe 的 listener 参数;useSyncExternalStore
|
|
17
|
+
* 的 () => void 订阅者可安全忽略)。opened/closed/focused/blurred 等
|
|
18
|
+
* useSidePanel 侧的事件本阶段尚未接入(TODO §18.3)。 */
|
|
19
|
+
export type PanelStoreEvent = {
|
|
20
|
+
readonly type: 'registered';
|
|
21
|
+
readonly id: string;
|
|
22
|
+
} | {
|
|
23
|
+
readonly type: 'unregistered';
|
|
24
|
+
readonly id: string;
|
|
25
|
+
} | {
|
|
26
|
+
readonly type: 'badge';
|
|
27
|
+
readonly id: string;
|
|
28
|
+
} | {
|
|
29
|
+
readonly type: 'error';
|
|
30
|
+
readonly id: string;
|
|
31
|
+
} | {
|
|
32
|
+
readonly type: 'disabled';
|
|
33
|
+
readonly id: string;
|
|
34
|
+
};
|
|
35
|
+
export declare class PanelStore {
|
|
36
|
+
private entries;
|
|
37
|
+
private listeners;
|
|
38
|
+
private snapshot;
|
|
39
|
+
private sequence;
|
|
40
|
+
/** source='plugin' 的连续崩溃时间戳(会话内;注册/重注册即清零)。 */
|
|
41
|
+
private crashTimes;
|
|
42
|
+
/** 重复 id → DUPLICATE_CONTRIBUTION_ID(与 tuiStatus 同一约定)。 */
|
|
43
|
+
register(definition: PanelDefinition, owner: PanelOwner): () => void;
|
|
44
|
+
list(): readonly PanelEntry[];
|
|
45
|
+
get(id: string): PanelEntry | undefined;
|
|
46
|
+
/** 只允许 owner 或宿主调用(调用侧自律,与 tuiStatus 相同)。 */
|
|
47
|
+
setBadge(id: string, badge: Omit<PanelBadge, 'latestAt'> | null): void;
|
|
48
|
+
clearBadge(id: string): void;
|
|
49
|
+
reportError(id: string, error: unknown): void;
|
|
50
|
+
subscribe: (listener: (event: PanelStoreEvent) => void) => (() => void);
|
|
51
|
+
private emit;
|
|
52
|
+
}
|
|
53
|
+
/** 进程级单例(内置经 registerBuiltinPanels,插件经 Phase 6 的准入外壳)。 */
|
|
54
|
+
export declare const panelStore: PanelStore;
|
|
55
|
+
//# sourceMappingURL=PanelStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PanelStore.d.ts","sourceRoot":"","sources":["../../../../src/components/sidePanel/PanelStore.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAErF,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAElC,uCAAuC;AACvC,eAAO,MAAM,6BAA6B,IAAI,CAAA;AAC9C,kBAAkB;AAClB,eAAO,MAAM,qBAAqB,QAAS,CAAA;AAE3C;;4CAE4C;AAC5C,MAAM,MAAM,eAAe,GACvB;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACpD;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC/C;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,GAC/C;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AAatD,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAgC;IAC/C,OAAO,CAAC,SAAS,CAA8C;IAC/D,OAAO,CAAC,QAAQ,CAA2C;IAC3D,OAAO,CAAC,QAAQ,CAAI;IACpB,+CAA+C;IAC/C,OAAO,CAAC,UAAU,CAA8B;IAEhD,2DAA2D;IAC3D,QAAQ,CAAC,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM,IAAI;IA0BpE,IAAI,IAAI,SAAS,UAAU,EAAE;IAI7B,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAIvC,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,UAAU,CAAC,GAAG,IAAI,GAAG,IAAI;IAUtE,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;IAO5B,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAsB7C,SAAS,GAAI,UAAU,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC,CAGrE;IAED,OAAO,CAAC,IAAI;CAIb;AAED,0DAA0D;AAC1D,eAAO,MAAM,UAAU,YAAmB,CAAA"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
export const PANEL_UNREAD_CAP = 99;
|
|
2
|
+
/** 连续崩溃禁用阈值(会话内,时间窗内累计;设计文档 §18.4)。 */
|
|
3
|
+
export const PANEL_CRASH_DISABLE_THRESHOLD = 3;
|
|
4
|
+
/** 崩溃计数的滑动时间窗。 */
|
|
5
|
+
export const PANEL_CRASH_WINDOW_MS = 60_000;
|
|
6
|
+
function compareEntries(a, b) {
|
|
7
|
+
// 内置 Panel 排在插件 Panel 之前;同 source 内按 order,再按注册顺序。
|
|
8
|
+
const sourceA = a.definition.source === 'builtin' ? 0 : 1;
|
|
9
|
+
const sourceB = b.definition.source === 'builtin' ? 0 : 1;
|
|
10
|
+
if (sourceA !== sourceB)
|
|
11
|
+
return sourceA - sourceB;
|
|
12
|
+
const orderA = a.definition.order ?? 0;
|
|
13
|
+
const orderB = b.definition.order ?? 0;
|
|
14
|
+
if (orderA !== orderB)
|
|
15
|
+
return orderA - orderB;
|
|
16
|
+
return a.registrationId - b.registrationId;
|
|
17
|
+
}
|
|
18
|
+
export class PanelStore {
|
|
19
|
+
entries = new Map();
|
|
20
|
+
listeners = new Set();
|
|
21
|
+
snapshot = Object.freeze([]);
|
|
22
|
+
sequence = 0;
|
|
23
|
+
/** source='plugin' 的连续崩溃时间戳(会话内;注册/重注册即清零)。 */
|
|
24
|
+
crashTimes = new Map();
|
|
25
|
+
/** 重复 id → DUPLICATE_CONTRIBUTION_ID(与 tuiStatus 同一约定)。 */
|
|
26
|
+
register(definition, owner) {
|
|
27
|
+
if (this.entries.has(definition.id)) {
|
|
28
|
+
throw new Error(`DUPLICATE_CONTRIBUTION_ID: panel "${definition.id}" is already registered`);
|
|
29
|
+
}
|
|
30
|
+
this.sequence += 1;
|
|
31
|
+
const entry = {
|
|
32
|
+
definition,
|
|
33
|
+
owner,
|
|
34
|
+
registrationId: this.sequence,
|
|
35
|
+
badge: null,
|
|
36
|
+
lastError: null,
|
|
37
|
+
};
|
|
38
|
+
this.entries.set(definition.id, entry);
|
|
39
|
+
this.crashTimes.delete(definition.id);
|
|
40
|
+
this.emit({ type: 'registered', id: definition.id });
|
|
41
|
+
return () => {
|
|
42
|
+
// badge/lastError 更新会替换 entry 对象——按 registrationId 认亲,
|
|
43
|
+
// 而不是对象恒等(否则一次 badge 就会让撤下变成 no-op)。
|
|
44
|
+
if (this.entries.get(definition.id)?.registrationId === entry.registrationId) {
|
|
45
|
+
this.entries.delete(definition.id);
|
|
46
|
+
this.crashTimes.delete(definition.id);
|
|
47
|
+
this.emit({ type: 'unregistered', id: definition.id });
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
list() {
|
|
52
|
+
return this.snapshot;
|
|
53
|
+
}
|
|
54
|
+
get(id) {
|
|
55
|
+
return this.entries.get(id);
|
|
56
|
+
}
|
|
57
|
+
/** 只允许 owner 或宿主调用(调用侧自律,与 tuiStatus 相同)。 */
|
|
58
|
+
setBadge(id, badge) {
|
|
59
|
+
const entry = this.entries.get(id);
|
|
60
|
+
if (entry === undefined)
|
|
61
|
+
return;
|
|
62
|
+
const next = badge === null
|
|
63
|
+
? null
|
|
64
|
+
: { level: badge.level, unread: Math.min(PANEL_UNREAD_CAP, Math.max(0, badge.unread)), latestAt: Date.now() };
|
|
65
|
+
this.entries.set(id, { ...entry, badge: next });
|
|
66
|
+
this.emit({ type: 'badge', id });
|
|
67
|
+
}
|
|
68
|
+
clearBadge(id) {
|
|
69
|
+
const entry = this.entries.get(id);
|
|
70
|
+
if (entry === undefined || entry.badge === null)
|
|
71
|
+
return;
|
|
72
|
+
this.entries.set(id, { ...entry, badge: null });
|
|
73
|
+
this.emit({ type: 'badge', id });
|
|
74
|
+
}
|
|
75
|
+
reportError(id, error) {
|
|
76
|
+
const entry = this.entries.get(id);
|
|
77
|
+
if (entry === undefined)
|
|
78
|
+
return;
|
|
79
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
80
|
+
this.entries.set(id, { ...entry, lastError: { message, at: Date.now() } });
|
|
81
|
+
this.emit({ type: 'error', id });
|
|
82
|
+
// 插件 Panel 的连续崩溃禁用(§18.4):时间窗内第 N 次崩溃落禁用卡。
|
|
83
|
+
if (entry.definition.source !== 'plugin' || entry.disabled)
|
|
84
|
+
return;
|
|
85
|
+
const now = Date.now();
|
|
86
|
+
const window = (this.crashTimes.get(id) ?? []).filter(at => now - at <= PANEL_CRASH_WINDOW_MS);
|
|
87
|
+
window.push(now);
|
|
88
|
+
this.crashTimes.set(id, window);
|
|
89
|
+
if (window.length >= PANEL_CRASH_DISABLE_THRESHOLD) {
|
|
90
|
+
const current = this.entries.get(id);
|
|
91
|
+
if (current !== undefined && !current.disabled) {
|
|
92
|
+
this.entries.set(id, { ...current, disabled: true });
|
|
93
|
+
this.crashTimes.delete(id);
|
|
94
|
+
this.emit({ type: 'disabled', id });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
subscribe = (listener) => {
|
|
99
|
+
this.listeners.add(listener);
|
|
100
|
+
return () => { this.listeners.delete(listener); };
|
|
101
|
+
};
|
|
102
|
+
emit(event) {
|
|
103
|
+
this.snapshot = Object.freeze([...this.entries.values()].sort(compareEntries));
|
|
104
|
+
for (const listener of [...this.listeners])
|
|
105
|
+
listener(event);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
/** 进程级单例(内置经 registerBuiltinPanels,插件经 Phase 6 的准入外壳)。 */
|
|
109
|
+
export const panelStore = new PanelStore();
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SidePanelColumn: the right surface's chrome — PanelBar on top, PanelHost
|
|
3
|
+
* in the middle, and a 1-row key hint at the bottom (design doc §6.1).
|
|
4
|
+
*
|
|
5
|
+
* The hint row swaps text with focus: unfocused it advertises Ctrl+B,
|
|
6
|
+
* focused it lists the panel keys. The two thin rules frame the host and
|
|
7
|
+
* brighten to 'accent' together with the divider when the column has the
|
|
8
|
+
* focus — the whole seam lights up as one surface.
|
|
9
|
+
*
|
|
10
|
+
* Tabs come from the PanelStore (enabled ∩ registered, badge included);
|
|
11
|
+
* builtin registrations arrive via registerBuiltinPanels on module import.
|
|
12
|
+
*/
|
|
13
|
+
import React from 'react';
|
|
14
|
+
import type { ChannelUi } from '../../adapter/channel/ui-policy.js';
|
|
15
|
+
import type { SidePanelController } from './useSidePanel.js';
|
|
16
|
+
export interface SidePanelColumnProps {
|
|
17
|
+
readonly width: number;
|
|
18
|
+
readonly controller: SidePanelController;
|
|
19
|
+
readonly channel: ChannelUi;
|
|
20
|
+
readonly activity?: import('../../dsh-adapter/activity-store.js').ActivityView;
|
|
21
|
+
readonly attention?: {
|
|
22
|
+
readonly approvals: number;
|
|
23
|
+
readonly questions: number;
|
|
24
|
+
};
|
|
25
|
+
/** 宿主提供的「全屏」出口(Chat 把活动面板切到整屏形态)。 */
|
|
26
|
+
readonly onExpand?: (panelId: string) => void;
|
|
27
|
+
/** 会话轨迹投影(轨迹 Panel 的数据源)。 */
|
|
28
|
+
readonly trajectory?: import('../../dsh-adapter/trajectory/index.js').TrajBuild;
|
|
29
|
+
}
|
|
30
|
+
export declare function SidePanelColumn({ width, controller, channel, activity, attention, onExpand, trajectory }: SidePanelColumnProps): React.ReactNode;
|
|
31
|
+
//# sourceMappingURL=SidePanelColumn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidePanelColumn.d.ts","sourceRoot":"","sources":["../../../../src/components/sidePanel/SidePanelColumn.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAA;AAMnE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAA;AAI5D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,UAAU,EAAE,mBAAmB,CAAA;IACxC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAA;IAC3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,qCAAqC,EAAE,YAAY,CAAA;IAC9E,QAAQ,CAAC,SAAS,CAAC,EAAE;QAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/E,qCAAqC;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAC7C,6BAA6B;IAC7B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,uCAAuC,EAAE,SAAS,CAAA;CAChF;AAoCD,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,oBAAoB,GAAG,KAAK,CAAC,SAAS,CAkEhJ"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* SidePanelColumn: the right surface's chrome — PanelBar on top, PanelHost
|
|
4
|
+
* in the middle, and a 1-row key hint at the bottom (design doc §6.1).
|
|
5
|
+
*
|
|
6
|
+
* The hint row swaps text with focus: unfocused it advertises Ctrl+B,
|
|
7
|
+
* focused it lists the panel keys. The two thin rules frame the host and
|
|
8
|
+
* brighten to 'accent' together with the divider when the column has the
|
|
9
|
+
* focus — the whole seam lights up as one surface.
|
|
10
|
+
*
|
|
11
|
+
* Tabs come from the PanelStore (enabled ∩ registered, badge included);
|
|
12
|
+
* builtin registrations arrive via registerBuiltinPanels on module import.
|
|
13
|
+
*/
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import { Box, Text, useTerminalSize } from '../../ui.js';
|
|
16
|
+
import { t } from '../../i18n.js';
|
|
17
|
+
import { useSurfaceEdges } from '../SurfaceEdges.js';
|
|
18
|
+
import { PanelBar } from './PanelBar.js';
|
|
19
|
+
import { PanelHost } from './PanelHost.js';
|
|
20
|
+
import { panelStore } from './PanelStore.js';
|
|
21
|
+
import { registerBuiltinPanels } from './builtinPanels.js';
|
|
22
|
+
registerBuiltinPanels();
|
|
23
|
+
function fallbackTitle(id) {
|
|
24
|
+
const bare = id.includes(':') ? id.slice(id.indexOf(':') + 1) : id;
|
|
25
|
+
return bare.charAt(0).toUpperCase() + bare.slice(1);
|
|
26
|
+
}
|
|
27
|
+
function Rule({ focused }) {
|
|
28
|
+
// Structural chrome bleeds: the rule runs past the content column to the
|
|
29
|
+
// terminal's right edge (the panel surface's SurfaceEdges allow right
|
|
30
|
+
// bleed; zero without a page margin, so this is a no-op there).
|
|
31
|
+
const edges = useSurfaceEdges();
|
|
32
|
+
return (_jsx(Box, { height: 1, flexShrink: 0, marginRight: -edges.right, borderStyle: "single", borderTop: true, borderBottom: false, borderLeft: false, borderRight: false, borderColor: focused ? 'accent' : 'inactive' }));
|
|
33
|
+
}
|
|
34
|
+
/** 没有「已启用 ∩ 已注册」面板时的空态。 */
|
|
35
|
+
function EmptyNone() {
|
|
36
|
+
return (_jsx(Box, { flexDirection: "column", flexGrow: 1, alignItems: "center", justifyContent: "center", paddingX: 1, children: _jsx(Text, { dimColor: true, wrap: "truncate-end", children: t('panel-empty-none') }) }));
|
|
37
|
+
}
|
|
38
|
+
export function SidePanelColumn({ width, controller, channel, activity, attention, onExpand, trajectory }) {
|
|
39
|
+
const focused = controller.focus === 'panel';
|
|
40
|
+
const { rows } = useTerminalSize();
|
|
41
|
+
const entries = React.useSyncExternalStore(panelStore.subscribe, () => panelStore.list());
|
|
42
|
+
const tabs = controller.enabledPanelIds.map(id => {
|
|
43
|
+
const entry = entries.find(candidate => candidate.definition.id === id);
|
|
44
|
+
if (entry === undefined)
|
|
45
|
+
return { id, title: fallbackTitle(id) };
|
|
46
|
+
const def = entry.definition;
|
|
47
|
+
return {
|
|
48
|
+
id,
|
|
49
|
+
title: def.titleKey !== undefined ? t(def.titleKey) : def.title ?? fallbackTitle(id),
|
|
50
|
+
icon: def.icon,
|
|
51
|
+
badge: entry.badge,
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
const anyRegistered = tabs.length > 0 && entries.length > 0 &&
|
|
55
|
+
controller.enabledPanelIds.some(id => entries.some(entry => entry.definition.id === id));
|
|
56
|
+
// ⤢ 只对「活动面板 + 声明了整屏形态 + 宿主接了出口」出现:能力位是
|
|
57
|
+
// 声明的唯一真源,没有整屏对应物的面板(info/companion)不画。
|
|
58
|
+
const activeEntry = entries.find(entry => entry.definition.id === controller.activePanelId);
|
|
59
|
+
const canExpand = activeEntry?.definition.capabilities?.fullscreen === true && onExpand !== undefined;
|
|
60
|
+
// 标签点击与 ←/→ 宿主键走同一条路(openPanel 会顺带把焦点给右栏)。
|
|
61
|
+
const onSelectPanel = React.useCallback((id) => { controller.openPanel(id, { focus: true }); },
|
|
62
|
+
// openPanel 在 useSidePanel 里是空依赖 useCallback(引用稳定);
|
|
63
|
+
// controller 对象本身每次渲染都是新的,不能进依赖表。
|
|
64
|
+
[controller.openPanel]);
|
|
65
|
+
// Host 高度 = 列高 - PanelBar/上规/下规/hint 四行 chrome。
|
|
66
|
+
const hostHeight = Math.max(1, rows - 4);
|
|
67
|
+
return (_jsxs(Box, { flexDirection: "column", width: width, flexGrow: 1, children: [_jsx(PanelBar, { tabs: tabs, activeId: controller.activePanelId, width: width - 2, focused: focused, canExpand: canExpand, onExpand: canExpand ? () => onExpand?.(controller.activePanelId ?? '') : undefined, onSelect: onSelectPanel }), _jsx(Rule, { focused: focused }), _jsx(Box, { flexDirection: "column", flexGrow: 1, overflow: "hidden", children: anyRegistered
|
|
68
|
+
? (_jsx(PanelHost, { controller: controller, channel: channel, width: width, height: hostHeight, activity: activity, attention: attention, trajectory: trajectory, openFullscreen: onExpand }))
|
|
69
|
+
: _jsx(EmptyNone, {}) }), _jsx(Rule, { focused: focused }), _jsx(Box, { height: 1, flexShrink: 0, paddingX: 1, overflow: "hidden", children: _jsx(Text, { dimColor: true, wrap: "truncate-end", children: focused ? t('panel-hint-focused') : t('panel-hint-unfocused') }) })] }));
|
|
70
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SidePanelLayout: owns the two-column row — chat surface left, divider,
|
|
3
|
+
* side-panel surface right (design doc §4.1). It decides nothing about
|
|
4
|
+
* state: useSidePanel hands it a resolved geometry and this component only
|
|
5
|
+
* arranges boxes and re-provides contexts.
|
|
6
|
+
*
|
|
7
|
+
* What each column subtree gets (the PageMargin trick, one level down):
|
|
8
|
+
* - TerminalSizeContext narrowed to the column width, so every existing
|
|
9
|
+
* component that reads useTerminalSize() (MessageList, PromptInput,
|
|
10
|
+
* tool cards, Markdown tables…) automatically lays out for the column;
|
|
11
|
+
* - SurfaceEdgesContext re-provided per column: chat bleeds left into the
|
|
12
|
+
* page margin but stops at the divider, the panel bleeds right;
|
|
13
|
+
* - a numeric-width box with overflow="hidden" (never "%": ink resolves
|
|
14
|
+
* percentages against the padding-inclusive parent).
|
|
15
|
+
*
|
|
16
|
+
* PageInsetContext is deliberately NOT overridden: the chat column's
|
|
17
|
+
* origin is still the content-area origin, so screen-coordinate overlays
|
|
18
|
+
* (tooltips) keep their math.
|
|
19
|
+
*
|
|
20
|
+
* STRUCTURAL STABILITY (2026-10-02 crash fix). The collapsed state used to
|
|
21
|
+
* render bare `children`, which made split↔collapsed a tree-SHAPE change:
|
|
22
|
+
* React unmounted the whole chat column and mounted a fresh one on every
|
|
23
|
+
* Ctrl+B / editor-open / resize-across-the-threshold. That cost more than
|
|
24
|
+
* a repaint — the deletion commit ran ScrollBox's useImperativeHandle
|
|
25
|
+
* cleanup, whose ref is Chat's `setHandle` state setter, so the detached
|
|
26
|
+
* ref scheduled a state update INSIDE a commit; combined with the
|
|
27
|
+
* fullscreen editor publishing its node from an insertion effect (a store
|
|
28
|
+
* notification that renders synchronously inside the same commit) the
|
|
29
|
+
* nested-update counter ratcheted past React's limit and the process died
|
|
30
|
+
* with Minified React error #185. Keeping the chat column at a stable tree
|
|
31
|
+
* position turns every geometry change into a prop update, so nothing is
|
|
32
|
+
* deleted, no ref detaches mid-commit, and chat-side state (scroll
|
|
33
|
+
* position, draft, transcript measure cache) survives the toggle.
|
|
34
|
+
*
|
|
35
|
+
* While collapsed the wrappers are invisible by construction: the contexts
|
|
36
|
+
* re-provide the PARENT's own values (referentially identical), the chat
|
|
37
|
+
* box gets no width / no overflow / no click handler, and the outer row
|
|
38
|
+
* does not clip — so the collapsed frame stays byte-identical to the
|
|
39
|
+
* no-layout render (locked by verify-side-panel-layout).
|
|
40
|
+
*/
|
|
41
|
+
import React from 'react';
|
|
42
|
+
import type { SidePanelFocus } from './useSidePanel.js';
|
|
43
|
+
import type { SidePanelSplit } from './dimensions.js';
|
|
44
|
+
export interface SidePanelLayoutProps {
|
|
45
|
+
readonly geometry: SidePanelSplit | null;
|
|
46
|
+
readonly focus: SidePanelFocus;
|
|
47
|
+
/** Right-column content (PanelBar + PanelHost + hint). */
|
|
48
|
+
readonly side: React.ReactNode;
|
|
49
|
+
readonly onActivateChat?: () => void;
|
|
50
|
+
readonly onActivatePanel?: () => void;
|
|
51
|
+
readonly children: React.ReactNode;
|
|
52
|
+
}
|
|
53
|
+
export declare function SidePanelLayout({ geometry, focus, side, onActivateChat, onActivatePanel, children, }: SidePanelLayoutProps): React.ReactNode;
|
|
54
|
+
//# sourceMappingURL=SidePanelLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidePanelLayout.d.ts","sourceRoot":"","sources":["../../../../src/components/sidePanel/SidePanelLayout.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAErD,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI,CAAA;IACxC,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAA;IAC9B,0DAA0D;IAC1D,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,IAAI,CAAA;IACpC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,IAAI,CAAA;IACrC,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CACnC;AA6BD,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,cAAc,EACd,eAAe,EACf,QAAQ,GACT,EAAE,oBAAoB,GAAG,KAAK,CAAC,SAAS,CAqExC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* SidePanelLayout: owns the two-column row — chat surface left, divider,
|
|
4
|
+
* side-panel surface right (design doc §4.1). It decides nothing about
|
|
5
|
+
* state: useSidePanel hands it a resolved geometry and this component only
|
|
6
|
+
* arranges boxes and re-provides contexts.
|
|
7
|
+
*
|
|
8
|
+
* What each column subtree gets (the PageMargin trick, one level down):
|
|
9
|
+
* - TerminalSizeContext narrowed to the column width, so every existing
|
|
10
|
+
* component that reads useTerminalSize() (MessageList, PromptInput,
|
|
11
|
+
* tool cards, Markdown tables…) automatically lays out for the column;
|
|
12
|
+
* - SurfaceEdgesContext re-provided per column: chat bleeds left into the
|
|
13
|
+
* page margin but stops at the divider, the panel bleeds right;
|
|
14
|
+
* - a numeric-width box with overflow="hidden" (never "%": ink resolves
|
|
15
|
+
* percentages against the padding-inclusive parent).
|
|
16
|
+
*
|
|
17
|
+
* PageInsetContext is deliberately NOT overridden: the chat column's
|
|
18
|
+
* origin is still the content-area origin, so screen-coordinate overlays
|
|
19
|
+
* (tooltips) keep their math.
|
|
20
|
+
*
|
|
21
|
+
* STRUCTURAL STABILITY (2026-10-02 crash fix). The collapsed state used to
|
|
22
|
+
* render bare `children`, which made split↔collapsed a tree-SHAPE change:
|
|
23
|
+
* React unmounted the whole chat column and mounted a fresh one on every
|
|
24
|
+
* Ctrl+B / editor-open / resize-across-the-threshold. That cost more than
|
|
25
|
+
* a repaint — the deletion commit ran ScrollBox's useImperativeHandle
|
|
26
|
+
* cleanup, whose ref is Chat's `setHandle` state setter, so the detached
|
|
27
|
+
* ref scheduled a state update INSIDE a commit; combined with the
|
|
28
|
+
* fullscreen editor publishing its node from an insertion effect (a store
|
|
29
|
+
* notification that renders synchronously inside the same commit) the
|
|
30
|
+
* nested-update counter ratcheted past React's limit and the process died
|
|
31
|
+
* with Minified React error #185. Keeping the chat column at a stable tree
|
|
32
|
+
* position turns every geometry change into a prop update, so nothing is
|
|
33
|
+
* deleted, no ref detaches mid-commit, and chat-side state (scroll
|
|
34
|
+
* position, draft, transcript measure cache) survives the toggle.
|
|
35
|
+
*
|
|
36
|
+
* While collapsed the wrappers are invisible by construction: the contexts
|
|
37
|
+
* re-provide the PARENT's own values (referentially identical), the chat
|
|
38
|
+
* box gets no width / no overflow / no click handler, and the outer row
|
|
39
|
+
* does not clip — so the collapsed frame stays byte-identical to the
|
|
40
|
+
* no-layout render (locked by verify-side-panel-layout).
|
|
41
|
+
*/
|
|
42
|
+
import React from 'react';
|
|
43
|
+
import { Box, Text } from '../../ui.js';
|
|
44
|
+
import { TerminalSizeContext } from '../../ink/components/TerminalSizeContext.js';
|
|
45
|
+
import { useTerminalSize } from '../../ink/hooks/use-terminal-size.js';
|
|
46
|
+
import { SurfaceEdgesContext, useSurfaceEdges } from '../SurfaceEdges.js';
|
|
47
|
+
/**
|
|
48
|
+
* The 1-column seam. Rendered as an explicit glyph block (not a border) so
|
|
49
|
+
* it can tee into the panel column's horizontal rules: rows that line up
|
|
50
|
+
* with a rule draw '├', everything else '│' — the seam and the rules read
|
|
51
|
+
* as one framed surface instead of two crossing lines.
|
|
52
|
+
*/
|
|
53
|
+
function DividerColumn({ focused, rows, junctionRows, }) {
|
|
54
|
+
const junctions = new Set(junctionRows);
|
|
55
|
+
const glyphs = [];
|
|
56
|
+
for (let y = 0; y < Math.max(1, rows); y += 1) {
|
|
57
|
+
glyphs.push(junctions.has(y) ? '├' : '│');
|
|
58
|
+
}
|
|
59
|
+
return (_jsx(Box, { width: 1, flexShrink: 0, overflow: "hidden", children: _jsx(Text, { color: focused ? 'accent' : 'inactive', children: glyphs.join('\n') }) }));
|
|
60
|
+
}
|
|
61
|
+
export function SidePanelLayout({ geometry, focus, side, onActivateChat, onActivatePanel, children, }) {
|
|
62
|
+
const outerEdges = useSurfaceEdges();
|
|
63
|
+
const parentSize = useTerminalSize();
|
|
64
|
+
const rows = parentSize.rows;
|
|
65
|
+
const screenRows = parentSize.screenRows ?? parentSize.rows;
|
|
66
|
+
const split = geometry !== null;
|
|
67
|
+
const panelColumns = geometry?.panel ?? 0;
|
|
68
|
+
const chatEdges = React.useMemo(() => ({ left: outerEdges.left, right: 0 }), [outerEdges.left]);
|
|
69
|
+
const panelEdges = React.useMemo(() => ({ left: 0, right: outerEdges.right }), [outerEdges.right]);
|
|
70
|
+
// Collapsed: hand the parent's own objects straight back so consumers see
|
|
71
|
+
// byte-identical context values (and keep their memoization).
|
|
72
|
+
const chatSize = React.useMemo(() => (geometry === null ? parentSize : { columns: geometry.chat, rows, screenRows }),
|
|
73
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- geometry identity changes with the split
|
|
74
|
+
[parentSize, geometry, rows, screenRows]);
|
|
75
|
+
const panelSize = React.useMemo(() => ({ columns: panelColumns, rows, screenRows }), [panelColumns, rows, screenRows]);
|
|
76
|
+
return (_jsxs(Box, { flexDirection: "row", flexGrow: 1, flexShrink: 1, overflow: split ? 'hidden' : undefined, children: [_jsx(SurfaceEdgesContext.Provider, { value: split ? chatEdges : outerEdges, children: _jsx(TerminalSizeContext.Provider, { value: chatSize, children: _jsx(Box, { flexDirection: "column", flexGrow: split ? 0 : 1, width: geometry === null ? undefined : geometry.chat, flexShrink: 0, overflow: split ? 'hidden' : undefined, onClick: split ? onActivateChat : undefined, children: children }) }) }), split && (_jsxs(_Fragment, { children: [_jsx(DividerColumn, { focused: focus === 'panel', rows: rows, junctionRows: [1, Math.max(1, rows - 2)] }), _jsx(SurfaceEdgesContext.Provider, { value: panelEdges, children: _jsx(TerminalSizeContext.Provider, { value: panelSize, children: _jsx(Box, { flexDirection: "column", width: panelColumns, flexShrink: 0, overflow: "hidden", onClick: onActivatePanel,
|
|
77
|
+
/* The right column is fenced out of the fullscreen linear text
|
|
78
|
+
selection: a drag across chat rows must not capture panel
|
|
79
|
+
glyphs (design doc §4.6). Panels carry their own copy action. */
|
|
80
|
+
noSelect: true, children: side }) }) })] }))] }));
|
|
81
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 侧栏 context 两件套:
|
|
3
|
+
* - SidePanelRuntimeContext:useSidePanel 创建的运行时(键盘分发)+
|
|
4
|
+
* 当前 channel(内置 Adapter 的数据源;插件 Panel 不经过这里,它们
|
|
5
|
+
* 在 Phase 6 拿策展快照)。
|
|
6
|
+
* - PanelContext:PanelHost 为每个 Panel 子树提供的身份(panelId),
|
|
7
|
+
* usePanelInput 据此把业务键注册进分发器;不在 Panel 里(整屏
|
|
8
|
+
* 形态)时为 null,usePanelInput 退化为普通 useInput。
|
|
9
|
+
*/
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import type { ChannelUi } from '../../adapter/channel/ui-policy.js';
|
|
12
|
+
import type { ActivityView } from '../../dsh-adapter/activity-store.js';
|
|
13
|
+
import type { TrajBuild } from '../../dsh-adapter/trajectory/index.js';
|
|
14
|
+
import type { SidePanelRuntime } from './types.js';
|
|
15
|
+
export interface SidePanelRuntimeContextValue {
|
|
16
|
+
readonly runtime: SidePanelRuntime;
|
|
17
|
+
readonly channel: ChannelUi;
|
|
18
|
+
/** workingActivity 投影(Companion 等 Panel 用;activity 插件未装时
|
|
19
|
+
* 缺省,Panel 退回 channel.working / spinnerMode)。 */
|
|
20
|
+
readonly activity?: ActivityView;
|
|
21
|
+
/** Chat 的审批 / 问卷待处理快照(Companion 的 attention 输入)。 */
|
|
22
|
+
readonly attention?: {
|
|
23
|
+
readonly approvals: number;
|
|
24
|
+
readonly questions: number;
|
|
25
|
+
};
|
|
26
|
+
/** 会话轨迹投影(Chat 折叠的那一份,与全屏轨迹场景共用;未折叠完成为
|
|
27
|
+
* undefined)。轨迹 Panel 直接渲染它,不自己再折一次。 */
|
|
28
|
+
readonly trajectory?: TrajBuild;
|
|
29
|
+
/** 「全屏」出口:把某个 Panel 的内容切到整屏形态(PanelBar 的 ⤢ 用它)。
|
|
30
|
+
* 未接(或该 Panel 没有整屏形态)时 undefined,按钮照画但点击无效——
|
|
31
|
+
* 宿主是否可展开由 PanelDefinition.capabilities.fullscreen 决定。 */
|
|
32
|
+
readonly openFullscreen?: (panelId: string) => void;
|
|
33
|
+
}
|
|
34
|
+
export declare const SidePanelRuntimeContext: React.Context<SidePanelRuntimeContextValue | null>;
|
|
35
|
+
export declare function useSidePanelChannel(): ChannelUi;
|
|
36
|
+
/** 会话轨迹投影;Chat 还没折叠出来(或不在 PanelHost 下)时 undefined。 */
|
|
37
|
+
export declare function useSidePanelTrajectory(): TrajBuild | undefined;
|
|
38
|
+
/** 「全屏」出口:宿主没接时返回 undefined(按钮点击静默无效)。 */
|
|
39
|
+
export declare function useSidePanelFullscreen(): ((panelId: string) => void) | undefined;
|
|
40
|
+
export declare const PanelContext: React.Context<{
|
|
41
|
+
readonly panelId: string;
|
|
42
|
+
} | null>;
|
|
43
|
+
//# sourceMappingURL=SidePanelRuntimeContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SidePanelRuntimeContext.d.ts","sourceRoot":"","sources":["../../../../src/components/sidePanel/SidePanelRuntimeContext.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAA;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,OAAO,EAAE,gBAAgB,CAAA;IAClC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAA;IAC3B;sDACkD;IAClD,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAA;IAChC,oDAAoD;IACpD,QAAQ,CAAC,SAAS,CAAC,EAAE;QAAE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;IAC/E;6CACyC;IACzC,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,CAAA;IAC/B;;+DAE2D;IAC3D,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CACpD;AAED,eAAO,MAAM,uBAAuB,oDAAiE,CAAA;AAErG,wBAAgB,mBAAmB,IAAI,SAAS,CAI/C;AAED,sDAAsD;AACtD,wBAAgB,sBAAsB,IAAI,SAAS,GAAG,SAAS,CAE9D;AAED,0CAA0C;AAC1C,wBAAgB,sBAAsB,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC,GAAG,SAAS,CAEhF;AAED,eAAO,MAAM,YAAY;sBAA2C,MAAM;SAAgB,CAAA"}
|