# dsh-ssh-tui — SSH-friendly interactive terminal mode over dsh-base.
#
# DSH STORE requires an additive Bundle Patch: unique plugin-owned entry IDs
# only, no @deepseek-ai/* names, and no disable/replace of official rows.
# Persona, HMR, tools-mode, DeepSeek thinking, and subagent defaults stay with
# the profile / dsh-base composition; this patch only mounts the TUI.

- insert:
    - id: ssh-tui-startup
      name: 'dsh-ssh-tui/startup'

    # The TUI renders exactly the agent the agent-loop row bound, so it reads
    # the same startup-owned identity rather than restating one.
    - id: ssh-tui
      name: 'dsh-ssh-tui'
      inject: [sshTuiStartup]
      config:
        sessionId: !!js ctx.sshTuiStartup.sessionId
        resume: !!js ctx.sshTuiStartup.resume
        resumePicker: !!js ctx.sshTuiStartup.resumePicker
        provider: !!js ctx.sshTuiStartup.provider
        model: !!js ctx.sshTuiStartup.model
        showReasoning: true
        maxToolOutputLines: 6
        color: !!js ctx.sshTuiStartup.noColor !== true
        # Jump-host SSH: coalesce token ticks into one stdout write per frame.
        paintIntervalMs: !!js Number.parseInt(process.env.DSH_TUI_PAINT_MS ?? '160', 10) || 160

    # The TUI's two auxiliary settings namespaces.
    #
    # From 0.1.7 a settings form is projected out of a loader entry's own Config
    # schema, and a write may only address an entry id — so each namespace needs
    # a row. The row ids ARE the namespaces, and they match the sections the
    # 0.1.5 line registered and the host imports a pre-0.1.7 `settings.yaml`
    # section into, so `/model` routes and a `/submodel` pin survive an upgrade.
    # On 0.1.5 these rows only carry their schema: the plugin registers both
    # sections itself.
    - id: ssh-tui-routes
      name: 'dsh-ssh-tui/settings-routes'

    - id: ssh-tui-subagent
      name: 'dsh-ssh-tui/settings-subagent'
