dsh-coding-subscription-oauth 0.5.8 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. package/CHANGELOG.md +211 -196
  2. package/CONTRIBUTING.md +120 -120
  3. package/INSTALL.md +240 -209
  4. package/LICENSE +19 -19
  5. package/NOTICE +11 -11
  6. package/README.de.md +298 -293
  7. package/README.es.md +299 -294
  8. package/README.fr.md +299 -294
  9. package/README.ja.md +299 -294
  10. package/README.ko.md +299 -294
  11. package/README.md +313 -306
  12. package/README.pt-BR.md +299 -294
  13. package/README.ru.md +299 -294
  14. package/README.zh-CN.md +311 -304
  15. package/compatibility/dsh-bom.json +43 -0
  16. package/cordis.patch.yml +13 -13
  17. package/docs/00-project-rules.md +195 -195
  18. package/docs/02-architecture.md +134 -129
  19. package/docs/02-architecture.zh-CN.md +134 -129
  20. package/lib/auth-routes.d.ts +8 -15
  21. package/lib/auth-routes.d.ts.map +1 -1
  22. package/lib/bin.js +746 -1402
  23. package/lib/bin.js.map +4 -4
  24. package/lib/capability-routes.d.ts +3 -3
  25. package/lib/capability-routes.d.ts.map +1 -1
  26. package/lib/capability-settings.d.ts +5 -4
  27. package/lib/capability-settings.d.ts.map +1 -1
  28. package/lib/client.js +27 -8
  29. package/lib/client.js.map +4 -4
  30. package/lib/compatibility.d.ts +46 -0
  31. package/lib/compatibility.d.ts.map +1 -0
  32. package/lib/dsh-host-adapter.d.ts +18 -0
  33. package/lib/dsh-host-adapter.d.ts.map +1 -0
  34. package/lib/gateway-auth.d.ts +1 -2
  35. package/lib/gateway-auth.d.ts.map +1 -1
  36. package/lib/gateway-routes.d.ts +3 -4
  37. package/lib/gateway-routes.d.ts.map +1 -1
  38. package/lib/gateway.d.ts +4 -0
  39. package/lib/gateway.d.ts.map +1 -1
  40. package/lib/ids.d.ts +3 -32
  41. package/lib/ids.d.ts.map +1 -1
  42. package/lib/imagine-routes.d.ts +2 -0
  43. package/lib/imagine-routes.d.ts.map +1 -1
  44. package/lib/index.d.ts +19 -4
  45. package/lib/index.d.ts.map +1 -1
  46. package/lib/index.js +26573 -1023
  47. package/lib/index.js.map +4 -4
  48. package/lib/invariant.js.map +1 -1
  49. package/lib/oauth-import-routes.d.ts +3 -4
  50. package/lib/oauth-import-routes.d.ts.map +1 -1
  51. package/lib/proxy.d.ts +3 -16
  52. package/lib/proxy.d.ts.map +1 -1
  53. package/lib/web-origin.d.ts +28 -4
  54. package/lib/web-origin.d.ts.map +1 -1
  55. package/lib/web-routes.d.ts.map +1 -1
  56. package/media/en/settings_accounts.png +0 -0
  57. package/media/en/settings_capabilities.png +0 -0
  58. package/media/en/settings_gateway.png +0 -0
  59. package/media/zh-CN/settings_accounts.png +0 -0
  60. package/media/zh-CN/settings_capabilities.png +0 -0
  61. package/media/zh-CN/settings_gateway.png +0 -0
  62. package/package.json +209 -172
  63. package/patches/dsh-agy@0.1.2.patch +25 -25
  64. package/scripts/release.mjs +186 -170
  65. package/scripts/smoke-deployed-routes.mjs +146 -146
  66. package/scripts/verify-deployed-catalog.mjs +87 -87
  67. package/src/adapter.ts +287 -287
  68. package/src/alias-adapter.ts +153 -153
  69. package/src/auth-routes.ts +921 -871
  70. package/src/auth.ts +67 -67
  71. package/src/bin.ts +350 -350
  72. package/src/capability-routes.ts +279 -275
  73. package/src/capability-runtime.ts +313 -313
  74. package/src/capability-settings.ts +658 -657
  75. package/src/capability-tools.ts +666 -666
  76. package/src/catalog.ts +271 -271
  77. package/src/client/GrokBuildSettings.tsx +770 -718
  78. package/src/client/api.ts +88 -88
  79. package/src/client/components/AboutTab.tsx +30 -30
  80. package/src/client/components/AccountsTab.tsx +241 -224
  81. package/src/client/components/Badge.tsx +33 -33
  82. package/src/client/components/CapabilitiesTab.tsx +265 -227
  83. package/src/client/components/CliPullPreview.tsx +116 -107
  84. package/src/client/components/CopyButton.tsx +57 -57
  85. package/src/client/components/GatewayTab.tsx +469 -409
  86. package/src/client/components/NoticeBanner.tsx +46 -46
  87. package/src/client/components/ProgressBar.tsx +53 -53
  88. package/src/client/components/ProviderCard.tsx +606 -502
  89. package/src/client/components/SettingsTabs.tsx +75 -75
  90. package/src/client/components/ToggleSwitch.tsx +71 -62
  91. package/src/client/constants.ts +224 -206
  92. package/src/client/display.ts +61 -61
  93. package/src/client/dshClientAdapter.ts +109 -0
  94. package/src/client/gatewaySnippets.ts +37 -36
  95. package/src/client/index.tsx +156 -37
  96. package/src/client/locales.ts +535 -491
  97. package/src/client/microStyles.ts +52 -33
  98. package/src/client/parsers.ts +396 -386
  99. package/src/client/styles.ts +325 -307
  100. package/src/client/types.ts +197 -185
  101. package/src/codex-http.ts +447 -447
  102. package/src/codex-images.ts +485 -485
  103. package/src/codex-model-capabilities.ts +320 -320
  104. package/src/codex-search.ts +245 -245
  105. package/src/codex-usage.ts +263 -263
  106. package/src/compatibility.ts +55 -0
  107. package/src/dsh-host-adapter.ts +171 -0
  108. package/src/gateway-anthropic-messages.ts +84 -84
  109. package/src/gateway-auth.ts +102 -100
  110. package/src/gateway-backend.ts +274 -274
  111. package/src/gateway-body.ts +49 -49
  112. package/src/gateway-config.ts +76 -76
  113. package/src/gateway-http.ts +104 -104
  114. package/src/gateway-openai-chat.ts +124 -124
  115. package/src/gateway-openai-responses.ts +53 -53
  116. package/src/gateway-parse.ts +224 -224
  117. package/src/gateway-protocol.ts +52 -52
  118. package/src/gateway-routes.ts +158 -152
  119. package/src/gateway.ts +258 -242
  120. package/src/grok-errors.ts +24 -24
  121. package/src/grok-imagine.ts +1627 -1627
  122. package/src/grok-import.ts +151 -151
  123. package/src/http-json.ts +82 -82
  124. package/src/ids.ts +59 -45
  125. package/src/imagine-routes.ts +463 -461
  126. package/src/index.ts +748 -598
  127. package/src/invariant.ts +17 -17
  128. package/src/kimi-errors.ts +26 -26
  129. package/src/media-store.ts +927 -927
  130. package/src/oauth-import-routes.ts +324 -314
  131. package/src/oauth-providers.ts +152 -152
  132. package/src/oauth-session.ts +183 -183
  133. package/src/oauth-sources.ts +1104 -1104
  134. package/src/oauth.ts +620 -620
  135. package/src/provider.ts +128 -128
  136. package/src/proxy.ts +11 -99
  137. package/src/redact.ts +72 -72
  138. package/src/session.ts +218 -218
  139. package/src/store.ts +217 -217
  140. package/src/web-origin.ts +296 -60
  141. package/src/web-routes.ts +38 -75
