# corrinehu/dsh-workbuddy-connect architecture

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

- Interactive diagram: https://gitdiagram.com/corrinehu/dsh-workbuddy-connect
- Repository: https://github.com/corrinehu/dsh-workbuddy-connect

## Overview

DSH WorkBuddy Connect registers separate domestic and international model providers that reuse each desktop app’s login, fetch its model catalog, and route chat requests to WorkBuddy. Users can inspect account and credit status, control model visibility, and optionally detect reasoning levels. The README also documents image support, promotions, enterprise credits, and update notices. The map follows relationships visible in the provided excerpts, SOURCE INDEX references, and README; some runtime wiring and unsampled implementations are not shown.

Main entry points: [`src/index.ts`](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/index.ts) (Provider registration), [`src/upstream.ts`](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/upstream.ts) (Upstream client), [`src/client/index.tsx`](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client/index.tsx) (Browser entry), [`src/probe-service.ts`](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/probe-service.ts) (Probe orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Provider runtime"]
  node_provider["Provider registration<br/>[index.ts]"]
  node_adapter["Model adapter<br/>[adapter.ts]"]
  node_shim["Chat shim<br/>[shim.ts]"]
  node_loopback["Local control routes<br/>[loopback.ts]"]
  node_status["Status service<br/>[web-status.ts]"]
  node_paths["Status contracts<br/>[status-paths.ts]"]
  node_updateroute["Update route<br/>[update-route.ts]"]
  node_heartbeat["Host heartbeat<br/>[host-heartbeat.ts]"]
end

subgraph group_upstream["WorkBuddy integration"]
  node_credentials[("Credential store<br/>[auth.ts]")]
  node_identity["Client identity<br/>[client-identity.ts]"]
  node_appversion["App version<br/>[app-version.ts]"]
  node_upstreamclient["Upstream client<br/>[upstream.ts]"]
end

subgraph group_features["Model features"]
  node_catalog["Model catalog<br/>[catalog.ts]"]
  node_catalogstore[("Saved catalog<br/>[catalog-store.ts]")]
  node_visibility[("Model visibility")]
  node_probe["Reasoning detection<br/>[probe.ts]"]
  node_probeservice["Probe orchestration<br/>[probe-service.ts]"]
  node_probestore[("Probe history<br/>[probe-store.ts]")]
  node_update["Update metadata<br/>[update.ts]"]
end

subgraph group_interface["User interface"]
  node_client["Settings interface"]
  node_cliententry["Browser entry<br/>[index.tsx]"]
  node_probecontrol["Probe controls"]
  node_configpage["Configuration page"]
  node_updatestore["Update state<br/>[update-store.ts]"]
  node_updatenotice["Update notice"]
  node_locales["Localized copy<br/>[locales.ts]"]
end

node_user(("DSH user"))
node_harness["DSH host"]
node_workbuddy["WorkBuddy services"]

node_user -->|"uses"| node_harness
node_harness -->|"loads plugin"| node_provider
node_provider -->|"creates"| node_credentials
node_provider -->|"creates"| node_upstreamclient
node_provider -->|"registers provider"| node_adapter
node_adapter -->|"reads credentials"| node_credentials
node_adapter -->|"sends chat"| node_upstreamclient
node_provider -->|"loads models"| node_catalog
node_catalog -->|"uses promotions"| node_upstreamclient
node_provider -->|"persists catalog"| node_catalogstore
node_provider -->|"loads preferences"| node_visibility
node_provider -->|"creates"| node_probeservice
node_probeservice -->|"probes model"| node_probe
node_probeservice -->|"records results"| node_probestore
node_probeservice -->|"checks model"| node_catalog
node_upstreamclient -->|"calls APIs"| node_workbuddy
node_upstreamclient -->|"resolves identity"| node_identity
node_identity -->|"reads version"| node_appversion
node_provider -->|"registers chat shim"| node_shim
node_shim -->|"authenticates"| node_credentials
node_shim -->|"sends requests"| node_upstreamclient
node_provider -->|"serves status"| node_status
node_status -->|"reads account"| node_credentials
node_status -->|"fetches credits"| node_upstreamclient
node_provider -->|"creates routes"| node_loopback
node_loopback -->|"uses contracts"| node_paths
node_cliententry -->|"registers cards"| node_client
node_cliententry -->|"registers page"| node_configpage
node_cliententry -->|"registers controls"| node_probecontrol
node_client -->|"reads status"| node_paths
node_probecontrol -->|"uses probe route"| node_paths
node_provider -->|"registers update route"| node_updateroute
node_updateroute -->|"queries metadata"| node_update
node_cliententry -->|"creates store"| node_updatestore
node_updatestore -->|"fetches updates"| node_update
node_cliententry -->|"renders notice"| node_updatenotice
node_updatenotice -->|"uses state"| node_updatestore
node_cliententry -->|"registers copy"| node_locales
node_provider -->|"writes heartbeat"| node_heartbeat

click node_provider "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/index.ts"
click node_adapter "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/adapter.ts"
click node_credentials "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/auth.ts"
click node_identity "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client-identity.ts"
click node_appversion "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/app-version.ts"
click node_upstreamclient "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/upstream.ts"
click node_catalog "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/catalog.ts"
click node_catalogstore "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/catalog-store.ts"
click node_visibility "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/visibility-store.ts"
click node_probe "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/probe.ts"
click node_probeservice "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/probe-service.ts"
click node_probestore "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/probe-store.ts"
click node_shim "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/shim.ts"
click node_loopback "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/loopback.ts"
click node_status "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/web-status.ts"
click node_paths "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/status-paths.ts"
click node_client "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client/WorkBuddyPluginCard.tsx"
click node_cliententry "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client/index.tsx"
click node_probecontrol "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client/WorkBuddyProbeControl.tsx"
click node_configpage "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client/WorkBuddyConfigPage.tsx"
click node_update "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/update.ts"
click node_updateroute "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/update-route.ts"
click node_updatestore "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client/update-store.ts"
click node_updatenotice "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client/WorkBuddyUpdateNotice.tsx"
click node_locales "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client/locales.ts"
click node_heartbeat "https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/host-heartbeat.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_provider,node_adapter,node_shim,node_loopback,node_status,node_paths,node_updateroute,node_heartbeat,node_user toneBlue
class node_credentials,node_identity,node_appversion,node_upstreamclient toneAmber
class node_catalog,node_catalogstore,node_visibility,node_probe,node_probeservice,node_probestore,node_update toneMint
class node_client,node_cliententry,node_probecontrol,node_configpage,node_updatestore,node_updatenotice,node_locales toneRose
class node_harness,node_workbuddy toneIndigo
```

## Components

### Provider runtime

- [Provider registration](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/index.ts): `src/index.ts`
- [Model adapter](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/adapter.ts): `src/adapter.ts`
- [Chat shim](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/shim.ts): `src/shim.ts`
- [Local control routes](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/loopback.ts): `src/loopback.ts`
- [Status service](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/web-status.ts): `src/web-status.ts`
- [Status contracts](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/status-paths.ts): `src/status-paths.ts`
- [Update route](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/update-route.ts): `src/update-route.ts`
- [Host heartbeat](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/host-heartbeat.ts): `src/host-heartbeat.ts`

### WorkBuddy integration

- [Credential store](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/auth.ts): `src/auth.ts`
- [Client identity](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client-identity.ts): `src/client-identity.ts`
- [App version](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/app-version.ts): `src/app-version.ts`
- [Upstream client](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/upstream.ts): `src/upstream.ts`

### Model features

- [Model catalog](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/catalog.ts): `src/catalog.ts`
- [Saved catalog](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/catalog-store.ts): `src/catalog-store.ts`
- [Model visibility](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/visibility-store.ts): `src/visibility-store.ts`
- [Reasoning detection](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/probe.ts): `src/probe.ts`
- [Probe orchestration](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/probe-service.ts): `src/probe-service.ts`
- [Probe history](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/probe-store.ts): `src/probe-store.ts`
- [Update metadata](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/update.ts): `src/update.ts`

### User interface

- [Settings interface](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client/WorkBuddyPluginCard.tsx): `src/client/WorkBuddyPluginCard.tsx`
- [Browser entry](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client/index.tsx): `src/client/index.tsx`
- [Probe controls](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client/WorkBuddyProbeControl.tsx): `src/client/WorkBuddyProbeControl.tsx`
- [Configuration page](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client/WorkBuddyConfigPage.tsx): `src/client/WorkBuddyConfigPage.tsx`
- [Update state](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client/update-store.ts): `src/client/update-store.ts`
- [Update notice](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client/WorkBuddyUpdateNotice.tsx): `src/client/WorkBuddyUpdateNotice.tsx`
- [Localized copy](https://github.com/corrinehu/dsh-workbuddy-connect/blob/main/src/client/locales.ts): `src/client/locales.ts`

### Other components

- **DSH user**
- **DSH host**
- **WorkBuddy services**

## Connections

- DSH user → DSH host: uses (evidence: `README.md`)
- DSH host → Provider registration: loads plugin (evidence: `src/index.ts`)
- Provider registration → Credential store: creates (evidence: `src/index.ts`)
- Provider registration → Upstream client: creates (evidence: `src/index.ts`)
- Provider registration → Model adapter: registers provider (evidence: `src/index.ts`)
- Model adapter → Credential store: reads credentials (evidence: `src/adapter.ts`)
- Model adapter → Upstream client: sends chat (evidence: `src/adapter.ts`)
- Provider registration → Model catalog: loads models (evidence: `src/index.ts`)
- Model catalog → Upstream client: uses promotions (evidence: `src/catalog.ts`)
- Provider registration → Saved catalog: persists catalog (evidence: `src/index.ts`)
- Provider registration → Model visibility: loads preferences (evidence: `src/index.ts`)
- Provider registration → Probe orchestration: creates (evidence: `src/index.ts`)
- Probe orchestration → Reasoning detection: probes model (evidence: `src/probe-service.ts`)
- Probe orchestration → Probe history: records results (evidence: `src/probe-service.ts`)
- Probe orchestration → Model catalog: checks model (evidence: `src/probe-service.ts`)
- Upstream client → WorkBuddy services: calls APIs (evidence: `README.md`)
- Upstream client → Client identity: resolves identity (evidence: `src/upstream.ts`)
- Client identity → App version: reads version (evidence: `src/client-identity.ts`)
- Provider registration → Chat shim: registers chat shim (evidence: `src/index.ts`)
- Chat shim → Credential store: authenticates (evidence: `src/shim.ts`)
- Chat shim → Upstream client: sends requests (evidence: `src/shim.ts`)
- Provider registration → Status service: serves status (evidence: `src/index.ts`)
- Status service → Credential store: reads account (evidence: `src/web-status.ts`)
- Status service → Upstream client: fetches credits (evidence: `src/web-status.ts`)
- Provider registration → Local control routes: creates routes (evidence: `src/index.ts`)
- Local control routes → Status contracts: uses contracts (evidence: `src/probe-route.ts`)
- Browser entry → Settings interface: registers cards (evidence: `src/client/index.tsx`)
- Browser entry → Configuration page: registers page (evidence: `src/client/index.tsx`)
- Browser entry → Probe controls: registers controls (evidence: `src/client/index.tsx`)
- Settings interface → Status contracts: reads status (evidence: `src/client/WorkBuddyPluginCard.tsx`)
- Probe controls → Status contracts: uses probe route (evidence: `src/client/WorkBuddyProbeControl.tsx`)
- Provider registration → Update route: registers update route (evidence: `src/index.ts`)
- Update route → Update metadata: queries metadata (evidence: `src/update-route.ts`)
- Browser entry → Update state: creates store (evidence: `src/client/index.tsx`)
- Update state → Update metadata: fetches updates (evidence: `src/client/update-store.ts`)
- Browser entry → Update notice: renders notice (evidence: `src/client/index.tsx`)
- Update notice → Update state: uses state (evidence: `src/client/WorkBuddyUpdateNotice.tsx`)
- Browser entry → Localized copy: registers copy (evidence: `src/client/index.tsx`)
- Provider registration → Host heartbeat: writes heartbeat (evidence: `src/index.ts`)
