# AGENTS.md — working in this repository ## What this repo is `dsh-model-account-login` is a Cordis composition plugin for DeepSeek Harness (DSH). It ships **built artifacts only** for now: `lib/*.js` is compiled output, `lib/*.d.ts` is the authoritative API surface. Treat the `.d.ts` files as the contract when reasoning about behavior. ## Architecture in one paragraph Two plugin halves share `lib/protocol.js`: - **Host** (`lib/host.js`): a Cordis plugin with `inject: [authorization, credentials, settings, connection]`. It exposes a package-private JSON-RPC channel (`/model-account-login`) that the Web client calls. Login attempts live in `AttemptRegistry` (`lib/state.js`). - **Web Client** (`lib/client.js`): registered via `package.json → dsh.client` (platform `web`), renders a `settings.section` panel. No bundler config in-repo; the DSH Web module graph loads it. ## Rules for contributors / coding agents 1. **Do not edit `lib/*.js` blindly** — it is compiled output. If you change behavior, keep `lib/*.d.ts` and `README.md` in sync in the same commit. 2. **Never commit credentials or login state.** Everything under the `llm-pi-ai` credential scope stays on the user's machine. 3. All Host↔Client traffic must stay lossless JSON (`RpcResult`); no live Cordis objects may cross the channel. 4. Every runtime side effect (listeners, slots, timers) must be reversible — register through the plugin context so stop/update disposes it. 5. If you reconstruct the TypeScript sources, put them under `src/`, restore the `scripts`/`devDependencies` build pipeline in `package.json`, and open a PR. ## Validation There is no test suite in this dist-only snapshot. Minimum smoke check before a release bump: mount the plugin in a local DSH host composition via `cordis.patch.yml`, open the Web settings page, and run one provider login flow end-to-end (authorize → sign-out → re-login).