Skip to content

Contributing

Christian Trey Rowell edited this page Dec 3, 2026 · 1 revision

Contributing

English | 简体中文

This page tells you how to build and test the plugin, which rules a change must keep, and how to send it. The full guide is CONTRIBUTING.md in the repository.

Build and test

This section gives the commands that every change has to pass, the same ones CI runs.

git clone https://github.com/calisweetleaf/dsh-siwc-native.git
cd dsh-siwc-native
npm ci
npm run typecheck     # core, server, and client projects
npm test              # build, then vitest
npm pack --dry-run    # confirm the package contents

CI (.github/workflows/ci.yml) runs exactly these four steps on Node 22 and 24 for every pull request and every push to main. lib/ is generated from src/ by the build; edit src/ and rebuild, never lib/ by hand.

To try a change inside DSH, pack it and install the tarball into a profile as described in Install.

Rules a change must keep

This section lists the boundaries that are not open to negotiation in a pull request.

  • SIWC only. No Codex credentials, no Codex endpoints, no Codex client id, no token pooling or relays. See Route and compliance.
  • Plan usage is a grant. Model calls require the chatgpt.tokens.use.direct scope; sign-in alone enables nothing.
  • Omission is the contract. Do not add fields the plan route refuses. Golden fixtures pin the request bytes and stream chunks; a change to what the model sees must update the goldens in the same change and say why.
  • The engine stays portable. packages/siwc-core has no host imports and no node:* imports; tests/architecture.test.ts enforces it.
  • No secrets anywhere. Tokens, ID tokens, raw catalog rows, base_instructions, and private home paths stay out of logs, CLI output, remote-call projections, tests, documentation, and commits. Never run a real sign-in or revocation as a test.
  • Tests only grow. No test is deleted or weakened to make a change pass. No test uses a real endpoint or account.

Languages

This section covers the English and Simplified Chinese parity that the tests enforce.

User-facing text lives in six dictionary files: packages/siwc-core/src/locales/errors.ts, src/locales/cli.ts, src/locales/pages.ts, src/client/locales.ts, locale/en.json, and locale/zh.json. tests/i18n.test.ts requires identical keys and placeholder names in both languages, CJK text in the Chinese strings, and the glossary choices 你 and 账户 (never 您 or 帐户). The README pair is checked for matching sections and code fences.

Translation glossary

This section is the term list and style rules every Simplified Chinese text in the project follows: the card, the CLI, error messages, the README, and this wiki.

Chinese is a first-class locale, not a late translation pass: a Chinese-speaking DSH user should be able to install, sign in, pick a model, and recover from errors without reading English. The terms match the existing card copy.

English 简体中文 Rule
Sign in with ChatGPT (product name) Sign in with ChatGPT Keep as a proper name in prose
Sign in with ChatGPT (button) 使用 ChatGPT 登录 Action label
ChatGPT, OpenAI, DeepSeek Harness, Cordis, SIWC, OAuth unchanged Brand and protocol names are never translated
plan / plan usage 套餐 / 套餐用量
account 账户 Never 帐户
connected / not connected 已连接 / 未连接
disconnect 断开连接
reasoning effort 推理力度
provider route 提供方路由
access token 访问令牌
Manage usage 管理用量
model picker 模型选择器
sign out 退出登录 CLI and page prose; the card button stays 断开连接
consent screen 授权确认页
per-app cap 单应用上限
loopback (listener) 本地回环(监听器)
refresh token / ID token 刷新令牌 / ID 令牌
provider (upstream) 提供方
Usage (ChatGPT settings page) “用量”(Usage) Keep the English page name in parentheses on first mention

The wiki adds these terms, taken from the card copy where the card has them:

English 简体中文
model catalog / Refresh Catalog 模型目录 / 刷新目录
service tier / Fast 服务层级 / 快速
context window / context budget 上下文窗口 / 上下文预算
prompt cache / cache hit rate / cold cache 提示缓存 / 缓存命中率 / 冷缓存
revoke 撤销
scope (OAuth) 作用域
settings card 设置卡片
clamp (a value) 钳制

Style rules:

  • Use full-width punctuation in Chinese sentences (,。:;()“”——) and half-width punctuation inside code, paths, commands, and URLs.
  • Put one space between Chinese and Latin words or numbers (你的 ChatGPT Plus/Pro 套餐), and no space next to full-width punctuation.
  • Address the reader as 你, never 您.
  • Placeholders are {name} and identical in both languages. Error codes, JSON keys, model slugs, commands, and URLs are never translated.
  • Locale ids are zh and en, registered together, with en as the fallback. Any HTML the plugin serves sets <html lang="zh-CN"> when zh is active. Traditional-script requests (zh-TW, zh-HK, zh-MO, zh-Hant) resolve to the Simplified copy, because no Traditional dictionary exists yet.

Sending a change

This section explains how to submit work.

Open a pull request against calisweetleaf/dsh-siwc-native with the behavior change, the test evidence, and nothing unrelated. Contributions are licensed under MIT. Report security problems privately as described in SECURITY.md, not in a public issue.

For questions and ideas, use the repository's Discussions.

Clone this wiki locally