@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,607 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Box, Text, useInput, useTerminalSize } from '../ui.js';
|
|
4
|
+
import { SearchBox } from '../components/SearchBox.js';
|
|
5
|
+
import { OverlayAbove } from '../components/OverlayAbove.js';
|
|
6
|
+
import { CommandSuggestions } from '../components/CommandSuggestions.js';
|
|
7
|
+
import { LogoV2 } from '../components/LogoV2.js';
|
|
8
|
+
import { resolveLaunchpadLayout } from '../components/launchpadLayout.js';
|
|
9
|
+
import { pickSplashFont, splashFontById } from '../components/splashFonts.js';
|
|
10
|
+
import { t } from '../i18n.js';
|
|
11
|
+
import { isMinimalUiMode } from '../minimalUiMode.js';
|
|
12
|
+
import { stringWidth } from '../ink/stringWidth.js';
|
|
13
|
+
import { isPlainReturn } from '../utils/modifiers.js';
|
|
14
|
+
import { actionMatches } from '../utils/keymap.js';
|
|
15
|
+
import { formatClipboardInsert, readClipboard } from '../utils/clipboard.js';
|
|
16
|
+
import { collapseToSingleLine, insertSingleLineAt, matchesPasteShortcut, stripBracketedPasteMarkers, } from '../utils/inputPaste.js';
|
|
17
|
+
/** 光标闪烁一个相位的毫秒数(用户要求 500–600ms 一相位)。 */
|
|
18
|
+
const CARET_BLINK_MS = 550;
|
|
19
|
+
/**
|
|
20
|
+
* 纯文字入口(2026-10 第六版修订:用户否掉了背景方块高亮——"高光有点 low 而且
|
|
21
|
+
* 鼠标移开之后居然不会消失,我希望换成字体高光,比如移到字体上变蓝加粗")。
|
|
22
|
+
*
|
|
23
|
+
* - 入口只渲染**一个标签文本**(无键位前缀、无边框、无指针字符 ❯);
|
|
24
|
+
* - 悬停/焦点 = **文字高光**:主题蓝(suggestion)+ 加粗,不再铺背景方块;
|
|
25
|
+
* 未悬停时就是普通 dim 文字;
|
|
26
|
+
* - **移入/移出都要复原**(上一版的真 bug):`onMouseEnter` 悬停并带焦点,
|
|
27
|
+
* `onMouseLeave` 撤悬停;焦点是悬停带进来的(`focused` 为真)就一并交还
|
|
28
|
+
* 输入框——否则"hover 设了焦点、离开没人清",高亮就赖着不走了;
|
|
29
|
+
* - **恒 1 行高**:标签是纯字符串、单个 Text 渲染,绝无"键帽一行/标签一行"
|
|
30
|
+
* 上下分离(上一版嵌套 span 在真终端上被实测抓到竖排成两行);
|
|
31
|
+
* - 鼠标契约照仓库规矩:挂得上 `onClick` 才给 hover 反馈;点击
|
|
32
|
+
* `stopImmediatePropagation`(整页有"点空白收回焦点"的兜底 handler,
|
|
33
|
+
* 不拦住会既执行动作又清焦点)。
|
|
34
|
+
*/
|
|
35
|
+
function ActionChip({ label, focused, onActivate, onHover, onHoverLeave, }) {
|
|
36
|
+
const [hovered, setHovered] = React.useState(false);
|
|
37
|
+
const active = hovered || focused;
|
|
38
|
+
return (_jsx(Box, { flexShrink: 0, height: 1, onMouseEnter: () => { setHovered(true); onHover(); }, onMouseLeave: () => { setHovered(false); onHoverLeave(); }, onClick: (event) => {
|
|
39
|
+
event.stopImmediatePropagation();
|
|
40
|
+
onActivate();
|
|
41
|
+
}, children: _jsx(Text, { color: active ? 'suggestion' : undefined, bold: active, dimColor: !active, children: ` ${label} ` }) }));
|
|
42
|
+
}
|
|
43
|
+
/** 焦点环里参数段的编码:-2 起按显示顺序递减(-1 是输入框,0.. 是动作入口)。 */
|
|
44
|
+
const paramFocusOf = (segment) => -2 - PARAM_SEGMENT_ORDER.indexOf(segment);
|
|
45
|
+
/** 焦点值反解参数段;-1(输入框)与动作入口(≥0)都返回 undefined。 */
|
|
46
|
+
function segmentOfFocus(focus) {
|
|
47
|
+
return focus <= -2 && focus > TIPS_FOCUS ? PARAM_SEGMENT_ORDER[-2 - focus] : undefined;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Tips 行在焦点环里的编码(第六版设计 2):参数段最深到 -5,Tips 取 -6。
|
|
51
|
+
* 键盘路径是仓库硬规矩——Tips 可点击轮换,就必须有不含鼠标的等价操作
|
|
52
|
+
* (焦点落到 Tips 行 + Enter = 切下一条,与点击同一条 rotateTip)。
|
|
53
|
+
*/
|
|
54
|
+
const TIPS_FOCUS = -6;
|
|
55
|
+
/**
|
|
56
|
+
* 左下角工作目录铭牌在焦点环里的编码(第七版):Tips 之后、环的最后一格。
|
|
57
|
+
* 铭牌可点开工作区切换,键盘路径走焦点环 + Enter(仓库硬规矩:每个可点
|
|
58
|
+
* 目标都要有不含鼠标的等价操作;复用环而不是另绑一个键,焦点环的语义
|
|
59
|
+
* (↑/↓/Tab 与版面顺序一致)自动覆盖它)。
|
|
60
|
+
*/
|
|
61
|
+
const CWD_CORNER_FOCUS = -7;
|
|
62
|
+
/** Tips 自动轮换的默认间隔(第七版:用户要「呼吸感」;手动切换后计时重置)。 */
|
|
63
|
+
const TIP_ROTATE_MS = 10_000;
|
|
64
|
+
/** 参数段固定显示顺序(模型 · 思考深度 · 模式(preset) · 权限)。 */
|
|
65
|
+
const PARAM_SEGMENT_ORDER = ['model', 'effort', 'preset', 'permission'];
|
|
66
|
+
/**
|
|
67
|
+
* 参数行的一个可点段(第五版;第六版与 ActionChip 同步改成文字高光):
|
|
68
|
+
* 同一套鼠标契约——挂得上 onClick 才给 hover 提亮;点击
|
|
69
|
+
* stopImmediatePropagation(不触发整页的收回焦点兜底);悬停/焦点 =
|
|
70
|
+
* 该段文字变主题蓝 + 加粗(不铺背景方块),宽度不变(不加内边距,
|
|
71
|
+
* 参数行的宽度预算按原文算);onMouseLeave 复原并交还悬停带进的焦点
|
|
72
|
+
* (与 ActionChip 的 BUG 2 修复同一条规则)。
|
|
73
|
+
*/
|
|
74
|
+
function ParamChip({ label, colored, focused, onActivate, onHover, onHoverLeave, }) {
|
|
75
|
+
const [hovered, setHovered] = React.useState(false);
|
|
76
|
+
const active = hovered || focused;
|
|
77
|
+
return (_jsx(Box, { flexShrink: 0, height: 1, onMouseEnter: () => { setHovered(true); onHover(); }, onMouseLeave: () => { setHovered(false); onHoverLeave(); }, onClick: (event) => {
|
|
78
|
+
event.stopImmediatePropagation();
|
|
79
|
+
onActivate();
|
|
80
|
+
}, children: _jsx(Text, { color: active ? 'suggestion' : colored ? 'autoAccept' : undefined, bold: active || colored === true, dimColor: !active && colored !== true, children: label }) }));
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* 左下角工作目录铭牌(第七版:可点开工作区切换)。样式契约与 ActionChip/
|
|
84
|
+
* ParamChip 同一套——悬停/焦点 = **文字高光**(主题蓝 + 加粗,不铺背景方块),
|
|
85
|
+
* 恒 1 行高,截断仍走 truncate-middle(窄屏不撑爆);点击拦住冒泡(不是
|
|
86
|
+
* 「点空白」);键盘路径 = 焦点环(环的末格)+ Enter,与点击同一条回调。
|
|
87
|
+
*/
|
|
88
|
+
function CornerChip({ label, focused, onActivate, onHover, onHoverLeave, }) {
|
|
89
|
+
const [hovered, setHovered] = React.useState(false);
|
|
90
|
+
const active = hovered || focused;
|
|
91
|
+
return (_jsx(Box, { flexShrink: 1, height: 1, onMouseEnter: () => { setHovered(true); onHover(); }, onMouseLeave: () => { setHovered(false); onHoverLeave(); }, onClick: (event) => {
|
|
92
|
+
event.stopImmediatePropagation();
|
|
93
|
+
onActivate();
|
|
94
|
+
}, children: _jsx(Text, { color: active ? 'suggestion' : undefined, bold: active, dimColor: !active, wrap: "truncate-middle", children: label }) }));
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Launchpad —— 每次启动的第一屏(取代旧的"只有鲸鱼标题的空白会话")。
|
|
98
|
+
*
|
|
99
|
+
* 它**不是一个新页面**:整块视觉核心仍然是 `LogoV2`(像素鲸鱼 / 女仆娘立绘、
|
|
100
|
+
* 块体 `DEEPSEEK`/`HARNESS` 大字、节日换词、求 star 彩蛋——一套代码),但走
|
|
101
|
+
* `LogoV2` 的 chrome="minimal" 极简形态并 align="center":只有立绘与大字,
|
|
102
|
+
* 版号/模型/工作目录/启动提示/欢迎语一概不画(用户实测要求 opencode 式
|
|
103
|
+
* 留白;欢迎语曾经和落地页自己的一行重复,两处一起删)。
|
|
104
|
+
*
|
|
105
|
+
* 版面(2026-10 第三版改版):**头部 + 输入框 + 框下成组三行**整块水平垂直
|
|
106
|
+
* 双居中,不再把提示行钉到屏幕底部、中间不留大空档:
|
|
107
|
+
*
|
|
108
|
+
* - 输入框(圆角边框)里**只有输入那一行**;
|
|
109
|
+
* - 紧贴框下方一行**参数行**(左对齐输入框):`模型 · 思考深度 · 模式 · 权限`,
|
|
110
|
+
* 四段缺哪段省哪段、全空整行不画;模型段**只显示模型名**(不带 provider/
|
|
111
|
+
* 前缀)且带浅紫主题色(autoAccept);第五版起四段**各自可点**,点开 Chat
|
|
112
|
+
* 既有的选择器(overlayPanel 盖在本屏之上,选中值就地更新这一行);
|
|
113
|
+
* - 隔一行呼吸留白(矮屏阶梯可撤,见 launchpadLayout)再一行**键帽按钮**
|
|
114
|
+
* (整行右对齐,与输入框右缘对齐);
|
|
115
|
+
* - 再下一行 **`● Tips:`**(居中,圆点橙色 warning)。
|
|
116
|
+
*
|
|
117
|
+
* 屏幕最底的双角铭牌(左 `cwd:branch`、右版本号)保留。
|
|
118
|
+
*
|
|
119
|
+
* **输入框在这一屏是唯一有状态的部件**:用户敲进去的东西必须原样带进聊天页,
|
|
120
|
+
* 否则"第一屏输入的字"就被这一屏吞了。第六版起行首 `/` 会弹出**命令补全面板**
|
|
121
|
+
* (`commands`/`onCommandPick` 两缝,数据与组件都与聊天页 composer 同源),
|
|
122
|
+
* 面板选中直接执行命令;面板没收掉时整行仍原样交给 `onSubmit`,由 `Chat`
|
|
123
|
+
* 走它既有的命令表判定(合并命令表,含 registry 命令)再决定 runCommand 或
|
|
124
|
+
* 发送。本地只读一点:行首是不是 `/`,用来把输入框左边的提示符从 `❯` 换成
|
|
125
|
+
* `⌘`。
|
|
126
|
+
*
|
|
127
|
+
* 光标闪烁:只在输入框有焦点(`focusIndex < 0`)且终端持有焦点时跑,
|
|
128
|
+
* 约 550ms 一个相位;**相位只切换样式**(inverse ↔ inverse+dim,见
|
|
129
|
+
* `SearchBox` 的 `caretBlink` 契约),不增删任何字符——无头回归读的是
|
|
130
|
+
* 视口纯文本,闪烁对它不可见,断言不随相位抖动。
|
|
131
|
+
*
|
|
132
|
+
* 居中与降级:宽度走 `resolveSplashLayout` 那一套(与开屏同源,阈值不会漂),
|
|
133
|
+
* 高度走 `resolveLaunchpadLayout`(整块撤:Tips → 键帽行 → 立绘 → 只留输入框)。
|
|
134
|
+
*
|
|
135
|
+
* 鼠标:`onClick`/`onMouseEnter` 只在 `<AlternateScreen>` 里触发,内联模式
|
|
136
|
+
* 天然没有它们,所以每个可点目标都必须有一条键盘路径(这里全部有:焦点 +
|
|
137
|
+
* Enter)。
|
|
138
|
+
*/
|
|
139
|
+
export function Launchpad({ query, cursorOffset, focusIndex, isTerminalFocused, whale, whaleIdle, whaleGirl, fontId, starred, onStarClick, firstRun, actions, overlayPanel, inputPaused = false, onParamPick, model, effort, preset, permission, commands, onCommandPick, clipboardReader = readClipboard,
|
|
140
|
+
/** Tips 自动轮换间隔(第七版;测试缝:无头回归注入短间隔确定性驱动相位)。 */
|
|
141
|
+
tipRotateMs = TIP_ROTATE_MS,
|
|
142
|
+
/** 左下角工作目录铭牌被点击/回车时交给 Chat(开既有的 /workspace 工作区菜单)。 */
|
|
143
|
+
onOpenWorkspace,
|
|
144
|
+
/** 内核(dsh)版本——右下角与 TUI 版本并列显示;读不到就不画内核段。 */
|
|
145
|
+
kernelVersion, cwd, branch, tuiVersion, onFocusChange, onAction, onQueryChange, onSubmit, onEscape, onBlankClick, }) {
|
|
146
|
+
const { columns, rows } = useTerminalSize();
|
|
147
|
+
// `columns`/`rows` 已经是**内容区**尺寸(PageMargin 收窄过 context),
|
|
148
|
+
// 所以这里不再减页边距——与 splashLayout 的约法一致。
|
|
149
|
+
// 光标偏移只在"输入框有焦点"时才有意义;未给(或焦点在快捷入口行)时
|
|
150
|
+
// 一律按行尾算——这与 `SearchBox` 自己的 `cursorOffset ?? query.length`
|
|
151
|
+
// 同一条约定,两处必须一致,否则退格会从"看不见的位置"删字。
|
|
152
|
+
const caret = focusIndex === -1 ? (cursorOffset ?? query.length) : query.length;
|
|
153
|
+
/** 焦点是否在输入框上(-1);参数段(≤-2)与动作入口(≥0)都不算。 */
|
|
154
|
+
const inputFocused = focusIndex === -1;
|
|
155
|
+
// ── 命令补全面板(第六版 BUG 1)──────────────────────────────────────────
|
|
156
|
+
// 与聊天页 composer 同一套契约:行首 / + 有候选 → 面板上屏;↑/↓ 移选中、
|
|
157
|
+
// Enter/Tab/点击执行选中命令、Esc 只收面板(不清草稿——用户可能只是想
|
|
158
|
+
// 看一眼)。`dismissedFor` 记住"这条 query 被收过":Esc 之后继续打字
|
|
159
|
+
// (query 变了)面板自然回来,与 PromptInput 的补全行为同源。
|
|
160
|
+
const [paletteIndex, setPaletteIndex] = React.useState(0);
|
|
161
|
+
const [paletteDismissedFor, setPaletteDismissedFor] = React.useState('');
|
|
162
|
+
const paletteCommands = commands !== undefined && query.startsWith('/') && query !== paletteDismissedFor
|
|
163
|
+
? commands
|
|
164
|
+
: [];
|
|
165
|
+
const paletteOpen = inputFocused && paletteCommands.length > 0 && onCommandPick !== undefined;
|
|
166
|
+
const paletteSelectedIndex = Math.min(paletteIndex, Math.max(0, paletteCommands.length - 1));
|
|
167
|
+
const paletteSelected = paletteCommands[paletteSelectedIndex];
|
|
168
|
+
const pickCommand = (commandLine) => {
|
|
169
|
+
setPaletteDismissedFor(query);
|
|
170
|
+
if (onCommandPick !== undefined)
|
|
171
|
+
onCommandPick(commandLine);
|
|
172
|
+
};
|
|
173
|
+
// ── Tips 轮换(第六版设计 2)─────────────────────────────────────────────
|
|
174
|
+
// 轮换顺序(注释即契约):launchpad-tip → launchpad-tip-2 → launchpad-tip-3
|
|
175
|
+
// → 回到 launchpad-tip。首启(launchpad-first-run)**优先级最高**:firstRun
|
|
176
|
+
// 为真时整行只显示那一句、不参与轮换(引导没跑完之前别的 Tips 都是噪音)。
|
|
177
|
+
// 点击 Tips 行或把焦点落到 Tips(Enter)都切下一条。
|
|
178
|
+
const TIP_KEYS = ['launchpad-tip', 'launchpad-tip-2', 'launchpad-tip-3'];
|
|
179
|
+
const [tipIndex, setTipIndex] = React.useState(0);
|
|
180
|
+
const rotateTip = () => { setTipIndex(index => (index + 1) % TIP_KEYS.length); };
|
|
181
|
+
// 粘贴的异步落点:剪贴板读回是异步的,读取期间用户可能继续打字——插入必须
|
|
182
|
+
// 用**当时最新**的 query/caret(PromptInput 用 revision 守同一条;这里没有
|
|
183
|
+
// 本地 state,用每次渲染刷新的 refs 守),不能吃按键那一刻的闭包旧值。
|
|
184
|
+
const queryRef = React.useRef(query);
|
|
185
|
+
queryRef.current = query;
|
|
186
|
+
const caretRef = React.useRef(caret);
|
|
187
|
+
caretRef.current = caret;
|
|
188
|
+
const clipboardBusyRef = React.useRef(false);
|
|
189
|
+
/** 粘贴提示:落地页没有 toast 基础设施,借 Tips 行显示 4 秒(失败不能静默)。 */
|
|
190
|
+
const [pasteNotice, setPasteNotice] = React.useState(undefined);
|
|
191
|
+
const noticeTimerRef = React.useRef(null);
|
|
192
|
+
const showPasteNotice = (message) => {
|
|
193
|
+
setPasteNotice(message);
|
|
194
|
+
if (noticeTimerRef.current !== null)
|
|
195
|
+
clearTimeout(noticeTimerRef.current);
|
|
196
|
+
const timer = setTimeout(() => {
|
|
197
|
+
noticeTimerRef.current = null;
|
|
198
|
+
setPasteNotice(undefined);
|
|
199
|
+
}, 4000);
|
|
200
|
+
timer.unref?.();
|
|
201
|
+
noticeTimerRef.current = timer;
|
|
202
|
+
};
|
|
203
|
+
React.useEffect(() => () => {
|
|
204
|
+
if (noticeTimerRef.current !== null)
|
|
205
|
+
clearTimeout(noticeTimerRef.current);
|
|
206
|
+
}, []);
|
|
207
|
+
/** 单行插入(粘贴):换行折叠成空格、`\r` 去掉——落地页是单行编辑器,
|
|
208
|
+
* 多行内容不许拼出换行(Enter 才是提交)。落在当下光标处。 */
|
|
209
|
+
const insertSingleLine = (text) => {
|
|
210
|
+
const clean = collapseToSingleLine(text);
|
|
211
|
+
if (clean === '')
|
|
212
|
+
return;
|
|
213
|
+
// 异步落点守则:读回那一刻的 query/caret 才算数(refs 每次渲染刷新)。
|
|
214
|
+
const next = insertSingleLineAt(queryRef.current, caretRef.current, clean);
|
|
215
|
+
onQueryChange(next.text, next.caret);
|
|
216
|
+
onFocusChange(-1);
|
|
217
|
+
};
|
|
218
|
+
// 光标闪烁相位(第四版修订:**自动呼吸**,不要求终端 focus 事件)。开关只看
|
|
219
|
+
// 「输入框是这一屏的焦点目标」(focusIndex < 0)——`isTerminalFocused` 依赖
|
|
220
|
+
// DECSET 1004 focus 事件,Windows Terminal 下要点击窗口才发,拿它当开关就
|
|
221
|
+
// 出现"必须手动点一下才开始闪"(用户实测)。它其余的语义(SearchBox 的
|
|
222
|
+
// 失焦降级等)保留,只是不再控制闪烁。样式切换、字符不动(模块头注释里
|
|
223
|
+
// 的契约)。定时器 unref——探针宿主不因闪烁挂着事件循环。
|
|
224
|
+
const inputActive = inputFocused;
|
|
225
|
+
const [caretPhase, setCaretPhase] = React.useState(true);
|
|
226
|
+
React.useEffect(() => {
|
|
227
|
+
if (!inputActive) {
|
|
228
|
+
setCaretPhase(true);
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
const timer = setInterval(() => { setCaretPhase(phase => !phase); }, CARET_BLINK_MS);
|
|
232
|
+
timer.unref?.();
|
|
233
|
+
return () => { clearInterval(timer); };
|
|
234
|
+
}, [inputActive]);
|
|
235
|
+
// 参数行(第五版;第六版设计 1 改 preset 段):**只画值、不画字段名**;
|
|
236
|
+
// 模型段**只显示模型名**(去掉 provider/ 前缀——用户原话「两个都放的话就
|
|
237
|
+
// 太长了」):`glm-5.3 · Max · Standard · default`。模式段显示 agent
|
|
238
|
+
// preset 的显示名(Standard/PTC/极简…,Chat 从 preset 名册解析后传入);
|
|
239
|
+
// 模型值带浅紫主题色,其余 dim。四段各自可点(onParamPick → Chat 既有的
|
|
240
|
+
// /model · /effort · /preset · /permission 选择器)。
|
|
241
|
+
const paramParts = (() => {
|
|
242
|
+
const parts = [];
|
|
243
|
+
if (model !== undefined && model !== '')
|
|
244
|
+
parts.push({ segment: 'model', value: model, colored: true });
|
|
245
|
+
if (effort !== undefined && effort !== '') {
|
|
246
|
+
parts.push({ segment: 'effort', value: effort.charAt(0).toUpperCase() + effort.slice(1) });
|
|
247
|
+
}
|
|
248
|
+
if (preset !== undefined && preset !== '') {
|
|
249
|
+
parts.push({ segment: 'preset', value: preset });
|
|
250
|
+
}
|
|
251
|
+
if (permission !== undefined && permission !== '')
|
|
252
|
+
parts.push({ segment: 'permission', value: permission });
|
|
253
|
+
return parts;
|
|
254
|
+
})();
|
|
255
|
+
// 宽度自适应:参数行是**单行**(折行会把 F 组的「整句要么完整要么不出现」不
|
|
256
|
+
// 变量打碎)。装不下时从尾部省段(最不重要的先走:权限 → 模式 → 思考深度),
|
|
257
|
+
// 连第一段都放不下就整行不画。分隔符是 ` · `(两侧各两格)。
|
|
258
|
+
const paramBudget = Math.max(24, Math.min(columns - 4, 72)) - 2;
|
|
259
|
+
const fittedParams = [];
|
|
260
|
+
let paramUsed = 0;
|
|
261
|
+
for (const part of paramParts) {
|
|
262
|
+
const width = stringWidth(part.value);
|
|
263
|
+
const next = fittedParams.length === 0 ? width : paramUsed + 5 + width;
|
|
264
|
+
if (next > paramBudget)
|
|
265
|
+
break;
|
|
266
|
+
fittedParams.push(part);
|
|
267
|
+
paramUsed = next;
|
|
268
|
+
}
|
|
269
|
+
const hasParams = fittedParams.length > 0;
|
|
270
|
+
// 双角铭牌:像两枚低调的机械铭牌,把整块界面扎在终端底边上。
|
|
271
|
+
const cornerLeft = [cwd, branch].filter(part => part !== undefined && part !== '').join(':');
|
|
272
|
+
// 右下角双版本(第七版,竖排两行):第一行 TUI、第二行内核(dsh-core)。
|
|
273
|
+
// 内核版本来自 contract.installedKernelVersion 的真实读数(宿主 CLI 或内核
|
|
274
|
+
// 线包的 manifest),读不到就只画 TUI 一行——绝不编造。
|
|
275
|
+
const tuiPart = tuiVersion === undefined || tuiVersion === '' ? undefined : `dsh-tui v${tuiVersion}`;
|
|
276
|
+
const kernelPart = kernelVersion === undefined || kernelVersion === '' ? undefined : `dsh-core v${kernelVersion}`;
|
|
277
|
+
const cardWidth = Math.max(24, Math.min(columns - 4, 72));
|
|
278
|
+
const layout = resolveLaunchpadLayout(columns, rows, {
|
|
279
|
+
params: hasParams,
|
|
280
|
+
whale,
|
|
281
|
+
whaleGirl,
|
|
282
|
+
font: launchpadFont(fontId),
|
|
283
|
+
});
|
|
284
|
+
// Tips 自动轮换(第七版,用户要「呼吸感」):约 10s 一换,与点击/焦点+Enter
|
|
285
|
+
// 的手动切换**并存**——手动切换改 tipIndex,本 effect 以 tipIndex 为依赖,
|
|
286
|
+
// 重臂即计时重置(刚点完不会立刻被自动轮换跳走)。只在 Tips 行真的在画、
|
|
287
|
+
// 且不是首启句/粘贴提示时跑;本组件被整屏盖住时随之卸载,定时器自然停。
|
|
288
|
+
// 切换只改那一行文本(TIP_KEYS 查表),行高与居中位置不变——无布局抖动。
|
|
289
|
+
const tipsAutoRotatable = layout.showTip && pasteNotice === undefined && !firstRun;
|
|
290
|
+
React.useEffect(() => {
|
|
291
|
+
if (!tipsAutoRotatable)
|
|
292
|
+
return;
|
|
293
|
+
const timer = setInterval(() => { setTipIndex(index => (index + 1) % TIP_KEYS.length); }, tipRotateMs);
|
|
294
|
+
timer.unref?.();
|
|
295
|
+
return () => { clearInterval(timer); };
|
|
296
|
+
}, [tipsAutoRotatable, tipRotateMs, tipIndex]);
|
|
297
|
+
// 一行装得下几个动作:装不下的**不画**(不是截断)——半个标签比少一个
|
|
298
|
+
// 入口更难懂。键盘仍能走到全部入口,丢掉的只是鼠标的礼貌。
|
|
299
|
+
// 第四版标签就是**纯文字**(无键帽/键位前缀);带插值的(Continue 标题)由 t() 解。
|
|
300
|
+
const chips = fitChips(actions.map(action => t(action.labelKey, action.values)), columns);
|
|
301
|
+
/**
|
|
302
|
+
* 键帽行放不放得下:`fitChips` 已经按宽度整条取舍(绝不切半个标签),
|
|
303
|
+
* 这里只回答「一条都放不下时还画不画」——不画,省下一行给留白。
|
|
304
|
+
*/
|
|
305
|
+
const hintsFit = chips.length > 0;
|
|
306
|
+
/**
|
|
307
|
+
* 这一屏独占键盘(`Chat` 在 `supervisorOpen` 那一层之前让位),所以输入
|
|
308
|
+
* 在这里自持——把按键转发给 Chat 反而要多绕一层 state 往返。
|
|
309
|
+
*
|
|
310
|
+
* 编辑能力刻意只做单行编辑器该有的那几样:退格 / Delete / 左右移动 /
|
|
311
|
+
* Home / End / 粘贴。首屏不是编辑器,用户在上面打的第一句通常就一两个
|
|
312
|
+
* 词;多行、图片、`@` 补全都属于聊天页,敲 Enter 就过去了。
|
|
313
|
+
*
|
|
314
|
+
* `↑/↓` 与 `Tab` 在键帽行上移动焦点;焦点在 `-1` 时这两组键无操作
|
|
315
|
+
* (首屏没有可滚的东西)。
|
|
316
|
+
*/
|
|
317
|
+
useInput((input, key, event) => {
|
|
318
|
+
// 选择器盖在这一屏之上时键盘整块让位(Chat 的 overlay 分支处理;Esc 关
|
|
319
|
+
// 选择器回到这里)。没有这道闸,选择器分支没消费的键会漏进草稿。
|
|
320
|
+
if (inputPaused)
|
|
321
|
+
return;
|
|
322
|
+
const composing = key.ctrl || key.meta || key.super;
|
|
323
|
+
// 终端原生粘贴(bracketed paste:Ctrl+Shift+V / 右键 / Shift+Insert):
|
|
324
|
+
// ink 把载荷标成 isPasted 交给 useInput;标记字节(\x1b[200~ / 201~)在
|
|
325
|
+
// 解析层已被剥掉,这里的 input 就是纯载荷。换行折叠成单行(见上)。
|
|
326
|
+
if (event?.isPasted === true && input.length > 0) {
|
|
327
|
+
insertSingleLine(stripBracketedPasteMarkers(input));
|
|
328
|
+
event.stopImmediatePropagation();
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
// Ctrl+V / Cmd+V(keymap 的 paste 动作,可经 /settings 重映射;照
|
|
332
|
+
// PromptInput 的做法用 actionMatches,不硬编码键字符串)读系统剪贴板。
|
|
333
|
+
// 曾经的 bug:组合键兜底把 Ctrl+V 一口吞掉,粘贴永远是死的。
|
|
334
|
+
if (matchesPasteShortcut(input, key)) {
|
|
335
|
+
if (!clipboardBusyRef.current) {
|
|
336
|
+
clipboardBusyRef.current = true;
|
|
337
|
+
void clipboardReader()
|
|
338
|
+
.then(content => {
|
|
339
|
+
if (content === null) {
|
|
340
|
+
showPasteNotice(t('input-clipboard-empty'));
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
if (content.kind === 'unavailable') {
|
|
344
|
+
showPasteNotice(t(content.wsl === true ? 'input-clipboard-unavailable-wsl' : 'input-clipboard-unavailable'));
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
if (content.kind === 'image') {
|
|
348
|
+
// 单行编辑器不能暂存图片(staged image 是聊天页的能力);
|
|
349
|
+
// 插入临时文件路径只会留一条谁也读不懂的路径——提示而不是插入。
|
|
350
|
+
showPasteNotice(t('input-clipboard-unavailable'));
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
insertSingleLine(formatClipboardInsert(content));
|
|
354
|
+
})
|
|
355
|
+
.catch(() => {
|
|
356
|
+
showPasteNotice(t('input-clipboard-read-failed'));
|
|
357
|
+
})
|
|
358
|
+
.finally(() => {
|
|
359
|
+
clipboardBusyRef.current = false;
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
event.stopImmediatePropagation();
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
// 第七版:Continue 的专属快捷键(keymap 的 `continue` 动作,默认 Alt+R,
|
|
366
|
+
// 可经 /settings → Shortcuts 重映射)。只在这一屏生效(聊天页不绑这条);
|
|
367
|
+
// actions 里没有 continue(无可继续会话)时不放假动作——按下即忽略。
|
|
368
|
+
if (actionMatches('continue', input, key)) {
|
|
369
|
+
const continueAction = actions.find(action => action.id === 'continue');
|
|
370
|
+
if (continueAction !== undefined) {
|
|
371
|
+
onAction(continueAction);
|
|
372
|
+
event.stopImmediatePropagation();
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
// 命令补全面板(第六版 BUG 1):面板开着时 ↑/↓/Enter/Tab/Esc 全归面板——
|
|
377
|
+
// 与聊天页 composer 的补全菜单同一套键位。Enter/Tab/点击 = 执行选中命令
|
|
378
|
+
// (onCommandPick → Chat 的 runCommand,绝不 submit);Esc 只收面板,
|
|
379
|
+
// 草稿一字不动(用户可能只是想看一眼有什么命令)。
|
|
380
|
+
if (paletteOpen && paletteSelected !== undefined) {
|
|
381
|
+
if (key.upArrow || key.downArrow) {
|
|
382
|
+
const count = paletteCommands.length;
|
|
383
|
+
setPaletteIndex(previous => (previous + (key.downArrow ? 1 : -1) + count) % count);
|
|
384
|
+
event.stopImmediatePropagation();
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
if (key.tab || isPlainReturn(key)) {
|
|
388
|
+
pickCommand(paletteSelected.commandLine ?? '/' + paletteSelected.name + ' ');
|
|
389
|
+
event.stopImmediatePropagation();
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
if (key.escape) {
|
|
393
|
+
setPaletteDismissedFor(query);
|
|
394
|
+
event.stopImmediatePropagation();
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
if (key.escape) {
|
|
399
|
+
// 空输入时 Esc 去看会话(首屏最常见的下一步);已经有字就只清空它,
|
|
400
|
+
// 免得辛苦打的半句话被一次性丢掉。
|
|
401
|
+
if (query !== '')
|
|
402
|
+
onQueryChange('', 0);
|
|
403
|
+
else
|
|
404
|
+
onEscape('sessions');
|
|
405
|
+
event.stopImmediatePropagation();
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
if (key.ctrl && (input === 'c' || input === 'd')) {
|
|
409
|
+
if (query !== '')
|
|
410
|
+
onQueryChange('', 0);
|
|
411
|
+
else
|
|
412
|
+
onEscape('exit');
|
|
413
|
+
event.stopImmediatePropagation();
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
if (isPlainReturn(key)) {
|
|
417
|
+
// 焦点画在哪一格,Enter 就归谁:Tips 行(-6)切下一条 Tip、参数段(≤-2)
|
|
418
|
+
// 点开它对应的选择器、动作入口(≥0)激活那一条,输入框有焦点(`-1`)时
|
|
419
|
+
// 才把整行原文交回 Chat。键盘路径是仓库硬规矩(每个可点目标都要有),
|
|
420
|
+
// 四段参数与可点击的 Tips 行也不例外。
|
|
421
|
+
const focusedSegment = segmentOfFocus(focusIndex);
|
|
422
|
+
if (focusIndex === TIPS_FOCUS) {
|
|
423
|
+
rotateTip();
|
|
424
|
+
}
|
|
425
|
+
else if (focusIndex === CWD_CORNER_FOCUS && onOpenWorkspace !== undefined) {
|
|
426
|
+
// 左下角工作目录铭牌(第七版):Enter = 打开既有 /workspace 菜单。
|
|
427
|
+
onOpenWorkspace();
|
|
428
|
+
}
|
|
429
|
+
else if (focusedSegment !== undefined && onParamPick !== undefined) {
|
|
430
|
+
onParamPick(focusedSegment);
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
const focused = focusIndex >= 0 ? actions[focusIndex] : undefined;
|
|
434
|
+
if (focused === undefined)
|
|
435
|
+
onSubmit(query);
|
|
436
|
+
else
|
|
437
|
+
onAction(focused);
|
|
438
|
+
}
|
|
439
|
+
event.stopImmediatePropagation();
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
if (key.tab || key.upArrow || key.downArrow) {
|
|
443
|
+
if (actions.length === 0)
|
|
444
|
+
return;
|
|
445
|
+
const step = key.upArrow || (key.tab && key.shift) ? -1 : 1;
|
|
446
|
+
// `-1`(输入框)从下方进入:向"上"回到输入框,向"下"落到第一格——
|
|
447
|
+
// Tab 在输入框上则直接进第一格。
|
|
448
|
+
// 焦点环 = 输入框(`-1`)+ **画出来的**参数段(第五版,先于入口行——
|
|
449
|
+
// 参数行在版面上就在入口行上方,↓ 的空间顺序与环顺序一致)+ **画出来的**
|
|
450
|
+
// 入口 + Tips 行(第六版设计 2,环的最后一格——它在版面上就在入口行下方)。
|
|
451
|
+
// 窄终端里 `fitChips`/参数行的宽度裁剪会丢掉放不下的那几个,按
|
|
452
|
+
// 整张表绕圈会让焦点指着一个看不见的目标、Enter 触发一个看不见的动作。
|
|
453
|
+
const tipsFocusable = layout.showTip && pasteNotice === undefined && !firstRun;
|
|
454
|
+
// 左下角铭牌(第七版):画得出来且接了 onOpenWorkspace 才进环(末格)。
|
|
455
|
+
const cornerFocusable = layout.showCorners && cornerLeft !== '' && onOpenWorkspace !== undefined;
|
|
456
|
+
const ring = [
|
|
457
|
+
-1,
|
|
458
|
+
...fittedParams.map(part => paramFocusOf(part.segment)),
|
|
459
|
+
...chips.map(chip => chip.index),
|
|
460
|
+
...(tipsFocusable ? [TIPS_FOCUS] : []),
|
|
461
|
+
...(cornerFocusable ? [CWD_CORNER_FOCUS] : []),
|
|
462
|
+
];
|
|
463
|
+
const at = ring.indexOf(focusIndex);
|
|
464
|
+
const next = ring[((at >= 0 ? at : 0) + step + ring.length) % ring.length];
|
|
465
|
+
onFocusChange(next);
|
|
466
|
+
event.stopImmediatePropagation();
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
if (key.leftArrow || key.rightArrow || key.home || key.end) {
|
|
470
|
+
if (!inputFocused)
|
|
471
|
+
return;
|
|
472
|
+
const at = caret;
|
|
473
|
+
const next = key.home ? 0
|
|
474
|
+
: key.end ? query.length
|
|
475
|
+
: key.leftArrow ? Math.max(0, prevBoundary(query, at))
|
|
476
|
+
: Math.min(query.length, nextBoundary(query, at));
|
|
477
|
+
onQueryChange(query, next);
|
|
478
|
+
event.stopImmediatePropagation();
|
|
479
|
+
return;
|
|
480
|
+
}
|
|
481
|
+
if (key.backspace || key.delete) {
|
|
482
|
+
if (!inputFocused)
|
|
483
|
+
return;
|
|
484
|
+
const at = caret;
|
|
485
|
+
if (key.backspace) {
|
|
486
|
+
if (at === 0)
|
|
487
|
+
return;
|
|
488
|
+
const cut = prevBoundary(query, at);
|
|
489
|
+
onQueryChange(query.slice(0, cut) + query.slice(at), cut);
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
if (at >= query.length)
|
|
493
|
+
return;
|
|
494
|
+
onQueryChange(query.slice(0, at) + query.slice(nextBoundary(query, at)), at);
|
|
495
|
+
}
|
|
496
|
+
event.stopImmediatePropagation();
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
if (composing || key.return)
|
|
500
|
+
return;
|
|
501
|
+
// 可打印输入(含粘贴整段):接到光标处,交给 SearchBox 的窗口化去滚。
|
|
502
|
+
const typed = input.replace(/[\r\n]+/gu, '');
|
|
503
|
+
if (typed === '')
|
|
504
|
+
return;
|
|
505
|
+
const at = caret;
|
|
506
|
+
onQueryChange(query.slice(0, at) + typed + query.slice(at), at + typed.length);
|
|
507
|
+
onFocusChange(-1);
|
|
508
|
+
event.stopImmediatePropagation();
|
|
509
|
+
});
|
|
510
|
+
return (_jsxs(Box, { flexDirection: "column", width: columns, height: rows, onClick: onBlankClick, children: [_jsxs(Box, { flexDirection: "column", flexGrow: 1, alignItems: "center", justifyContent: "center", children: [layout.showHero && (_jsx(LogoV2, { fontId: fontId, whale: layout.showWhale && whale, whaleIdle: whaleIdle, whaleGirl: layout.showWhale && whaleGirl, starred: starred, onStarClick: onStarClick, skipIntro: true, align: "center", chrome: "minimal", arrangement: "column" })), _jsxs(Box, { flexDirection: "column", width: cardWidth, marginTop: layout.heroGapRows, children: [_jsx(Box, { flexDirection: "column", borderStyle: "round", borderColor: inputFocused ? 'suggestion' : 'inactive', paddingX: 1, width: cardWidth, children: _jsx(SearchBox, { query: query, placeholder: t('launchpad-placeholder'),
|
|
511
|
+
// 第七版(用户原话「光标永远不消失 哪怕焦点没了也不消失」):
|
|
512
|
+
// 只要这一屏在,输入光标**常在**——焦点挪到参数段/入口行只影响
|
|
513
|
+
// 外框提亮(inputFocused),不再当光标的开关。
|
|
514
|
+
isFocused: true, isTerminalFocused: inputFocused ? true : isTerminalFocused,
|
|
515
|
+
// 占位紧跟 ❯ 之后左对齐(用户实测要求;只影响落地页这一处)。
|
|
516
|
+
placeholderAlign: "left",
|
|
517
|
+
// 边框由外层卡片画——SearchBox 自己那圈收起来,否则就是框套框。
|
|
518
|
+
borderless: true, prefix: query.startsWith('/') ? '⌘' : '❯', width: cardWidth - 4, cursorOffset: caret, caretBlink: inputFocused ? caretPhase : true }) }), hasParams && (_jsx(Box, { paddingLeft: 2, height: 1, flexDirection: "row", children: fittedParams.map((part, index) => (_jsxs(React.Fragment, { children: [index > 0 && _jsx(Text, { dimColor: true, children: ' ' + String.fromCharCode(183) + ' ' }), onParamPick === undefined ? (_jsx(Text, { color: part.colored === true ? 'autoAccept' : undefined, bold: part.colored === true, dimColor: part.colored !== true, children: part.value })) : (_jsx(ParamChip, { label: part.value, colored: part.colored, focused: focusIndex === paramFocusOf(part.segment), onActivate: () => onParamPick(part.segment), onHover: () => onFocusChange(paramFocusOf(part.segment)), onHoverLeave: () => {
|
|
519
|
+
if (focusIndex === paramFocusOf(part.segment))
|
|
520
|
+
onFocusChange(-1);
|
|
521
|
+
} }))] }, part.segment))) })), overlayPanel !== undefined && (_jsx(OverlayAbove, { maxHeight: Math.max(rows - 8, 1), transparent: true, children: _jsx(Box, { onClick: (event) => { event.stopImmediatePropagation(); }, children: overlayPanel }) })), overlayPanel === undefined && paletteOpen && paletteSelected !== undefined && (_jsx(OverlayAbove, { maxHeight: Math.max(rows - 8, 1), transparent: true, children: _jsx(Box, { onClick: (event) => { event.stopImmediatePropagation(); }, children: _jsx(CommandSuggestions, { commands: paletteCommands, selectedIndex: paletteSelectedIndex, columns: columns, query: query, onPick: (index) => {
|
|
522
|
+
const command = paletteCommands[index];
|
|
523
|
+
if (command !== undefined) {
|
|
524
|
+
pickCommand(command.commandLine ?? '/' + command.name + ' ');
|
|
525
|
+
}
|
|
526
|
+
} }) }) }))] }), hasParams && layout.showHints && hintsFit && layout.hintsGapRows > 0 && (_jsx(Box, { flexShrink: 0, height: 1 })), layout.showHints && hintsFit && (_jsx(Box, { flexShrink: 0, flexDirection: "row", gap: 2, alignSelf: "center", width: columns, justifyContent: "flex-end", paddingRight: Math.max(0, Math.floor((columns - cardWidth) / 2)), children: chips.map(({ index, label }) => (_jsx(ActionChip, { label: label, focused: focusIndex === index, onActivate: () => onAction(actions[index]), onHover: () => onFocusChange(index), onHoverLeave: () => {
|
|
527
|
+
if (focusIndex === index)
|
|
528
|
+
onFocusChange(-1);
|
|
529
|
+
} }, actions[index].id))) })), (layout.showTip || pasteNotice !== undefined) && (_jsx(Box, { flexShrink: 0, alignSelf: "center", marginTop: layout.tipGapRows, ...(pasteNotice === undefined && !firstRun
|
|
530
|
+
? { onClick: (event) => { event.stopImmediatePropagation(); rotateTip(); } }
|
|
531
|
+
: {}), children: pasteNotice === undefined ? (_jsxs(_Fragment, { children: [_jsxs(Text, { color: "warning", children: ["\u25CF ", t('launchpad-tip-prefix')] }), _jsx(Text, { color: focusIndex === TIPS_FOCUS ? 'suggestion' : undefined, bold: focusIndex === TIPS_FOCUS, dimColor: focusIndex !== TIPS_FOCUS, children: firstRun ? t('launchpad-first-run') : t(TIP_KEYS[tipIndex]) })] })) : (_jsxs(Text, { color: "warning", children: ["\u25CF ", pasteNotice] })) }))] }), layout.showCorners && (_jsxs(Box, { flexShrink: 0, flexDirection: "column", children: [_jsxs(Box, { flexShrink: 0, flexDirection: "row", justifyContent: "space-between", height: 1, children: [cornerLeft !== '' && onOpenWorkspace !== undefined ? (_jsx(CornerChip, { label: cornerLeft, focused: focusIndex === CWD_CORNER_FOCUS, onActivate: onOpenWorkspace, onHover: () => onFocusChange(CWD_CORNER_FOCUS), onHoverLeave: () => {
|
|
532
|
+
if (focusIndex === CWD_CORNER_FOCUS)
|
|
533
|
+
onFocusChange(-1);
|
|
534
|
+
} })) : (_jsx(Text, { dimColor: true, wrap: "truncate-middle", children: cornerLeft })), _jsx(Text, { dimColor: true, wrap: "truncate-middle", children: tuiPart ?? '' })] }), kernelPart !== undefined && (_jsx(Box, { flexShrink: 0, flexDirection: "row", justifyContent: "flex-end", height: 1, children: _jsx(Text, { dimColor: true, wrap: "truncate-middle", children: kernelPart }) }))] }))] }));
|
|
535
|
+
}
|
|
536
|
+
/** 快捷入口之间的间隔列数(与动作行 `gap={2}` 一致,预算必须同源)。 */
|
|
537
|
+
export const CHIP_GAP = 2;
|
|
538
|
+
/**
|
|
539
|
+
* 一行装得下哪几个快捷入口(第四版:纯文字标签)。
|
|
540
|
+
*
|
|
541
|
+
* @param labels - 全部标签(宽度按 `stringWidth` 算,CJK 是双宽)。
|
|
542
|
+
* @param columns - 内容区列数。
|
|
543
|
+
* @returns 保留下来的 `{ index, label }`;装不下就到此为止(绝不切半个)。
|
|
544
|
+
*/
|
|
545
|
+
export function fitChips(labels, columns) {
|
|
546
|
+
// 每项画成高亮矩形:` 标签 `(背景铺两侧各 1 格内边距)——预算按
|
|
547
|
+
// `标签宽 + 2` 算;行内 gap 2 格由 CHIP_GAP 同步。
|
|
548
|
+
const budget = Math.max(0, columns - 4);
|
|
549
|
+
const out = [];
|
|
550
|
+
let used = 0;
|
|
551
|
+
for (let index = 0; index < labels.length; index++) {
|
|
552
|
+
const label = labels[index];
|
|
553
|
+
const width = stringWidth(label) + 2;
|
|
554
|
+
const next = used === 0 ? width : used + CHIP_GAP + width;
|
|
555
|
+
if (next > budget)
|
|
556
|
+
break;
|
|
557
|
+
used = next;
|
|
558
|
+
out.push({ index, label });
|
|
559
|
+
}
|
|
560
|
+
return out;
|
|
561
|
+
}
|
|
562
|
+
/**
|
|
563
|
+
* 光标左移一个**码位**(不是 UTF-16 单元)。
|
|
564
|
+
*
|
|
565
|
+
* `Array.from` 迭代码位,所以退格/左移不会把一个 emoji 或代理对劈成两半
|
|
566
|
+
* ——`SearchBox` 的窗口化在同一条假设上工作(它的 `windowQuery` 专门有
|
|
567
|
+
* 一段"中途代理对回退到起点"的代码),两边必须一致,否则光标会落在半
|
|
568
|
+
* 个字符里,然后下一次按键就画出一个碎 emoji。
|
|
569
|
+
*
|
|
570
|
+
* @param text - 全文。
|
|
571
|
+
* @param at - 当前 UTF-16 偏移。
|
|
572
|
+
* @returns 左侧一个码位的偏移(已在 0 时返回 0)。
|
|
573
|
+
*/
|
|
574
|
+
export function prevBoundary(text, at) {
|
|
575
|
+
if (at <= 0)
|
|
576
|
+
return 0;
|
|
577
|
+
const before = Array.from(text.slice(0, at));
|
|
578
|
+
before.pop();
|
|
579
|
+
return before.join('').length;
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* 光标右移一个码位。见 {@link prevBoundary}。
|
|
583
|
+
* @param text - 全文。
|
|
584
|
+
* @param at - 当前 UTF-16 偏移。
|
|
585
|
+
* @returns 右侧一个码位的偏移(到末尾时返回末长)。
|
|
586
|
+
*/
|
|
587
|
+
export function nextBoundary(text, at) {
|
|
588
|
+
if (at >= text.length)
|
|
589
|
+
return text.length;
|
|
590
|
+
const rest = Array.from(text.slice(at));
|
|
591
|
+
const first = rest[0] ?? '';
|
|
592
|
+
return at + first.length;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* 当天那款字体:设置项 pin 住就用它,否则按日期轮换。
|
|
596
|
+
* 与 `LogoV2` 同源——两边必须解出同一款,否则宽轴阈值会互相矛盾。
|
|
597
|
+
*
|
|
598
|
+
* @param fontId - 设置项 `dsh-tui.splashFont` 的值。
|
|
599
|
+
* @returns 那款字体。
|
|
600
|
+
*/
|
|
601
|
+
function launchpadFont(fontId) {
|
|
602
|
+
return fontId === undefined ? pickSplashFont() : splashFontById(fontId);
|
|
603
|
+
}
|
|
604
|
+
/** 最小模式这一屏整体不存在(与 `LogoHeader` 同规则):直接进会话。 */
|
|
605
|
+
export function launchpadVisible() {
|
|
606
|
+
return !isMinimalUiMode();
|
|
607
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type Lang } from '../i18n.js';
|
|
3
|
+
import type { ChannelUi as Channel } from '../adapter/channel/ui-policy.js';
|
|
4
|
+
import type { TuiThemeHost } from '../dsh-adapter/themes.js';
|
|
5
|
+
/**
|
|
6
|
+
* Onboarding —— 首次运行的引导向导(`~/.dsh-tui/onboarding.json` 走一次性记账)。
|
|
7
|
+
*
|
|
8
|
+
* 身为一个屏幕,它跟 `SessionSupervisor` 同规矩:所有 hook 先跑完,再由
|
|
9
|
+
* `Chat` 的渲染链提前 return。它**自己读 channel**(`describeCredential` /
|
|
10
|
+
* `balanceInfo` / `listModels` / `listWorkspaces`…),不把十几份数据从 Chat
|
|
11
|
+
* 传进来——那正是 supervisor 的做法。
|
|
12
|
+
*
|
|
13
|
+
* 键盘归它独占(`Chat` 在 `supervisorOpen` 那一层之前让位),所以每一步
|
|
14
|
+
* 的 picker 都能借用同一份 `focusIndex`,不需要各自注册 `useInput`。
|
|
15
|
+
*
|
|
16
|
+
* **凭证永远只报"有没有",不报值**:`describeCredential` 回的是不含秘密的
|
|
17
|
+
* 元数据,界面上也照它的原样画。
|
|
18
|
+
*/
|
|
19
|
+
export declare function Onboarding({ channel, themeHost, onClose, onRunCommand, onApplyLang, initialStep, externalNotice, }: {
|
|
20
|
+
channel: Channel;
|
|
21
|
+
themeHost?: TuiThemeHost;
|
|
22
|
+
/** 跳过 / 完成:把状态交回 Chat(它负责记账与切屏)。 */
|
|
23
|
+
onClose: (outcome: 'skipped' | 'done') => void;
|
|
24
|
+
/** 招式卡的"试一下":交给 Chat 的 `runCommand`(与手敲 `/help` 同一条路)。 */
|
|
25
|
+
onRunCommand: (name: string) => void;
|
|
26
|
+
/**
|
|
27
|
+
* 语言切换:交给 Chat 的 `applyLang`(写 `~/.dsh-tui/lang.json`、通知
|
|
28
|
+
* settings 层、再 `setLang` 热换整棵 UI)。引导不自己写偏好文件——那套
|
|
29
|
+
* 优先级(env > cordis.yml > 持久化)只有 Chat 手里那一份。
|
|
30
|
+
*/
|
|
31
|
+
onApplyLang: (lang: Lang) => void;
|
|
32
|
+
/** 测试缝:直接落在某一步(探针不重复走前几步)。 */
|
|
33
|
+
initialStep?: number;
|
|
34
|
+
/** 测试缝:外部注入一句提示(真机不传)。 */
|
|
35
|
+
externalNotice?: string;
|
|
36
|
+
}): React.ReactNode;
|
|
37
|
+
//# sourceMappingURL=Onboarding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Onboarding.d.ts","sourceRoot":"","sources":["../../../src/screens/Onboarding.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAYzB,OAAO,EAAqB,KAAK,IAAI,EAAE,MAAM,YAAY,CAAA;AAkBzD,OAAO,KAAK,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,iCAAiC,CAAA;AAG3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAqC5D;;;;;;;;;;;;;GAaG;AACH,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,SAAS,EACT,OAAO,EACP,YAAY,EACZ,WAAW,EACX,WAAe,EACf,cAAc,GACf,EAAE;IACD,OAAO,EAAE,OAAO,CAAA;IAChB,SAAS,CAAC,EAAE,YAAY,CAAA;IACxB,oCAAoC;IACpC,OAAO,EAAE,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,KAAK,IAAI,CAAA;IAC9C,0DAA0D;IAC1D,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC;;;;OAIG;IACH,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAAA;IACjC,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,0BAA0B;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,GAAG,KAAK,CAAC,SAAS,CAydlB"}
|