Introduction¶
The philosophy behind DSH (DeepSeek Harness) is “everything is a plugin.” When applied to the web GUI, a problem quickly arises: both the Chat mode plugin and the Code mode plugin want to occupy the session bar. Who provides that “mode switch”? In the sidebar, a row of sessions looks the same—how do you know which belong to which mode and which one you are currently viewing?
If the registry were shipped with a specific mode, other modes would have to depend on that mode’s entire package, inverting the layering relationship. The omdsh-basemode introduced below exists to extract this “seat” from the various “stances.”
What is it¶
@omdsh-plugins/omdsh-basemode (displayed name in the Plugin Hub: Base Mode / 基础模式) is the session mode system for the DeepSeek Harness web GUI. It is maintained by omdsh-plugins, is under the MIT license, is currently version 0.2.5, and is categorized as “system” in the Plugin Hub (derived from dsh.plughub.category in package.json).
One-sentence positioning: It is the registry where each mode plugin registers its segment, the switcher that renders these segments, and the dots used to color-code sidebar sessions by mode.
It is important to emphasize: it does not invent any modes itself. Chat comes from omdsh-chatmode, and Code comes from omdsh-codemode. Its only contribution to stances is “Work”—the session bar of the harness itself, registered as a baseline to give the switcher somewhere to revert to.
Core Features¶
Registry and Switcher¶
- The
sessionModesservice is provided viactx.provideand serves as the entry point for each mode plugin to register a segment. - The mode switcher is an item within
shell.overlay(the full-frame overlay of ui-layout), centered over the session bar, and automatically hides when no one is using it. - The registry forces exactly one segment to be active at any given time: marking one as active clears the others, and contributors know they have lost the session bar when their own entry turns false.
Baseline Stance Work¶
- Registered via
registerBaseline, it is the harness’s own session bar, using the same name, copy, color, and icon asomdsh-chatmode. - Any registration declaring
fallbackor occupying its ID will cause it to yield; after that plugin is uninstalled, the baseline is restored. - Its active flag is a derived value: it holds the session bar exactly when it is in place and no contributor has taken it over.
- The switcher is not rendered when the baseline exists alone—there is nothing to switch between for a single segment. Therefore, a profile with only the mode system and no mode plugins displays nothing.
Sidebar Markers¶
- Mode color dots are drawn on each row of the sidebar via
row-marks.ts: drawn directly onto existing rows, driven by the registry’stoneandowns. - Sidebar highlighting is drawn on the session currently displayed in the session bar, only written when the session bar and the selected item differ.
Where New Session Goes¶
- Overrides
workspaces.startSession: A New Session request is first handed to the active segment holding the session bar. - When no one takes it over, it announces and creates a truly new session, rather than reusing the workspace’s old empty session.
sessionModes.columnreports what is actually displayed in the session bar: if the active segment declares a scope, use it; otherwise, use the selected session.
Boundary with the Harness Itself¶
- Does not modify the harness itself: registered slots are public seats, overrides are prototype methods shadowed by own properties, and both are returned upon rollback.
- Does not register a settings namespace: the segment registry has no configurable items, and the Plugin Hub card has no form. This is intentional, not an oversight.
Why Split into a Separate Package¶
It used to belong to the Chat mode and was later split into a separate package to eliminate layering inversion. All mode plugins need the registry; if the registry were built into one mode, other modes would be forced to depend on that mode’s entire package. After the split, dependencies are honest: each mode plugin depends on this package, and this package depends on no mode.
Installation and Enabling¶
There is no original official installation command in the materials verified this time, so this article does not fabricate one. Please refer to the repository README and directory page for installation methods:
- GitHub repository: https://github.com/omdsh-plugins/omdsh-basemode
- Directory page: https://www.skillhub.cn/plugins/omdsh-plugins/omdsh-basemode
Environment information confirmed from package.json: Node ^22.19.0 || >=24.0.0, package manager pnpm@11.7.0; client-side platform is web, dependencies injected are @deepseek-ai/dsh-client-ui-layout, @deepseek-ai/dsh-client-locale, @deepseek-ai/dsh-api-session-controller, @deepseek-ai/dsh-api-workspace-controller.
A note: The README and package.json referenced in this article are truncated near the “The contract” section, and any subsequent installation and configuration sections that may exist have not been verified. Please refer to the repository.
How to Integrate as a Mode Plugin¶
This section is for readers who want to write mode plugins. First, acquire the service, then register a segment:
// Do not write in top-level inject — see spec item 9
ctx.inject(['sessionModes'], (mctx) => {
const modes = mctx.get('sessionModes') as SessionModes | undefined
if (modes === undefined) return
mctx.effect(() => modes.register({
id: 'code',
order: 20,
label: t('mode.code'),
hint: t('mode.code.hint'),
tone: 'var(--dsw-alias-state-error-primary)',
icon: createElement(IconCodeOutline16, { size: 14 }),
owns: isCodeSessionId,
available: true,
enter: () => { /* Navigation to execute after pressing */ },
newSession: (workspaceId) => { /* Return true if this mode has started a new session */ },
}))
})
After the above steps, the segment enters the registry. There are four contracts worth remembering one by one:
-
Types should only be imported with
type.SessionModesis imported from@omdsh-plugins/omdsh-basemode/clientusingimport type; it is never imported as a value. Cross-plugin VALUE imports either inline the runtime of this package into your bundle or ask the shell’s frozen module table for a specifier it can’t answer, causing the client bundle purity gate to fail the build. Therefore, the service above is resolved using the string'sessionModes', not theSESSION_MODESconstant exported by this package—the service name is the online name shared with the runtime, not the symbol shared with the package. -
Exactly one segment is active at a time. This is enforced by the registry, not relying on contributor self-discipline: marking yourself as active clears the others; seeing your entry turn false means you have lost the session bar.
-
Text comes pre-localized. The switcher renders
label,hint, andunavailableHintas-is, owning only two words itself (switch.aria, and the fallback when a mode is unavailable and the reason is not explained). Update the segment on locale/change to keep text localized. -
enteris a navigation, not a state write. After pressing, the segment makes the world real—opening a session, starting one, or taking over the session bar—the active flag is reported by itself. Nothing remembers the mode across a reload.
Semantics of the two fields: owns answers “Is this session mine?”; newSession returns true to indicate that the mode has started a new session.
Suitable Scenarios and Notes¶
Who is it for:
- Plugin authors wanting to contribute session modes to the DSH web GUI; this is the mandatory entry point for registration.
- Profile users who want to freely combine modes. Note that this package does not invent modes; installing it alone will not result in any mode buttons appearing.
Notes:
- The segment registry has no configurable items; do not look for a form in the Plugin Hub card.
- Plugins run with the permissions of the current DSH process; please check the source code and license before installing (this package is MIT).
- Star count and official installation command are missing from this verification, and the README is also truncated. Please refer to the repository for the latest contract information.
Conclusion¶
omdsh-basemode does things very restrainedly: a public registration seat, a centered and auto-hiding switcher, sidebar dots and highlighting, plus a rule for diverting New Session requests. The modes themselves are not its business—Chat and Code come from their own plugins, and Work is the harness’s original session bar. When you need to add session modes to the DSH web GUI, register them here.
- GitHub repository: https://github.com/omdsh-plugins/omdsh-basemode
- Community directory page: https://www.skillhub.cn/plugins/omdsh-plugins/omdsh-basemode (Independent site, no official affiliation with DeepSeek / 幻方)