package/CONTRIBUTING.md CHANGED
@@ -1,120 +1,120 @@
1
- # Contributing
2
-
3
- Welcome! `dsh-coding-subscription-oauth` is an open-source coding-subscription OAuth plugin for DeepSeek Harness. We appreciate issue reports, questions and pull requests. Read `docs/00-project-rules.md` first — it defines the release loop, versioning, commit/push hygiene and the publish vs local-only document split that every contribution must respect.
4
-
5
- ## Code of Conduct
6
-
7
- - Be respectful and constructive in issues, PRs and reviews.
8
- - Only ever use coding subscriptions you own. The project does not support bulk accounts, quota resale, remote relay, paywall bypass or client impersonation — see the compliance note in `README.md`.
9
-
10
- ## Getting started
11
-
12
- Development verification for this plugin runs only in an isolated Docker build sandbox; do not run installs, builds, tests, typechecks, linters or package checks directly on a shared developer host. The tracked `Dockerfile` copies the filtered source into the image (never credentials), downloads dependencies in a dedicated stage, then runs project code with `--network=none`. Do not use privileged mode, credential or host-directory bind mounts, or the Docker socket. Tests use no published ports. The narrowly controlled interactive Web preview below is the only port-publishing exception; host networking remains prohibited unless its documented fallback conditions are all met.
13
-
14
- ```bash
15
- docker build --target check --build-arg NODE_VERSION=22.19.0 \
16
- --resource memory=3g --resource cpu-quota=200000 \
17
- --tag test-dsh-coding-oauth:check .
18
-
19
- docker build --target verify --build-arg NODE_VERSION=22.19.0 \
20
- --resource memory=3g --resource cpu-quota=200000 \
21
- --tag test-dsh-coding-oauth:verify .
22
- ```
23
-
24
- The `artifacts`, `package`, `inspect`, and `isolated-install` targets cover generated `lib/`, the candidate tarball, release inspection, and a script-disabled consumer install.
25
-
26
- ### Isolated Web preview
27
-
28
- `docker/run-preview.sh` is the only supported interactive preview launcher. It builds `web-preview` offline from two auditable inputs: this checkout's committed `lib/` and a BuildKit named context containing an installed `@deepseek-ai/dsh` **program package** (any audited version whose peer tree satisfies this plugin). Point `DSH_INSTALL_DIR` at that package directory, never at a DSH home/profile or any credential directory:
29
-
30
- ```bash
31
- export DSH_INSTALL_DIR=/path/to/node_modules/@deepseek-ai/dsh
32
- export DSH_PREVIEW_AUTHORITIES=review-host.example:17800
33
- ./docker/run-preview.sh
34
- ```
35
-
36
- The launcher defaults to Docker bridge networking and `0.0.0.0:17800`, checks the allowed high-port ranges, and enforces a non-root user, read-only root filesystem, dropped capabilities, no-new-privileges, CPU/memory/PID limits, isolated named volumes, and tmpfs runtime state. The DSH backend remains on a separate loopback-only high port. It does not mount, modify, restart, or validate against an existing host DSH. If provider endpoints require an outbound proxy, set `DSH_PREVIEW_PROXY` explicitly.
37
-
38
- The launcher prints a command for reading the runtime-generated bootstrap token from the container. Append it to the printed local or allowlisted remote URL as `?preview_token=<token>` using a private channel. The proxy exchanges it once for an HttpOnly, SameSite=Strict cookie and redirects to a token-free URL. Treat both the bootstrap URL and the isolated preview volumes as credentials; never paste either into logs, issues, commits, or chat.
39
-
40
- Host networking is **not** a normal preview mode. It may be selected only after a minimal container proves ordinary Docker port publishing unavailable and the maintainer explicitly approves that one run. The explicit guard is:
41
-
42
- ```bash
43
- DSH_PREVIEW_NETWORK=host \
44
- DSH_PREVIEW_HOST_NETWORK_CONFIRMED=yes \
45
- ./docker/run-preview.sh
46
- ```
47
-
48
- Even then, the launcher permits only the isolated high-port ranges and refuses occupied preview/backend ports. Stop the preview with the exact `docker rm -f <container>` command printed by the launcher. Remove its named volumes only after confirming they contain no OAuth credentials that need to be retained.
49
-
50
- This repo also ships a Grok Build CLI (`dsh-coding-oauth`, legacy `dsh-grok-build`), an OAuth settings page, and verification scripts for a live deployment (`verify:deployed` / `smoke:deployed`). Those exercise real providers, so they are meant for maintainer/dev workflows, not for CI.
51
-
52
- ## Development flow
53
-
54
- 1. Open an issue describing the change (or link an existing one) so scope is agreed first.
55
- 2. Branch from the default branch. Keep commits atomic and conventional — see **Commits & pushes** below.
56
- 3. When you change a capability or add a doc, update `README.md` (and the community translations added in `docs/00-project-rules.md` §2 if user-facing) and the relevant entries in `docs/` (public layer), **and** add a changelog entry under `Unreleased` in `CHANGELOG.md`.
57
- 4. Build the Docker `check` and `verify` targets until green, then commit that passing slice promptly (do not stack later work on an uncommitted green tree).
58
- 5. Push the branch as a version/milestone checkpoint and open a PR. Describe what changed and how it was verified. Keep the scope of local-only docs (`docs/local/`) out of the PR unless you are a maintainer doing internal investigation.
59
-
60
- ## Commits & pushes
61
-
62
- History is part of the review. The maintainer counterpart — tags, clean-tree releases, changelog folding — lives in `docs/00-project-rules.md` §7.
63
-
64
- ### Conventional, atomic commits
65
-
66
- - Use [Conventional Commits](https://www.conventionalcommits.org/): `type(optional-scope): summary` in the imperative, about 50–72 characters.
67
- - Types:
68
- - `feat:` new capability / route / provider
69
- - `fix:` bug fix
70
- - `docs:` documentation (publishable layer)
71
- - `test:` tests
72
- - `refactor:` behaviour-preserving cleanup
73
- - `build:` toolchain, packaging, or committed `lib/` artifacts
74
- - `ci:` CI workflow
75
- - `chore:` process-only (including a release bump)
76
- - Optional scopes such as `M1` / `M3` or a module name are welcome when they help a reviewer.
77
- - **One coherent concern per commit.** Do not mix docs, build/toolchain and feature/fix work unless they are inseparable (a new capability that cannot be reviewed without its README/changelog note, or a source change that must ship with the `lib/` it generated).
78
- - Do not rewrite published history. Amend or squash only on an unpushed local commit.
79
-
80
- ### Before you commit
81
-
82
- - Build the relevant Docker targets (`check`, then `verify`) and wait until green. Do not commit a failing tree.
83
- - Commit promptly once checks pass — do not leave a finished, verified change sitting uncommitted next to later work.
84
- - Generated `lib/` is a committed release artifact (git installs + the CI `git diff --exit-code -- lib` drift gate). Rebuild it and include it in the **same** commit as the source or build-script change that produced it. Do not land stale `lib/` against newer `src/`, and do not land a `lib/`-only commit unless the only change is a verified rebuild with no source delta.
85
- - Never commit secrets, tokens, credentials, private keys, `.env` files, host-specific paths, or local-only notes (`docs/local/`, `reference/`). See `docs/00-project-rules.md` §0.3.
86
-
87
- ### Pushing
88
-
89
- - Push the feature branch as a **checkpoint** at each version or milestone (for example after an M1/M2/M3 slice, or when a version-ready cut is green), not only when the PR is finished.
90
- - Never force-push (`--force` / `--force-with-lease`) without **explicit maintainer approval**. Default history is append-only, including on your own feature branch once it has been pushed.
91
- - Open the PR from a pushed checkpoint. Describe what changed and how it was verified.
92
-
93
- ## Review & merging
94
-
95
- - At least one other person's approval is needed to merge.
96
- - A PR that changes public behaviour must not be merged without its README/changelog updates.
97
- - Do not force-push `main` or a published release tag. Feature-branch force-pushes still need explicit approval (see above).
98
- - Maintainers run the release loop (`docs/00-project-rules.md` §3–4 and §7) after merging a substantive change: clean working tree, bump version, annotated tag `v<version>`, publish to npm, and keep the GitHub milestone/release updated.
99
-
100
- ### npm Trusted Publishing (required for tag releases)
101
-
102
- Tag pushes run `.github/workflows/release.yml`, which publishes with `npm publish --provenance` via OIDC (no long-lived `NPM_TOKEN`). Before the first automated publish of a package (or after moving the GitHub repo), a maintainer must bind Trusted Publishing on npm:
103
-
104
- 1. Sign in at [npmjs.com](https://www.npmjs.com/) as the package owner.
105
- 2. Open **Package → Settings → Trusted Publisher → GitHub Actions**.
106
- 3. Set **Organization or user** to `lninghaha`, **Repository** to `dsh-coding-subscription-oauth`, **Workflow filename** to `release.yml`, and leave the environment blank unless you add one.
107
- 4. Save. Pushing `v*` must then create/update the GitHub Release and publish (or skip if that exact version is already on the registry).
108
-
109
- If Trusted Publishing is missing or mis-bound, `npm publish` returns registry `404` after provenance signing. Fix the binding and re-run the failed Release workflow (or publish that one version manually, then rely on CI for later tags).
110
-
111
- ## Reporting security issues
112
-
113
- Do not open a public issue for a credential or account-safety problem. Follow the compliance/safety policy in `README.md`; for anything sensitive, contact a maintainer directly rather than pasting tokens or credentials anywhere.
114
-
115
- ## Document layers reminder
116
-
117
- - **Publishable**: root `README.md` + the community-language READMEs, `INSTALL.md`, `CHANGELOG.md`, `LICENSE`, `NOTICE`, `docs/00-project-rules.md`, `docs/02-architecture.md` + `docs/02-architecture.zh-CN.md`, and other generic `docs/` files. These ship to npm and git — keep them privacy-free.
118
- - **Local-only**: `docs/local/` and `reference/` are git-ignored and never shipped. Do not reference them from publishable docs.
119
-
120
- If you are not sure whether a detail is publishable, keep it in the local-only layer or ask a maintainer.
1
+ # Contributing
2
+
3
+ Welcome! `dsh-coding-subscription-oauth` is an open-source coding-subscription OAuth plugin for DeepSeek Harness. We appreciate issue reports, questions and pull requests. Read `docs/00-project-rules.md` first — it defines the release loop, versioning, commit/push hygiene and the publish vs local-only document split that every contribution must respect.
4
+
5
+ ## Code of Conduct
6
+
7
+ - Be respectful and constructive in issues, PRs and reviews.
8
+ - Only ever use coding subscriptions you own. The project does not support bulk accounts, quota resale, remote relay, paywall bypass or client impersonation — see the compliance note in `README.md`.
9
+
10
+ ## Getting started
11
+
12
+ Development verification for this plugin runs only in an isolated Docker build sandbox; do not run installs, builds, tests, typechecks, linters or package checks directly on a shared developer host. The tracked `Dockerfile` copies the filtered source into the image (never credentials), downloads dependencies in a dedicated stage, then runs project code with `--network=none`. Do not use privileged mode, credential or host-directory bind mounts, or the Docker socket. Tests use no published ports. The narrowly controlled interactive Web preview below is the only port-publishing exception; host networking remains prohibited unless its documented fallback conditions are all met.
13
+
14
+ ```bash
15
+ docker build --target check --build-arg NODE_VERSION=22.19.0 \
16
+ --resource memory=3g --resource cpu-quota=200000 \
17
+ --tag test-dsh-coding-oauth:check .
18
+
19
+ docker build --target verify --build-arg NODE_VERSION=22.19.0 \
20
+ --resource memory=3g --resource cpu-quota=200000 \
21
+ --tag test-dsh-coding-oauth:verify .
22
+ ```
23
+
24
+ The `artifacts`, `package`, `inspect`, and `isolated-install` targets cover generated `lib/`, the candidate tarball, release inspection, and a script-disabled consumer install.
25
+
26
+ ### Isolated Web preview
27
+
28
+ `docker/run-preview.sh` is the only supported interactive preview launcher. It builds `web-preview` offline from two auditable inputs: this checkout's committed `lib/` and a BuildKit named context containing an installed `@deepseek-ai/dsh` **program package** (any audited version whose peer tree satisfies this plugin). Point `DSH_INSTALL_DIR` at that package directory, never at a DSH home/profile or any credential directory:
29
+
30
+ ```bash
31
+ export DSH_INSTALL_DIR=/path/to/node_modules/@deepseek-ai/dsh
32
+ export DSH_PREVIEW_AUTHORITIES=review-host.example:17800
33
+ ./docker/run-preview.sh
34
+ ```
35
+
36
+ The launcher defaults to Docker bridge networking and `0.0.0.0:17800`, checks the allowed high-port ranges, and enforces a non-root user, read-only root filesystem, dropped capabilities, no-new-privileges, CPU/memory/PID limits, isolated named volumes, and tmpfs runtime state. The DSH backend remains on a separate loopback-only high port. It does not mount, modify, restart, or validate against an existing host DSH. If provider endpoints require an outbound proxy, set `DSH_PREVIEW_PROXY` explicitly.
37
+
38
+ The launcher prints a command for reading the runtime-generated bootstrap token from the container. Append it to the printed local or allowlisted remote URL as `?preview_token=<token>` using a private channel. The proxy exchanges it once for an HttpOnly, SameSite=Strict cookie and redirects to a token-free URL. Treat both the bootstrap URL and the isolated preview volumes as credentials; never paste either into logs, issues, commits, or chat.
39
+
40
+ Host networking is **not** a normal preview mode. It may be selected only after a minimal container proves ordinary Docker port publishing unavailable and the maintainer explicitly approves that one run. The explicit guard is:
41
+
42
+ ```bash
43
+ DSH_PREVIEW_NETWORK=host \
44
+ DSH_PREVIEW_HOST_NETWORK_CONFIRMED=yes \
45
+ ./docker/run-preview.sh
46
+ ```
47
+
48
+ Even then, the launcher permits only the isolated high-port ranges and refuses occupied preview/backend ports. Stop the preview with the exact `docker rm -f <container>` command printed by the launcher. Remove its named volumes only after confirming they contain no OAuth credentials that need to be retained.
49
+
50
+ This repo also ships a Grok Build CLI (`dsh-coding-oauth`, legacy `dsh-grok-build`), an OAuth settings page, and verification scripts for a live deployment (`verify:deployed` / `smoke:deployed`). Those exercise real providers, so they are meant for maintainer/dev workflows, not for CI.
51
+
52
+ ## Development flow
53
+
54
+ 1. Open an issue describing the change (or link an existing one) so scope is agreed first.
55
+ 2. Branch from the default branch. Keep commits atomic and conventional — see **Commits & pushes** below.
56
+ 3. When you change a capability or add a doc, update `README.md` (and the community translations added in `docs/00-project-rules.md` §2 if user-facing) and the relevant entries in `docs/` (public layer), **and** add a changelog entry under `Unreleased` in `CHANGELOG.md`.
57
+ 4. Build the Docker `check` and `verify` targets until green, then commit that passing slice promptly (do not stack later work on an uncommitted green tree).
58
+ 5. Push the branch as a version/milestone checkpoint and open a PR. Describe what changed and how it was verified. Keep the scope of local-only docs (`docs/local/`) out of the PR unless you are a maintainer doing internal investigation.
59
+
60
+ ## Commits & pushes
61
+
62
+ History is part of the review. The maintainer counterpart — tags, clean-tree releases, changelog folding — lives in `docs/00-project-rules.md` §7.
63
+
64
+ ### Conventional, atomic commits
65
+
66
+ - Use [Conventional Commits](https://www.conventionalcommits.org/): `type(optional-scope): summary` in the imperative, about 50–72 characters.
67
+ - Types:
68
+ - `feat:` new capability / route / provider
69
+ - `fix:` bug fix
70
+ - `docs:` documentation (publishable layer)
71
+ - `test:` tests
72
+ - `refactor:` behaviour-preserving cleanup
73
+ - `build:` toolchain, packaging, or committed `lib/` artifacts
74
+ - `ci:` CI workflow
75
+ - `chore:` process-only (including a release bump)
76
+ - Optional scopes such as `M1` / `M3` or a module name are welcome when they help a reviewer.
77
+ - **One coherent concern per commit.** Do not mix docs, build/toolchain and feature/fix work unless they are inseparable (a new capability that cannot be reviewed without its README/changelog note, or a source change that must ship with the `lib/` it generated).
78
+ - Do not rewrite published history. Amend or squash only on an unpushed local commit.
79
+
80
+ ### Before you commit
81
+
82
+ - Build the relevant Docker targets (`check`, then `verify`) and wait until green. Do not commit a failing tree.
83
+ - Commit promptly once checks pass — do not leave a finished, verified change sitting uncommitted next to later work.
84
+ - Generated `lib/` is a committed release artifact (git installs + the CI `git diff --exit-code -- lib` drift gate). Rebuild it and include it in the **same** commit as the source or build-script change that produced it. Do not land stale `lib/` against newer `src/`, and do not land a `lib/`-only commit unless the only change is a verified rebuild with no source delta.
85
+ - Never commit secrets, tokens, credentials, private keys, `.env` files, host-specific paths, or local-only notes (`docs/local/`, `reference/`). See `docs/00-project-rules.md` §0.3.
86
+
87
+ ### Pushing
88
+
89
+ - Push the feature branch as a **checkpoint** at each version or milestone (for example after an M1/M2/M3 slice, or when a version-ready cut is green), not only when the PR is finished.
90
+ - Never force-push (`--force` / `--force-with-lease`) without **explicit maintainer approval**. Default history is append-only, including on your own feature branch once it has been pushed.
91
+ - Open the PR from a pushed checkpoint. Describe what changed and how it was verified.
92
+
93
+ ## Review & merging
94
+
95
+ - At least one other person's approval is needed to merge.
96
+ - A PR that changes public behaviour must not be merged without its README/changelog updates.
97
+ - Do not force-push `main` or a published release tag. Feature-branch force-pushes still need explicit approval (see above).
98
+ - Maintainers run the release loop (`docs/00-project-rules.md` §3–4 and §7) after merging a substantive change: clean working tree, bump version, annotated tag `v<version>`, publish to npm, and keep the GitHub milestone/release updated.
99
+
100
+ ### npm Trusted Publishing (required for tag releases)
101
+
102
+ Tag pushes run `.github/workflows/release.yml`, which publishes with `npm publish --provenance` via OIDC (no long-lived `NPM_TOKEN`). Before the first automated publish of a package (or after moving the GitHub repo), a maintainer must bind Trusted Publishing on npm:
103
+
104
+ 1. Sign in at [npmjs.com](https://www.npmjs.com/) as the package owner.
105
+ 2. Open **Package → Settings → Trusted Publisher → GitHub Actions**.
106
+ 3. Set **Organization or user** to `lninghaha`, **Repository** to `dsh-coding-subscription-oauth`, **Workflow filename** to `release.yml`, and leave the environment blank unless you add one.
107
+ 4. Save. Pushing `v*` must then create/update the GitHub Release and publish (or skip if that exact version is already on the registry).
108
+
109
+ If Trusted Publishing is missing or mis-bound, `npm publish` returns registry `404` after provenance signing. Fix the binding and re-run the failed Release workflow (or publish that one version manually, then rely on CI for later tags).
110
+
111
+ ## Reporting security issues
112
+
113
+ Do not open a public issue for a credential or account-safety problem. Follow the compliance/safety policy in `README.md`; for anything sensitive, contact a maintainer directly rather than pasting tokens or credentials anywhere.
114
+
115
+ ## Document layers reminder
116
+
117
+ - **Publishable**: root `README.md` + the community-language READMEs, `INSTALL.md`, `CHANGELOG.md`, `LICENSE`, `NOTICE`, `docs/00-project-rules.md`, `docs/02-architecture.md` + `docs/02-architecture.zh-CN.md`, and other generic `docs/` files. These ship to npm and git — keep them privacy-free.
118
+ - **Local-only**: `docs/local/` and `reference/` are git-ignored and never shipped. Do not reference them from publishable docs.
119
+
120
+ If you are not sure whether a detail is publishable, keep it in the local-only layer or ask a maintainer.