# witherwithwinter/dsh-codinput architecture

> Architecture diagram of the GitHub repository witherwithwinter/dsh-codinput, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/witherwithwinter/dsh-codinput
- Repository: https://github.com/witherwithwinter/dsh-codinput

## Overview

DSH-Codinput is a DeepSeek Harness web plugin that replaces the chat composer with a CodeMirror-based input surface. The principal workflow is user input through the normal, floating, or sidebar-mounted surface, with slash/mention menus and attachments, then submission through the host’s conversation machinery. The graph also covers documented model/permission controls, usage statistics, and settings. Some feature links rely on the README because their implementations were not sampled; uncertain internal wiring is omitted.

Main entry points: [`src/client/components/CodinputSurface.tsx`](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/components/CodinputSurface.tsx) (Composer surface), [`src/client/index.tsx`](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/index.tsx) (Plugin entry), [`src/client/settings.tsx`](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/settings.tsx) (Settings section), [`src/client/components/CodinputBar.tsx`](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/components/CodinputBar.tsx) (Input modes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Host integration"]
  node_entry["Plugin entry<br/>[index.tsx]"]
  node_services["Host services<br/>[services.ts]"]
  node_composer_slot["Composer slot<br/>[CodinputBar.tsx]"]
  node_sidebar["Sidebar input<br/>[sideinput.ts]"]
  node_settings["Settings section<br/>[settings.tsx]"]
end

subgraph group_composer["Composer experience"]
  node_bar["Input modes<br/>[CodinputBar.tsx]"]
  node_surface["Composer surface"]
  node_editor["Editor<br/>[cm.ts]"]
  node_preview["Markdown preview"]
end

subgraph group_controls["Input controls"]
  node_attachments["Attachments<br/>[attachments.ts]"]
  node_triggers["Slash and mention<br/>[triggers.ts]"]
  node_slash_menu["Candidate menu<br/>[SlashMenu.tsx]"]
  node_model["Model selection<br/>[modeldir.ts]"]
  node_permission["Permission presets<br/>[permission.ts]"]
  node_command["Codinput command<br/>[command.ts]"]
end

subgraph group_state["Preferences and insight"]
  node_prefs["Preferences<br/>[prefs.ts]"]
  node_stats["Usage statistics<br/>[stats.ts]"]
  node_stats_ui["Stats display<br/>[StatsRow.tsx]"]
  node_i18n["Host localization<br/>[i18n.ts]"]
end

node_user(("User"))
node_host["DSH host"]

node_user -->|"activates plugin"| node_entry
node_entry -->|"installs services"| node_services
node_entry -->|"registers composer"| node_composer_slot
node_entry -->|"registers settings"| node_settings
node_entry -->|"registers command"| node_command
node_entry -->|"injects host APIs"| node_host
node_host -->|"provides services"| node_services
node_host -->|"provides slot"| node_composer_slot
node_host -->|"hosts sidebar tab"| node_sidebar
node_user -->|"opens Codinput tab"| node_sidebar
node_sidebar -->|"signals carried input"| node_entry
node_composer_slot -->|"mounts input modes"| node_bar
node_bar -->|"renders surface"| node_surface
node_surface -->|"edits draft"| node_editor
node_surface -->|"renders preview"| node_preview
node_surface -->|"manages attachments"| node_attachments
node_surface -->|"tracks triggers"| node_triggers
node_surface -->|"selects model"| node_model
node_surface -->|"selects permission"| node_permission
node_triggers -->|"supplies candidates"| node_slash_menu
node_slash_menu -->|"uses host menu chain"| node_host
node_surface -->|"submits conversation"| node_host
node_command -->|"dispatches command"| node_host
node_settings -->|"updates preferences"| node_prefs
node_bar -->|"reads mode"| node_prefs
node_surface -->|"renders usage"| node_stats_ui
node_stats_ui -->|"formats statistics"| node_stats
node_stats -->|"reads session data"| node_host
node_services -->|"installs locale"| node_i18n
node_surface -->|"uses translations"| node_i18n
node_settings -->|"uses translations"| node_i18n

click node_entry "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/index.tsx"
click node_services "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/services.ts"
click node_composer_slot "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/components/CodinputBar.tsx"
click node_sidebar "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/sideinput.ts"
click node_settings "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/settings.tsx"
click node_bar "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/components/CodinputBar.tsx"
click node_surface "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/components/CodinputSurface.tsx"
click node_editor "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/cm.ts"
click node_preview "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/components/CodinputSurface.tsx"
click node_attachments "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/attachments.ts"
click node_triggers "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/triggers.ts"
click node_slash_menu "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/components/SlashMenu.tsx"
click node_model "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/modeldir.ts"
click node_permission "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/permission.ts"
click node_command "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/command.ts"
click node_prefs "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/prefs.ts"
click node_stats "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/stats.ts"
click node_stats_ui "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/components/StatsRow.tsx"
click node_i18n "https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/i18n.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_entry,node_services,node_composer_slot,node_sidebar,node_settings,node_user toneBlue
class node_bar,node_surface,node_editor,node_preview toneAmber
class node_attachments,node_triggers,node_slash_menu,node_model,node_permission,node_command toneMint
class node_prefs,node_stats,node_stats_ui,node_i18n toneRose
class node_host toneIndigo
```

## Components

### Host integration

- [Plugin entry](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/index.tsx): `src/client/index.tsx`
- [Host services](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/services.ts): `src/client/services.ts`
- [Composer slot](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/components/CodinputBar.tsx): `src/client/components/CodinputBar.tsx`
- [Sidebar input](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/sideinput.ts): `src/client/sideinput.ts`
- [Settings section](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/settings.tsx): `src/client/settings.tsx`

### Composer experience

- [Input modes](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/components/CodinputBar.tsx): `src/client/components/CodinputBar.tsx`
- [Composer surface](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/components/CodinputSurface.tsx): `src/client/components/CodinputSurface.tsx`
- [Editor](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/cm.ts): `src/client/cm.ts`
- [Markdown preview](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/components/CodinputSurface.tsx): `src/client/components/CodinputSurface.tsx`

### Input controls

- [Attachments](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/attachments.ts): `src/client/attachments.ts`
- [Slash and mention](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/triggers.ts): `src/client/triggers.ts`
- [Candidate menu](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/components/SlashMenu.tsx): `src/client/components/SlashMenu.tsx`
- [Model selection](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/modeldir.ts): `src/client/modeldir.ts`
- [Permission presets](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/permission.ts): `src/client/permission.ts`
- [Codinput command](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/command.ts): `src/client/command.ts`

### Preferences and insight

- [Preferences](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/prefs.ts): `src/client/prefs.ts`
- [Usage statistics](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/stats.ts): `src/client/stats.ts`
- [Stats display](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/components/StatsRow.tsx): `src/client/components/StatsRow.tsx`
- [Host localization](https://github.com/witherwithwinter/dsh-codinput/blob/main/src/client/i18n.ts): `src/client/i18n.ts`

### Other components

- **User**
- **DSH host**

## Connections

- User → Plugin entry: activates plugin
- Plugin entry → Host services: installs services
- Plugin entry → Composer slot: registers composer
- Plugin entry → Settings section: registers settings
- Plugin entry → Codinput command: registers command
- Plugin entry → DSH host: injects host APIs
- DSH host → Host services: provides services
- DSH host → Composer slot: provides slot
- DSH host → Sidebar input: hosts sidebar tab
- User → Sidebar input: opens Codinput tab
- Sidebar input → Plugin entry: signals carried input
- Composer slot → Input modes: mounts input modes
- Input modes → Composer surface: renders surface
- Composer surface → Editor: edits draft
- Composer surface → Markdown preview: renders preview
- Composer surface → Attachments: manages attachments
- Composer surface → Slash and mention: tracks triggers
- Composer surface → Model selection: selects model
- Composer surface → Permission presets: selects permission
- Slash and mention → Candidate menu: supplies candidates
- Candidate menu → DSH host: uses host menu chain
- Composer surface → DSH host: submits conversation
- Codinput command → DSH host: dispatches command
- Settings section → Preferences: updates preferences
- Input modes → Preferences: reads mode
- Composer surface → Stats display: renders usage
- Stats display → Usage statistics: formats statistics
- Usage statistics → DSH host: reads session data
- Host services → Host localization: installs locale
- Composer surface → Host localization: uses translations
- Settings section → Host localization: uses translations
