How tikaflow/dsh-model-fix works
dsh-model-fix is a DeepSeek Harness plugin that enriches custom-provider model settings from models.dev and adds compatibility and reasoning-effort conveniences. Its main workflow starts at plugin activation: migrate configuration, load or refresh the catalog, then fill or update eligible provider models. Users configure behavior in the client card, which sends operations through RPC; the plugin also supports forced updates, effort resets, and restoring startup backups. Edges reflect README statements and indexed imports; unsampled implementation details are not inferred beyond those references.
Main entry points: fix.ts Model repair · index.ts Plugin activation · rpc.ts RPC dispatch · index.tsx Client integration
Components 26
Plugin runtime
- Plugin activation
src/index.ts - Config migration
src/migrate.ts - Catalog refresh
src/refresh.ts - Model repair
src/fix.ts - Route compatibility
src/compat.ts - Model matching
src/lookup.ts - RPC dispatch
src/rpc.ts - RPC route
src/rpc-route.ts - Effort reset
src/reset.ts - Backup restore
src/restore.ts - Mutation guard
src/guard.ts - Host task queue
src/host.ts
Model data
- Model catalog
src/catalog.ts - Bundled catalog cache
public/models-cache.json
Settings client
- Settings card
src/client/card.tsx - Client integration
src/client/index.tsx - Settings mapping
src/client/model.ts - Effort behavior
src/client/effort.ts - Client contract
src/client/slot-contract.ts - Client locales
src/client/locales.ts
Shared configuration
- Runtime config
src/config.ts - Snapshot parsing
src/shared/parse.ts - Shared types
src/shared/types.ts
Other components
- DSH host
- Plugin user
- models.dev
Connections 35
- DSH host → Plugin activation: loads plugin
README.md - Plugin activation → Config migration: migrates config
src/index.ts - Plugin activation → Catalog refresh: starts refresh
src/index.ts - Plugin activation → Model repair: starts repair
src/index.ts - Plugin activation → RPC dispatch: registers RPC
src/index.ts - Plugin activation → Backup restore: captures backup
src/index.ts - Plugin activation → Runtime config: sets config source
src/index.ts - Catalog refresh → Model catalog: refreshes catalog
src/refresh.ts - Catalog refresh → Model repair: triggers repair
src/refresh.ts - Model catalog → Bundled catalog cache: reads and writes
src/catalog.ts - models.dev → Model catalog: provides model data
README.md - Model repair → Model catalog: uses catalog
src/fix.ts - Model repair → Route compatibility: plans route changes
src/fix.ts - Model repair → Model matching: matches models
src/fix.ts - Model repair → Runtime config: reads rules
src/fix.ts - RPC dispatch → RPC route: registers routes
src/rpc.ts - RPC dispatch → Model repair: dispatches updates
src/rpc.ts - RPC dispatch → Effort reset: dispatches reset
src/rpc.ts - RPC dispatch → Backup restore: dispatches restore
src/rpc.ts - RPC dispatch → Mutation guard: guards actions
src/rpc.ts - Plugin user → Settings card: configures plugin
README.md - Client integration → Settings card: renders card
src/client/index.tsx - Client integration → Effort behavior: uses effort behavior
src/client/index.tsx - Client integration → Client contract: uses contract
src/client/index.tsx - Client integration → Client locales: loads labels
src/client/index.tsx - Settings card → Settings mapping: uses settings mapping
src/client/card.tsx - Settings card → RPC dispatch: sends operations
src/client/card.tsx - Settings mapping → Snapshot parsing: decodes snapshots
src/client/model.ts - Runtime config → Snapshot parsing: resolves snapshots
src/config.ts - Snapshot parsing → Shared types: validates objects
src/shared/parse.ts - Config migration → Runtime config: resolves config
src/migrate.ts - Config migration → Snapshot parsing: upgrades snapshots
src/migrate.ts - Backup restore → Mutation guard: guards restore
src/restore.ts - Backup restore → Host task queue: queues writes
src/restore.ts - Model repair → Host task queue: queues writes
src/fix.ts