@eduwork/dsh-oidc 0.1.0 → 0.2.1

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 (58) hide show
  1. package/CHANGELOG.en.md +40 -1
  2. package/CHANGELOG.md +40 -1
  3. package/README.en.md +23 -21
  4. package/README.md +17 -15
  5. package/THIRD_PARTY_NOTICES.en.md +7 -5
  6. package/THIRD_PARTY_NOTICES.md +7 -5
  7. package/cordis.patch.yml +2 -1
  8. package/docs/EDUWORK-MIGRATION.en.md +14 -2
  9. package/docs/EDUWORK-MIGRATION.md +14 -2
  10. package/docs/account-extensions.en.md +40 -0
  11. package/docs/account-extensions.md +42 -0
  12. package/docs/architecture.en.md +9 -9
  13. package/docs/architecture.md +11 -10
  14. package/docs/compatibility.en.md +11 -2
  15. package/docs/compatibility.md +11 -2
  16. package/docs/desktop-host.en.md +69 -0
  17. package/docs/desktop-host.md +79 -0
  18. package/docs/development.en.md +42 -0
  19. package/docs/development.md +42 -0
  20. package/docs/dsh-integration.en.md +23 -7
  21. package/docs/dsh-integration.md +23 -7
  22. package/docs/ecnu-reference.en.md +3 -3
  23. package/docs/ecnu-reference.md +3 -3
  24. package/docs/enterprise-profile.en.md +19 -11
  25. package/docs/enterprise-profile.md +18 -10
  26. package/docs/getting-started.en.md +12 -12
  27. package/docs/getting-started.md +16 -14
  28. package/docs/key-binding-protocol.en.md +2 -2
  29. package/docs/key-binding-protocol.md +2 -2
  30. package/docs/oidc-interoperability.en.md +3 -3
  31. package/docs/oidc-interoperability.md +2 -2
  32. package/docs/public-resource-protocol.en.md +51 -0
  33. package/docs/public-resource-protocol.md +50 -0
  34. package/docs/release-checklist.en.md +4 -2
  35. package/docs/release-checklist.md +4 -2
  36. package/docs/server-integration-contract.en.md +124 -8
  37. package/docs/server-integration-contract.md +136 -8
  38. package/examples/ecnu.enterprise-profile.example.json +2 -2
  39. package/examples/enterprise-profile.example.json +78 -77
  40. package/examples/identity-only.example.json +10 -0
  41. package/examples/resources-discovery.example.json +20 -0
  42. package/lib/callback-page.js +42 -0
  43. package/lib/client.js +935 -295
  44. package/lib/desktop-oidc.js +205 -0
  45. package/lib/index.js +148 -18
  46. package/lib/oidc.js +314 -58
  47. package/lib/profile.js +53 -24
  48. package/lib/provider/core.js +76 -15
  49. package/lib/provider/index.js +33 -20
  50. package/lib/provider/transform-adapter.js +31 -10
  51. package/lib/resources.js +23 -0
  52. package/lib/typert-schemas.js +34 -3
  53. package/lib/typert.host.js +42 -36
  54. package/lib/typert.remote-client.js +41 -35
  55. package/package.json +100 -29
  56. package/protocol/openapi.yaml +2 -2
  57. package/protocol/resources.openapi.yaml +51 -0
  58. package/schema/enterprise-profile.v1alpha1.schema.json +193 -188
package/CHANGELOG.en.md CHANGED
@@ -4,7 +4,46 @@
4
4
 
5
5
  All notable changes are documented here. The format follows Keep a Changelog principles and the project uses Semantic Versioning with pre-1.0 qualifications described in `docs/compatibility.en.md`.
6
6
 
7
- ## [Unreleased]
7
+ ## [0.2.0] - 2026-09-11
8
+
9
+ - Freeze the validated dev.7 implementation under a stable semantic version and update npm installation instructions for DSH `0.1.5-rc.1`. Distribution assembly pins version and integrity. Identity, managed keys, models and default selection remain public; quota and heartbeat belong to institution extensions.
10
+ - No runtime source changes from dev.7. Candidate notes below preserve migration history and validation boundaries. Consult the registry for npm publication status; GitHub pushes and Releases are separate actions.
11
+
12
+ - 2026-09-11 source preparation: pin the registry-installable RC.1 development/CI dependency closure; check its lock before CI installation. Correct bilingual identity-only/desktop/server-request/migration documentation and source entry points. Package version and frozen dev.7 artifact remain unchanged; no publication.
13
+
14
+
15
+ - Local candidate `0.2.0-dev.20260910.7`: unify the default as `EDUWORK_API_KEY`, accepting legacy automatic Profile/Provider names. Migrate only identical deployment bindings without overwriting the target. Session credential fingerprints prevent another login from reading or clearing the active key. Add Host-only `resolveBoundCredential` for extension adapters; no new RPC or organization-switching UI.
16
+
17
+ - `0.2.0-dev.20260910.6`: public OIDC now owns identity/key/models only. Removed quota HTTP, normalization, RPC fields and UI; legacy native mode no longer calls quota. Added a Host-only bounded model-resource transport and the official `oidc.account.menu.details` child slot for explicitly installed institution extensions.
18
+ - Exact RC.1 closure: 264 DSH packages, 78 tests and 6 compiled-browser checks; includes no implicit quota requests, host credential/destination boundaries and logout races. Existing managed keys and personal model selection survive. Public RFC/OpenAPI no longer require quota; heartbeat remains institution-only.
19
+
20
+
21
+ - `0.2.0-dev.20260910.5`: restore the public avatar menu with quota, refresh, sign-out, keyboard navigation and outside-focus dismissal, including collapsed sidebars. Desktop callback cards use configured branding and system fonts without authorization secrets or raw server errors.
22
+ - Adapt to official DSH `0.1.5-rc.1` PiAi `modelErrors`, preserving model capabilities and default selection. Serialize vault cleanup and reject late identity/key/quota writes after logout. A coherent 264-package closure, 75 tests and 7 compiled-browser checks pass; final native assembly belongs to the mainline.
23
+ - Expand the server RFC across identity, resource discovery, key lifecycle, models, quota, refresh/logout, versions and errors; validate resource OpenAPI examples using the real normalizer. Heartbeat is a default-off optional proposal only.
24
+
25
+ - Desktop acceptance revised the same `.20260910.4` candidate: onboarding stays visible with disabled actions while the key is connected but default-model selection is still pending, and closes only after selection completes.
26
+
27
+ - Unpublished candidate `0.2.0-dev.20260910.4` fixes independent stale account state in sign-in, sidebar and organization settings. Late reads cannot overwrite newer state; official credential events and connection recovery refresh all consumers. Explicit sign-in/provisioning uses DSH 0.1.5 default/current-session model APIs; upgrade recovery preserves usable personal choices and personal credentials. Added race regressions, compiled-client rendering, real HTTP PKCE/Key/default-settings tests and a local synthetic server for desktop acceptance.
28
+
29
+ - Unpublished candidate `0.2.0-dev.20260910.3` restores compatibility with the existing `worker.user-center.v1` resource protocol while retaining new protocols and unknown-version checks. Errors distinguish authenticated identity from disconnected model resources. File-managed settings offer host-backed configuration and example buttons; organization settings stay read-only and personal models remain available.
30
+
31
+ - Unpublished `0.2.0-dev.20260910.1` adds desktop OIDC without persistent WebServer: temporary loopback PKCE, Host browser service, safe result polling and cancellation, preserving host credentials and existing resource protocols. See [desktop host integration](docs/desktop-host.en.md).
32
+
33
+ - Unpublished 0.2.0-dev.20260909.1 adds optional identity-only login and public runtime model/quota integration with legacy wire compatibility; the host and client share a single Typert schema.
34
+
35
+
36
+ ### Changed
37
+
38
+ - Advance the local candidate to `0.1.0-dev.20260908.1`: restore the internal thinking signal lost in the previous effort-capability change. `compat.supportsReasoningEffort: false` still hides effort choices and omits `reasoning_effort`, while thinking follows the profile default. Historical user efforts cannot change that default. Non-reasoning models and explicit profile `off` retain their existing behavior.
39
+ - Add a 19-request real PiAi-to-HTTP regression covering direct, prepared, and DSH LLM calls, constrained model levels, historical `medium`/`xhigh`/`off`, non-reasoning models, and explicitly disabled thinking; checking internal request shape alone is insufficient.
40
+ - Advanced the candidate to `0.1.0-dev.20260907.3`: the complete DSH peer closure adds reviewed `0.1.3-alpha.2` (`82a5fd61…`) while continuing to reject mixed trees. An isolated Runtime with 250 coherent packages passes the complete check and 32 tests without OIDC runtime-source changes.
41
+ - Added a repository handoff entry that distinguishes latest user/mainline messages, historical material, current compatibility evidence, and the separate GitHub, npm, and local-deployment boundaries.
42
+ - Advanced the candidate to `0.1.0-dev.20260907.2`: the model-capability chain now preserves the exact seven reasoning-effort IDs, per-model defaults, and independent wire values. Undeclared levels are no longer supplied by pi-ai defaults, and `xhigh` is never rewritten as `max`.
43
+ - Historical provider defaults conservatively fall back within each model's supported efforts. Model resolution, call preparation, and transport share one capability snapshot; invalid efforts fail before HTTP while thinking-only and non-reasoning semantics remain distinct.
44
+ - Added local development candidate `0.1.0-dev.20260907.1`: the complete DSH peer closure explicitly accepts either `0.1.2-rc.1` or `0.1.3-alpha.1` while rejecting every mixed-version tree.
45
+ - Audited upstream `dsh-v0.1.3-alpha.1` (`d347e703…`) source contracts and an isolated Runtime. SessionHandle, session v2/locking, and asynchronous `agentLoop.create()` are outside OIDC's runtime dependency surface, so no plugin runtime source change is required.
46
+ - Extended the contract probe with OidcAccountService construction and all 13 Typert Remote markers while retaining Settings, LLM/Pi, WebServer, credentials, attachment, and Client-slot coverage.
8
47
 
9
48
  ## [0.1.0] - 2026-09-06
10
49
 
package/CHANGELOG.md CHANGED
@@ -4,7 +4,46 @@
4
4
 
5
5
  所有重要变更均记录于此。格式遵循 Keep a Changelog 原则;项目使用语义化版本,并遵循[兼容性与发布策略](docs/compatibility.md)中对 1.0 之前版本的说明。
6
6
 
7
- ## [未发布]
7
+ ## [0.2.0] - 2026-09-11
8
+
9
+ - 将已验收的 dev.7 运行实现冻结为稳定语义版本;补齐 DSH `0.1.5-rc.1` npm 安装指引,正式产品按精确版本与 integrity 装配。身份、托管 Key、模型及默认选择归属公版;配额和心跳由机构扩展提供。
10
+ - 与 dev.7 相比无运行源码变更;下面的候选记录保留各次功能迁移和验证边界。npm 发布状态以 registry 为准,GitHub 推送及 Release 是独立动作。
11
+
12
+ - 2026-09-11 源码准备:锁定 npm 可安装的 RC.1 开发/CI 依赖闭包,CI 安装前验证锁;校正中英文纯身份接入、桌面、服务端请求、凭据迁移文档与开发入口。包版本和已冻结 dev.7 产物保持不变,本轮未发布。
13
+
14
+
15
+ - 本地候选 `0.2.0-dev.20260910.7`:企业 Key 默认统一为 `EDUWORK_API_KEY`,兼容本 Profile/Provider 的旧自动名称;仅在完整部署绑定一致时迁移,不覆盖新槽位。共享引用按会话 Key 指纹校验归属,避免其他登录读取或清除当前 Key。增加仅供 Host 使用的 `resolveBoundCredential`,供机构适配器读取同一份已验证凭据;无新增 RPC/企业切换界面。
16
+
17
+ - `0.2.0-dev.20260910.6`:公共 OIDC 只保留身份/Key/模型;移除配额 HTTP、归一化、RPC 字段和 UI,旧 native 模式不再调用配额桥。新增 Host 专属的有界模型资源运输和官方 `oidc.account.menu.details` 子插槽,由显式安装的机构扩展提供附加账户内容。
18
+ - 精确 RC.1 闭包 264 个 DSH 包、78 项测试及 6 项编译浏览器检查通过,覆盖无隐式配额请求、凭据/地址边界和注销竞态。保留已有托管 Key 与个人模型选择。公共 RFC/OpenAPI 不再要求配额,心跳仍仅属于机构扩展。
19
+
20
+
21
+ - `0.2.0-dev.20260910.5`:恢复公共头像账户菜单(配额、刷新、注销、键盘操作及失焦关闭),支持折叠侧栏;桌面回调新增无外部字体的品牌卡片,不显示授权秘密或服务端原始错误。
22
+ - 适配官方 DSH `0.1.5-rc.1` 的 PiAi `modelErrors` 契约,保留精确模型能力和默认选模;退出时串行清理保险库,拒绝旧请求写回身份/Key/配额。264 包一致闭包、75 项测试与 7 项编译浏览器回归通过;双桌面最终装配由主线验收。
23
+ - 服务端 RFC 完整覆盖身份、资源发现、Key 生命周期、目录、配额、刷新/注销、版本和错误处理;资源 OpenAPI 示例经过实际归一化器验证。心跳只新增默认关闭的可选协议草案。
24
+
25
+ - 同一 `.20260910.4` 候选在桌面联验后修正选模竞态:创建 Key 已完成但默认模型尚在保存时,登录引导保持可见且操作禁用;选模完成后才收起。
26
+
27
+ - 未发布候选 `0.2.0-dev.20260910.4`:修复登录页、侧栏与企业设置的独立旧状态;拒绝迟到查询覆盖新状态,监听官方凭据事件及连接恢复。明确登录/创建凭据后,使用 DSH 0.1.5 的默认模型和当前会话模型接口;升级时仅修复不可用默认值,保留个人凭据与可用选择。增加共享状态竞态、编译客户端显示、真实 HTTP PKCE/Key/默认设置的回归及双桌面验收用本机模拟服务。
28
+
29
+ - 未发布候选 `0.2.0-dev.20260910.3` 恢复已有资源协议 `worker.user-center.v1` 的兼容,同时保留新协议及未知版本检查;错误提示区分已登录身份与尚未连接的模型资源。配置文件模式增加宿主支持的“打开配置文件 / 查看示例”入口;企业配置保持只读,个人模型仍可使用。
30
+
31
+ - 未发布候选 `0.2.0-dev.20260910.1` 新增无常驻 WebServer 的桌面 OIDC:短时 loopback PKCE、Host 浏览器服务、安全登录轮询与取消,继续使用宿主保险库接口及原资源协议。见 [桌面宿主接入](docs/desktop-host.md)。
32
+
33
+ - 未发布候选 0.2.0-dev.20260909.1 新增纯身份模式及公共模型/配额协议,保留原部署 wire;Host/Client 共享同一份 Typert schema。
34
+
35
+
36
+ ### 变更
37
+
38
+ - 候选版本推进至 `0.1.0-dev.20260908.1`:修复上一轮模型档位适配遗漏 thinking-only 内部启用信号的问题。`compat.supportsReasoningEffort: false` 继续隐藏档位且不发送 `reasoning_effort`,同时按 Profile 默认值保留 thinking;历史会话中的 effort 不改变该默认值。无 reasoning 模型及 Profile 的 `off` 行为保持不变。
39
+ - 新增真实 PiAi 到 HTTP 的 19 次请求回归,覆盖直接调用、预备调用、DSH LLM 调用、受限模型档位、历史 `medium`/`xhigh`/`off`、无 reasoning 及明确关闭 thinking;避免仅检查内部请求形状而遗漏过线行为。
40
+ - 候选版本推进至 `0.1.0-dev.20260907.3`:完整 DSH peer 闭包增加已复核的 `0.1.3-alpha.2`(`82a5fd61…`),并继续拒绝混版依赖树;250 个一致包的隔离 Runtime 通过完整检查和 32 项测试,无需修改 OIDC 运行源码。
41
+ - 新增仓库接手入口说明,明确最新用户/主线消息、历史材料、兼容事实以及 GitHub、npm 和本地部署的边界。
42
+ - 候选版本推进至 `0.1.0-dev.20260907.2`:模型能力链路精确保留七种 reasoning effort ID、模型级默认值和独立过线值,未声明档位不再由 pi-ai 缺省补出,`xhigh` 不会被映射为 `max`。
43
+ - Provider 级历史默认值按模型有效档位保守回落;模型解析、调用准备和实际传输使用同一份能力快照,非法档位在任何 HTTP 请求前拒绝,同时保留 thinking-only 与无 reasoning 两种不同语义。
44
+ - 增加本地开发候选 `0.1.0-dev.20260907.1`:完整 DSH peer 闭包明确允许 `0.1.2-rc.1` 或 `0.1.3-alpha.1`,同时拒绝任何混版依赖树。
45
+ - 对上游 `dsh-v0.1.3-alpha.1`(`d347e703…`)完成源码契约核对和隔离 Runtime 验证;SessionHandle、session v2/锁和异步 `agentLoop.create()` 不在 OIDC 运行依赖面内,无需修改插件运行源码。
46
+ - 契约探针新增 OidcAccountService 构造及 13 个 Typert Remote 标记检查,并继续覆盖 Settings、LLM/Pi、WebServer、credentials、附件和客户端插槽。
8
47
 
9
48
  ## [0.1.0] - 2026-09-06
10
49
 
package/README.en.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # dsh-oidc
2
2
 
3
- > npm package: `@eduwork/dsh-oidc@0.1.0`. The previous unscoped package and scoped alpha remain available during migration. See [migration and data compatibility](docs/EDUWORK-MIGRATION.en.md).
3
+ > `0.2.0`, based on official DSH `0.1.5-rc.1`: identity login, managed keys, model discovery and logout remain public. Quota requests, normalization and UI belong to a separately installed institution extension. No public quota or heartbeat requests. See [account extensions](docs/account-extensions.en.md) and [server specification](docs/server-integration-contract.en.md). Consult the npm registry for publication status.
4
4
 
5
5
  [简体中文](README.md) | **English**
6
6
 
@@ -10,12 +10,12 @@ Standards-based enterprise identity and model integration for [DeepSeek Harness]
10
10
 
11
11
  1. OpenID Connect Authorization Code flow with PKCE for a public client;
12
12
  2. a fixed enterprise **Key Binding** protocol that exchanges the authenticated OIDC access token for a revocable model runtime credential;
13
- 3. an audited local OpenAI-compatible DSH Provider adapter; and
14
- 4. bounded product branding plus a shared account and enterprise-model settings UI.
13
+ 3. a local OpenAI-compatible Provider with optional automatic model discovery; and
14
+ 4. safe account refresh and sign-out, with optional institution account extensions.
15
15
 
16
- The plugin is Web-first and has no Wails dependency. A desktop product can select the native account backend without changing the profile, Provider routes, UI contract, or Key Binding semantics.
16
+ Shared account UI and optional bounded branding accompany these capabilities. Identity-only integration may omit resource APIs, and personal model providers remain available.
17
17
 
18
- > **Current release: 0.1.0.** The source targets DSH `0.1.2-rc.1` exactly (commit `a66e4702…`) and locks and checks the complete DSH peer closure. The package has a stable version number, while the Enterprise Profile remains `v1alpha1`; real OIDC/Key Binding integration and host credential-isolation review are still required before production use.
18
+ The plugin targets a single-user local client. Web is for local validation; `backend: desktop` uses a temporary loopback callback and the host browser service without a persistent WebServer. `backend: native` remains for the legacy account bridge. No backend is tied to a particular shell; see [desktop host integration](docs/desktop-host.en.md).
19
19
 
20
20
  Integrating your own organization? Read the **[server API specification](docs/server-integration-contract.en.md)** first, then follow the **[getting-started guide](docs/getting-started.en.md)**. The first defines, with requests, responses, fields, and errors, the OIDC + PKCE, Key Binding, and model-gateway capabilities one institutional service must jointly deliver; the second covers configuration, installation, acceptance, and troubleshooting.
21
21
 
@@ -48,17 +48,17 @@ The Enterprise Profile is data only. It cannot name JavaScript modules, inject C
48
48
 
49
49
  ## What is included
50
50
 
51
- - fixed loopback callback `http://127.0.0.1:<DSH-port>/oauth/callback`;
51
+ - loopback callback `http://127.0.0.1:<actual-port>/oauth/callback`: the WebServer port for Web, a temporary random port by default for desktop;
52
52
  - OIDC Discovery, PKCE S256, state, nonce, RS256 ID Token validation, UserInfo subject binding, refresh, and optional revocation;
53
53
  - `userinfo.name` for display, falling back only to the required `userinfo.sub`;
54
54
  - fixed `worker-user-center-v1` endpoints for bootstrap, provision, resolve, and renew;
55
55
  - DSH Credential Provider storage for OIDC session material and the runtime API key;
56
56
  - declarative provider/model catalog and bounded brand tokens;
57
- - one capability-aware enterprise-service settings section shared by Web and native hosts through DSH's official `settings.section` extension point;
57
+ - shared official model-settings, onboarding, sidebar-account and general-settings slots, with capability-aware operations across local Web and both desktop shells;
58
58
  - a native backend adapter boundary for desktop products;
59
59
  - a stable `enterpriseTransforms` service for capabilities such as a text-model image fallback without forking the Provider route.
60
60
 
61
- Not included: an OIDC Provider, a Key Binding server, multi-user session storage, an organization directory, quota UI, a desktop shell, or remote executable plugins.
61
+ Not included: an OIDC Provider, a Key Binding server, multi-user session storage, an organization directory, a desktop shell, or remote executable plugins.
62
62
 
63
63
  ## Branding scope
64
64
 
@@ -69,25 +69,25 @@ Not included: an OIDC Provider, a Key Binding server, multi-user session storage
69
69
  - a six-digit hexadecimal `primaryColor`;
70
70
  - `loginTitle`, `loginDescription`, and an HTTPS `supportURL`.
71
71
 
72
- These values affect the document title, sidebar brand, conversation hero mark, login/confirmation surfaces, and a bounded set of DSH theme tokens. They cannot inject arbitrary CSS, SVG, scripts, or components, and they do not replace a desktop shell, updater, quota UI, or institution-specific business pages. See the [Enterprise Profile specification](docs/enterprise-profile.en.md#branding) for limits and security rules.
72
+ These values affect the document title, sidebar brand, conversation hero mark, login/confirmation surfaces, and a bounded set of DSH theme tokens. They cannot inject arbitrary CSS, SVG, scripts, or components, and they do not replace a desktop shell, updater, or institution-specific business pages. See the [Enterprise Profile specification](docs/enterprise-profile.en.md#branding) for limits and security rules.
73
73
 
74
74
  ## Requirements
75
75
 
76
76
  - Node.js 22 or newer;
77
- - the exact DeepSeek Harness `0.1.2-rc.1` peer set;
78
- - an OIDC Public Client without a Client Secret that registers `http://127.0.0.1:3080/oauth/callback` exactly;
77
+ - one coherent DeepSeek Harness `0.1.5-rc.1` peer set for this source candidate; historical stable `0.1.0` targets DSH `0.1.2-rc.1`;
78
+ - an OIDC Public Client without a Client Secret: new desktops use `http://127.0.0.1:<actual-port>/oauth/callback`, while local Web validation registers its actual fixed port;
79
79
  - Discovery metadata with PKCE S256, RS256 ID Tokens, and `userinfo_endpoint`;
80
- - one institutional integration service implementing the complete [server contract](docs/server-integration-contract.en.md), including Key Binding and the model gateway;
80
+ - an OIDC service for identity-only mode; managed models additionally require the Key Binding and model gateway in the [server contract](docs/server-integration-contract.en.md);
81
81
  - a DSH Credential Provider appropriate for the deployment.
82
82
 
83
83
  The current Web backend is intentionally limited to a trusted, single-user DSH process bound to `127.0.0.1`. It is not a shared public-Web session solution. See [Security model](docs/security-model.en.md).
84
84
 
85
85
  ## Install
86
86
 
87
- Install the reviewed, exact version from npm:
87
+ Install the exact npm version in a coherent DSH `0.1.5-rc.1` host. During release preparation, if the version is not yet in the registry, use the source instructions below rather than installing an older version or suppressing peer conflicts:
88
88
 
89
89
  ```bash
90
- dsh plugin --profile web add @eduwork/dsh-oidc@0.1.0
90
+ dsh plugin --profile web add @eduwork/dsh-oidc@0.2.0
91
91
  ```
92
92
 
93
93
  For auditing, development, or testing unpublished changes, install from a local checkout instead:
@@ -109,10 +109,10 @@ Advanced products may instead add it explicitly to their own DSH bundle patch:
109
109
  - id: enterprise-oidc
110
110
  name: '@eduwork/dsh-oidc'
111
111
  config:
112
- profilePathEnv: DSH_OIDC_ENTERPRISE_PROFILE
112
+ profilePathEnv: EDUWORK_OIDC_PROFILE
113
113
  ```
114
114
 
115
- Set `DSH_OIDC_ENTERPRISE_PROFILE` to a trusted local JSON file. Start from [`examples/enterprise-profile.example.json`](examples/enterprise-profile.example.json) and validate it with [`schema/enterprise-profile.v1alpha1.schema.json`](schema/enterprise-profile.v1alpha1.schema.json).
115
+ Set `EDUWORK_OIDC_PROFILE` to a trusted local JSON file. Start from [`examples/enterprise-profile.example.json`](examples/enterprise-profile.example.json) and validate it with [`schema/enterprise-profile.v1alpha1.schema.json`](schema/enterprise-profile.v1alpha1.schema.json).
116
116
 
117
117
  Start DSH on the fixed IPv4 loopback host. The public OIDC client must register exactly:
118
118
 
@@ -120,7 +120,7 @@ Start DSH on the fixed IPv4 loopback host. The public OIDC client must register
120
120
  http://127.0.0.1:3080/oauth/callback
121
121
  ```
122
122
 
123
- The callback host and path are not configurable. The port follows the actual DSH WebServer port; if the operator changes `3080`, the OIDC registration must use the same port.
123
+ This installation example uses local Web validation. Its port follows the actual DSH WebServer port; if the operator changes `3080`, registration must match. New desktops use a temporary listener and normally request an available port; see [desktop integration](docs/desktop-host.en.md). The loopback host and callback path stay fixed.
124
124
 
125
125
  ## Configuration surfaces
126
126
 
@@ -129,7 +129,7 @@ The callback host and path are not configurable. The port follows the actual DSH
129
129
  | `profile` | One inline Enterprise Profile object. |
130
130
  | `profiles` | An array of inline Enterprise Profiles. Provider IDs must also be unique. |
131
131
  | `profilePathEnv` | Name of an environment variable containing the trusted JSON profile path. |
132
- | `backend` | `web` (default) or `native`. Native delegates account lifecycle to the host's `enterpriseAccounts` service. |
132
+ | `backend` | `web` (default) for local validation, `desktop` for the shared temporary loopback/native-browser implementation, or legacy `native` for a host-provided `enterpriseAccounts` service. |
133
133
  | `uiMode` | `standard` (shared model settings plus account/onboarding/branding), `models-only` (shared model settings only), or `external` (no plugin UI). |
134
134
  | `web.returnPath` | Same-origin absolute path after callback; defaults to `/`. |
135
135
  | `allowEmptyProfiles` | Allows the plugin service to start with no profile, mainly for composition tests. |
@@ -138,7 +138,7 @@ See [Enterprise Profile](docs/enterprise-profile.en.md) for every data field and
138
138
 
139
139
  ## Protocol summary
140
140
 
141
- OIDC remains standard OIDC. The plugin does not support custom “userinfo field mapping”: `name` is the standard display claim and `sub` is the guaranteed stable fallback. OIDC, Key Binding, and the model gateway form one required institutional server contract; they are not optional alternatives. See the [complete server integration contract](docs/server-integration-contract.en.md).
141
+ OIDC remains standard OIDC. The plugin does not support custom “userinfo field mapping”: `name` is the standard display claim and `sub` is the guaranteed stable fallback. Identity-only mode requires OIDC and omits both `keyBinding` and `provider`. Managed enterprise keys/models require both fields and the Key Binding/model-gateway services. See the [complete server integration contract](docs/server-integration-contract.en.md).
142
142
 
143
143
  Given `keyBinding.baseURL = https://ai.example.edu/api/worker/v1`, the only valid operations are:
144
144
 
@@ -149,7 +149,7 @@ Given `keyBinding.baseURL = https://ai.example.edu/api/worker/v1`, the only vali
149
149
 
150
150
  The profile cannot change these paths or their fields. [`protocol/openapi.yaml`](protocol/openapi.yaml) is the machine-readable contract; [Key Binding protocol](docs/key-binding-protocol.en.md) defines normative behavior, authorization, idempotency, logging, and lifecycle semantics.
151
151
 
152
- Provider ID determines the runtime route and, by default, derives the local credential reference (for example, `example-ai` becomes `EXAMPLE_AI_API_KEY`). Production and test deployments that reuse one Provider ID may explicitly isolate their local secret entries with `keyBinding.credentialRef`; this does not change the server API.
152
+ Provider ID determines the runtime route; the default enterprise credential reference is `EDUWORK_API_KEY`. Legacy automatic names are migrated compatibly, while independently managed references remain configurable through `keyBinding.credentialRef`. Verified identity, resource binding and a key fingerprint enforce ownership without changing the server API.
153
153
 
154
154
  ## Development
155
155
 
@@ -158,10 +158,12 @@ npm ci
158
158
  npm run check
159
159
  ```
160
160
 
161
- `npm run check` verifies the DSH rc.1 Host, Client, Provider, WebServer, credentials, and Typert contracts; rebuilds both plugin faces; runs unit/security-contract tests; validates examples and OpenAPI structure; scans publishable sources for common secrets, personal paths, non-example addresses, and ECNU service endpoints; and inspects the npm tarball.
161
+ Development dependencies and the lockfile pin DSH `0.1.5-rc.1`, without referring to a developer’s installed desktop. `npm run check` verifies the dependency lock and selected DSH Host, Client, Provider, WebServer, credentials, and Typert contracts; rebuilds both plugin faces; runs unit/security-contract tests; validates examples and OpenAPI structure; scans publishable sources for common secrets, personal paths, non-example addresses, and ECNU service endpoints; and inspects the npm tarball.
162
162
 
163
163
  The repository intentionally keeps Host code as native ESM under `src/host`; `scripts/build-host.mjs` copies it to `lib`. The DSH browser client is bundled as the loader-compatible `lib/client.js`.
164
164
 
165
+ Plugin `0.2.0` does not track the EduWork product version. Distribution assembly uses an exact npm version and integrity; source paths are for development. This version does not replace earlier frozen artifacts. See [development and release preparation](docs/development.en.md) for clean installation and validation boundaries.
166
+
165
167
  ## Documentation
166
168
 
167
169
  - [Architecture and boundaries](docs/architecture.en.md)
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # dsh-oidc
2
2
 
3
- > npm 包:`@eduwork/dsh-oidc@0.1.0`。旧无作用域包和作用域 alpha 版本保留供迁移;安装切换与数据兼容见 [迁移说明](docs/EDUWORK-MIGRATION.md)。
3
+ > `0.2.0`,基于官方 DSH `0.1.5-rc.1`:公版保留身份登录、托管 Key、模型发现和注销;配额请求、字段归一化及 UI 已抽离到独立机构扩展,公版不请求配额或心跳。见 [账户扩展接口](docs/account-extensions.md)和 [服务端规范](docs/server-integration-contract.md)。发布状态以 npm registry 为准。
4
4
 
5
5
  **简体中文** | [English](README.en.md)
6
6
 
@@ -10,12 +10,12 @@
10
10
 
11
11
  1. 标准 OIDC Authorization Code + PKCE 公共客户端登录;
12
12
  2. 固定的企业 **Key Binding** 协议,用 OIDC Access Token 申请、解析或轮换可撤销的模型运行凭据;
13
- 3. 本地、经过审计的 OpenAI-compatible DSH Provider 适配器;
14
- 4. 有边界的品牌替换,以及 Web / Desktop 共用的账号与企业模型设置 UI。
13
+ 3. 本地 OpenAI-compatible Provider 与可自动同步的模型目录;
14
+ 4. 安全的账户刷新和注销,可选机构账户扩展。
15
15
 
16
- 插件 Web 优先,不依赖 Wails。桌面产品可以切换到 native account backend,但 Enterprise Profile、Provider 路由、前端账号契约和 Key Binding 语义不变。
16
+ 这些能力配有共享账号界面和可选品牌配置。纯身份接入可省略资源协议,个人模型入口始终保留。
17
17
 
18
- > **当前版本:0.1.0。** 当前源码精确适配 DSH `0.1.2-rc.1`(提交 `a66e4702…`),并锁定、检查完整 DSH peer 闭包。软件包使用稳定版本号,但 Enterprise Profile 仍为 `v1alpha1`;正式生产前仍必须完成真实 OIDC/Key Binding 联调和宿主凭据隔离审计。
18
+ 插件面向单机客户端。本机 Web 用于功能验证;桌面通过 `backend: desktop` 使用临时 loopback 回调和宿主浏览器服务,无需常驻 WebServer。`backend: native` 仅兼容旧宿主账户桥。三种后端都不依赖特定外壳,详见 [桌面宿主接入](docs/desktop-host.md)。
19
19
 
20
20
  准备接入自己的机构?先读 **[服务端接口规范](docs/server-integration-contract.md)**,再按 **[完整中文接入指南](docs/getting-started.md)** 部署。前者以请求、响应、字段和错误码形式定义一个机构服务必须共同实现的 OIDC + PKCE、Key Binding 和模型网关能力;后者覆盖配置、安装、验收和排障。
21
21
 
@@ -29,7 +29,7 @@
29
29
  - Key Binding 负责确认该用户能否获得哪个 Provider 的运行凭据;
30
30
  - Enterprise Profile 负责声明品牌、OIDC 公共客户端、Key Binding 基址和模型事实;
31
31
  - 本地 Provider 适配器把凭据和模型事实接入 DSH;
32
- - 具体桌面外壳、配额展示、学校业务页、更新器等仍由产品实现方扩展。
32
+ - 配额由独立机构扩展提供;桌面外壳、学校业务页、心跳与更新器由产品实现方扩展。
33
33
 
34
34
  远程配置只能是数据,不能指定 JS 模块、脚本、CSS、工具、Skill 或自定义 Provider adapter,也不能修改 Key Binding 的路径和字段。这是开源后的核心安全边界。
35
35
 
@@ -37,17 +37,17 @@
37
37
 
38
38
  已包含:
39
39
 
40
- - 固定 loopback 回调 `http://127.0.0.1:<DSH端口>/oauth/callback`;
40
+ - loopback 回调 `http://127.0.0.1:<实际端口>/oauth/callback`:Web 取 WebServer 端口,桌面默认临时随机端口;
41
41
  - OIDC Discovery、PKCE S256、state、nonce、RS256 ID Token 校验、UserInfo subject 绑定、刷新和可选撤销;
42
42
  - 只读取标准 `userinfo.name`,缺失时降级到必需字段 `userinfo.sub`;
43
43
  - 固定 `worker-user-center-v1` 的 bootstrap / provision / resolve / renew;
44
44
  - 使用 DSH Credential Provider 保存 OIDC 会话和模型 API Key;
45
45
  - 声明式 Provider/模型目录和有边界的品牌 token;
46
- - Web 与 native 宿主共用、按宿主能力自动显隐操作的企业服务设置页;该页面通过 DSH 官方 `settings.section` 扩展点注册;
46
+ - 两种桌面壳和本机 Web 共用官方模型设置、onboarding、侧栏账号与通用设置插槽,按宿主能力显示操作;
47
47
  - 桌面原生账号后端适配边界;
48
48
  - 稳定的 `enterpriseTransforms` 扩展服务,图像理解等插件可以增强某条模型路由,但不会再注册一套重复 Provider。
49
49
 
50
- 明确不包含:OIDC 服务端、Key Binding 服务端、多用户会话数据库、学校人员目录、配额 UI、Wails 外壳、客户端更新器和远程可执行插件。
50
+ 明确不包含:OIDC 服务端、Key Binding 服务端、多用户会话数据库、学校人员目录、Wails 外壳、客户端更新器和远程可执行插件。
51
51
 
52
52
  ## 品牌替换范围
53
53
 
@@ -65,10 +65,10 @@
65
65
  1. 按[服务端接口规范](docs/server-integration-contract.md)联合提供 OIDC、Key Binding 和模型网关。
66
66
  2. 为无 Client Secret 的 Public Client 精确登记 `http://127.0.0.1:3080/oauth/callback`。
67
67
  3. 从 [`examples/enterprise-profile.example.json`](examples/enterprise-profile.example.json) 复制一份可信本地配置。
68
- 4. 从 npm 安装经过复核的精确版本:
68
+ 4. 在统一的 DSH `0.1.5-rc.1` 宿主中安装精确 npm 版本。发布准备期间若 registry 尚未提供该版本,使用下方源码方式,不要改装旧版或忽略 peer 冲突:
69
69
 
70
70
  ```bash
71
- dsh plugin --profile web add @eduwork/dsh-oidc@0.1.0
71
+ dsh plugin --profile web add @eduwork/dsh-oidc@0.2.0
72
72
  ```
73
73
 
74
74
  需要审计、开发或测试尚未发布的改动时,也可以从本地 checkout 安装:
@@ -90,13 +90,13 @@ dsh plugin --profile web add .
90
90
  - id: enterprise-oidc
91
91
  name: '@eduwork/dsh-oidc'
92
92
  config:
93
- profilePathEnv: DSH_OIDC_ENTERPRISE_PROFILE
93
+ profilePathEnv: EDUWORK_OIDC_PROFILE
94
94
  ```
95
95
 
96
96
  5. 用环境变量传入配置文件路径,并让 DSH WebServer 监听 `127.0.0.1`:
97
97
 
98
98
  ```text
99
- DSH_OIDC_ENTERPRISE_PROFILE=/etc/dsh/enterprise-profile.json
99
+ EDUWORK_OIDC_PROFILE=/etc/dsh/enterprise-profile.json
100
100
  dsh --profile web --host 127.0.0.1 --port 3080
101
101
  ```
102
102
 
@@ -116,7 +116,7 @@ OIDC 部分坚持标准化,不增加机构私有的 UserInfo 映射语法:
116
116
  - 展示名取 `name`,缺失时才取 `sub`;
117
117
  - bootstrap 中即使返回姓名,也不得覆盖 OIDC 身份。
118
118
 
119
- OIDC、Key Binding 和模型网关共同构成一个完整的机构服务端交付,不能任选。Key Binding 是本项目定义的企业协议:Profile 通过 `baseURL` 指定接口组,其余路径、请求字段和响应字段全部固定。Provider ID 决定运行路由,并默认派生凭据引用(例如 `example-ai` 对应 `EXAMPLE_AI_API_KEY`);生产/测试复用同一 Provider ID 时,可以用本地 `keyBinding.credentialRef` 明确隔离,且不会改变服务端接口。完整接口见[服务端接口规范](docs/server-integration-contract.md)。
119
+ 纯身份接入只需 OIDC,省略 `keyBinding` 与 `provider` 即可。需要自动获得企业 Key 和配置模型时,这两项必须同时配置,并提供 Key Binding 与模型网关。Key Binding 是本项目定义的企业协议:Profile 通过 `baseURL` 指定接口组,其余路径、请求字段和响应字段全部固定。Provider ID 决定运行路由;默认企业凭据统一使用 `EDUWORK_API_KEY`。旧自动名称兼容迁移,独立的自定义引用仍由 `keyBinding.credentialRef` 配置。凭据归属由已验证的身份、资源绑定和 Key 指纹校验,不改变服务端接口。完整接口见[服务端接口规范](docs/server-integration-contract.md)。
120
120
 
121
121
  ## 开发与复核
122
122
 
@@ -125,7 +125,9 @@ npm ci
125
125
  npm run check
126
126
  ```
127
127
 
128
- 完整检查包括 DSH rc.1 Host/Client/API 契约核对、Host/Client 构建、单元测试、OIDC 安全边界测试、JSON Schema 示例校验、OpenAPI 结构检查、敏感信息扫描和 npm tarball 预检。
128
+ 开发依赖与锁文件固定本轮 DSH `0.1.5-rc.1`,不依赖开发机已有客户端目录。完整检查包括锁文件、所选 DSH 基线的 Host/Client/API 契约核对、Host/Client 构建、单元测试、OIDC 安全边界测试、JSON Schema 示例校验、OpenAPI 结构检查、敏感信息扫描和 npm tarball 预检。
129
+
130
+ 插件版本 `0.2.0` 不与 EduWork 产品版本机械同步。正式装配使用 npm 精确版本及 integrity;源码路径仅用于开发。升级到本版不会替换旧冻结 tarball。开发入口、干净安装和验证边界见 [开发与发布准备](docs/development.md)。
129
131
 
130
132
  详细材料:
131
133
 
@@ -6,8 +6,8 @@
6
6
 
7
7
  ## Runtime peers (not copied into this repository)
8
8
 
9
- - DeepSeek Harness packages `0.1.2-rc.1` and `@deepseek-ai/cordis` `4.0.2` — MIT, Copyright (c) 2026 DeepSeek, <https://github.com/deepseek-ai/deepseek-harness>
10
- - `@earendil-works/pi-ai` `^0.84.2` (`0.84.4` in the reviewed source Runtime) — MIT, <https://github.com/earendil-works/pi>
9
+ - DeepSeek Harness packages `0.1.5-rc.1` and `@deepseek-ai/cordis` `4.0.2` — MIT, Copyright (c) 2026 DeepSeek, <https://github.com/deepseek-ai/deepseek-harness>
10
+ - `@earendil-works/pi-ai` `0.85.1` — MIT, <https://github.com/earendil-works/pi>
11
11
  - React `18.x` — MIT, Copyright (c) Facebook, Inc. and its affiliates, <https://github.com/facebook/react>
12
12
 
13
13
  This repository uses public package APIs and does not vendor their source. Their presence as peer dependencies does not imply endorsement of this project.
@@ -44,8 +44,10 @@ Source: <https://github.com/colinhacks/zod>
44
44
 
45
45
  ## Development-only tools
46
46
 
47
- The repository also declares tsdown (MIT), TypeScript (Apache-2.0), Ajv (MIT), YAML (ISC), and `@types/react` (MIT) for build and validation. They are not included in the npm package's runtime files. Review their transitive licenses and install scripts from the lockfile before release.
47
+ The lock pins the RC.1 DSH test closure plus tsdown (MIT), TypeScript and Playwright Core (Apache-2.0), Ajv (MIT), YAML (ISC), and React types (MIT). Development tools are not copied into the published runtime files. Playwright Core does not download browser binaries during installation.
48
48
 
49
- In the `0.1.0` lockfile, npm reports install scripts on `@google/genai` (a no-op preinstall) and `protobufjs` (postinstall), both reached through the `@earendil-works/pi-ai` peer tree. npm's allow-scripts policy left them unapproved during the preparation install. Release managers must re-review this fact whenever the lockfile changes; `npm audit` reporting zero known vulnerabilities does not replace that review.
49
+ The current lock flags two lifecycle scripts: `@google/genai@1.52.0` has an echo-only preinstall; `protobufjs@7.6.6` reads local package manifests and may emit version-scheme warnings. Its reviewed postinstall contains no download or process execution. The local npm allow-scripts policy left these scripts unapproved; review them again when the lock changes. A successful install is not a security-audit result.
50
50
 
51
- The prepared lockfile contains 230 package entries with declared license metadata: MIT (170), Apache-2.0 (45), BSD-3-Clause (12), ISC (2), and 0BSD (1). This is an inventory result, not legal advice; the release manager must regenerate and review it from the final lockfile.
51
+ `fast-sha256@1.3.0`, reached through pi-ai → Anthropic SDK → standardwebhooks, declares Unlicense. Its distributed LICENSE grants copying, modification and distribution and disclaims warranty. The license check records a package/version-specific exception, not a blanket waiver for unknown licenses; no source is copied into this repository.
52
+
53
+ The reviewed lock has 260 licensed package entries: 0BSD (1), Apache-2.0 (46), BSD-3-Clause (12), ISC (2), MIT (197), Python-2.0 (1), Unlicense (1). Regenerate this inventory for the final release lock.
@@ -6,8 +6,8 @@
6
6
 
7
7
  ## 运行时 Peer(源码未复制进本仓库)
8
8
 
9
- - DeepSeek Harness `0.1.2-rc.1` 软件包和 `@deepseek-ai/cordis` `4.0.2`——MIT,Copyright (c) 2026 DeepSeek,<https://github.com/deepseek-ai/deepseek-harness>
10
- - `@earendil-works/pi-ai` `^0.84.2`(已审查源码 Runtime 中为 `0.84.4`)——MIT,<https://github.com/earendil-works/pi>
9
+ - DeepSeek Harness `0.1.5-rc.1` 软件包和 `@deepseek-ai/cordis` `4.0.2`——MIT,Copyright (c) 2026 DeepSeek,<https://github.com/deepseek-ai/deepseek-harness>
10
+ - `@earendil-works/pi-ai` `0.85.1`——MIT,<https://github.com/earendil-works/pi>
11
11
  - React `18.x`——MIT,Copyright (c) Facebook, Inc. and its affiliates,<https://github.com/facebook/react>
12
12
 
13
13
  本仓库使用这些软件包的公开 API,不 vendor 其源码。它们作为 peer dependency 出现,不表示其作者认可本项目。
@@ -46,8 +46,10 @@ SOFTWARE.
46
46
 
47
47
  ## 仅开发使用的工具
48
48
 
49
- 仓库还声明 tsdown(MIT)、TypeScript(Apache-2.0)、Ajv(MIT)、YAML(ISC)和 `@types/react`(MIT),用于构建与校验。它们不包含在 npm 包运行时文件中。发布前应根据 lockfile 审查其间接许可证和安装脚本。
49
+ 锁文件固定 RC.1 DSH 测试闭包及 tsdown(MIT)、TypeScript/Playwright Core(Apache-2.0)、Ajv(MIT)、YAML(ISC)、React 类型(MIT)。开发工具不复制到发布的运行文件。Playwright Core 安装时不下载浏览器二进制。
50
50
 
51
- 在 `0.1.0` lockfile 中,npm 报告 `@google/genai`(无操作 preinstall)和 `protobufjs`(postinstall)包含安装脚本;二者均来自 `@earendil-works/pi-ai` peer 依赖树。准备安装期间,npm allow-scripts 策略未批准这些脚本。每次 lockfile 变化后,发布经理必须重新审查;`npm audit` 报告零已知漏洞不能替代该审查。
51
+ 当前锁标记两个生命周期脚本:`@google/genai@1.52.0` 只有 echo 的 preinstall;`protobufjs@7.6.6` 读取本地 package manifest,必要时输出版本约定提醒,所审查 postinstall 没有下载和进程执行。此次本机 npm allow-scripts 策略仍未批准这两项;锁变化后应重新审查。安装成功不代表已完成安全审计。
52
52
 
53
- 准备好的 lockfile 含 230 个带许可证元数据的软件包条目:MIT 170 个、Apache-2.0 45 个、BSD-3-Clause 12 个、ISC 2 个和 0BSD 1 个。这只是清单结果,不构成法律意见;发布经理必须从最终 lockfile 重新生成并审查。
53
+ `fast-sha256@1.3.0` 经 pi-ai → Anthropic SDK → standardwebhooks 引入,声明 Unlicense。已核对其分发 LICENSE 中复制、修改、分发授权与免责条款;许可证检查只为该包的该版本记录例外,不放开其他未知许可证。其源码不复制进本仓库。
54
+
55
+ 当前已审查锁共有 260 个声明许可证的软件包条目:0BSD (1), Apache-2.0 (46), BSD-3-Clause (12), ISC (2), MIT (197), Python-2.0 (1), Unlicense (1)。正式发布锁应重新生成清单。
package/cordis.patch.yml CHANGED
@@ -5,4 +5,5 @@
5
5
  - id: enterprise-oidc
6
6
  name: '@eduwork/dsh-oidc'
7
7
  config:
8
- profilePathEnv: DSH_OIDC_ENTERPRISE_PROFILE
8
+ profilePathEnv: EDUWORK_OIDC_PROFILE
9
+ allowEmptyProfiles: true
@@ -1,10 +1,10 @@
1
- # eduwork npm scope migration
1
+ # Package and enterprise-credential migration
2
2
 
3
3
  [简体中文](EDUWORK-MIGRATION.md) | **English**
4
4
 
5
5
  Starting with `0.1.0-alpha.11`, the npm package identity changed to `@eduwork/dsh-oidc`, replacing `dsh-oidc`; `0.1.0` is the first stable semantic version after that migration. The npm `eduwork` organization exists. The GitHub repository and checkout directory remain `dsh-oidc`. Consult the npm registry for current publication status.
6
6
 
7
- ## Installation and migration
7
+ ## Historical npm scope migration (0.1.0)
8
8
 
9
9
  ```sh
10
10
  dsh plugin --profile web add @eduwork/dsh-oidc@0.1.0
@@ -21,3 +21,15 @@ Storage directories and user configuration content do not change. Product-manage
21
21
  ## Release scope
22
22
 
23
23
  `0.1.0` stabilizes the package identity as `@eduwork/dsh-oidc` and targets DSH `0.1.2-rc.1` exactly. Build, tests, documentation, license, and tarball checks cover this change; they do not constitute real institutional sign-in, real email delivery, or production acceptance. Production adoption still requires the complete public-release deployment checks. Keep the old package and scoped alpha versions installable rather than unpublishing them.
24
+
25
+ ## Current 0.2.x candidate: common enterprise credential
26
+
27
+ The default local reference is `EDUWORK_API_KEY`, independent of institution and Provider names. Explicit legacy automatic references derived from the same Profile ID or Provider ID (uppercase, non-alphanumerics replaced with `_`, plus `_API_KEY`) normalize to the new default. Unrelated custom references such as `MY_TEST_MODEL_KEY` remain unchanged. This is a local secret-store name, never a new server request field.
28
+
29
+ An existing Web/desktop session may migrate a legacy key only when issuer, client ID, management URL, runtime URL and Provider ID match and only the reference changes. The destination must be empty; another profile must not claim the source; a saved fingerprint, when present, must match. Migration never imports arbitrary environment keys, overwrites an occupied destination, or trusts a key from a different deployment. Config files are read compatibly rather than overwritten.
30
+
31
+ After a different organization binds the common slot, only the session owning its current fingerprint may call that Provider. Other sessions retain identity but need resource reconnection; their logout cannot delete the new owner's key. Manually configured personal model keys remain untouched. If endpoints change, identity may remain valid while model credentials must be rebound; changed issuer/client ID requires sign-in again. Do not manually copy keys to bypass these checks.
32
+
33
+ Both new desktop shells use the common desktop backend. Legacy `native` account bridges still own their credential storage and must return a matching reference; this plugin does not rewrite OS-vault entries. Plugin migration moves no workspaces, history directories or application data; shell-level data migration belongs to the product.
34
+
35
+ The frozen dev.7 package remains unchanged. `0.2.0` provides the same runtime implementation under a stable semantic version. Distribution assembly pins npm `@eduwork/dsh-oidc@0.2.0` and its integrity with coherent DSH `0.1.5-rc.1` dependencies. Publication status and [release checks](release-checklist.en.md) are recorded separately; no old npm version or public tag is rewritten.
@@ -1,10 +1,10 @@
1
- # eduwork npm 作用域迁移
1
+ # 包名与企业凭据迁移
2
2
 
3
3
  **简体中文** | [English](EDUWORK-MIGRATION.en.md)
4
4
 
5
5
  从 `0.1.0-alpha.11` 起,npm 包改用 `@eduwork/dsh-oidc`,替代旧的 `dsh-oidc`;`0.1.0` 是完成该迁移后的首个稳定语义版本。npm `eduwork` 组织已创建;GitHub 仓库和本地 checkout 目录继续使用 `dsh-oidc`。包的当前发布状态以 npm registry 为准。
6
6
 
7
- ## 安装与迁移
7
+ ## 历史 npm 作用域迁移(0.1.0)
8
8
 
9
9
  ```sh
10
10
  dsh plugin --profile web add @eduwork/dsh-oidc@0.1.0
@@ -21,3 +21,15 @@ dsh plugin --profile web add @eduwork/dsh-oidc@0.1.0
21
21
  ## 发布范围
22
22
 
23
23
  `0.1.0` 将包身份稳定在 `@eduwork/dsh-oidc`,并精确适配 DSH `0.1.2-rc.1`。构建、测试、文档、开源和 tarball 检查针对本次变更执行;这不等于真实学校登录、真实邮件发送或生产部署验收。生产采用仍须完成公开发布检查表中的完整部署验收。旧包和 scoped alpha 保持可安装,不撤回旧版本。
24
+
25
+ ## 当前 0.2.x 候选:统一企业凭据
26
+
27
+ 默认本地引用为 `EDUWORK_API_KEY`,与学校和 Provider 名称无关。同一 Profile ID 或 Provider ID 派生的旧自动引用(转大写,非字母数字换为 `_`,后接 `_API_KEY`)也会规范化为新默认值。其他显式自定义引用如 `MY_TEST_MODEL_KEY` 保持不变。这只是本地秘密存储名称,不是新的服务端请求字段。
28
+
29
+ 旧 Web/desktop 会话只有在 issuer、client ID、管理 URL、运行 URL、Provider ID 全部一致,仅引用改名时才迁移旧 Key。目标槽必须为空,源引用不能被其他 Profile 声明;已有指纹时必须匹配。不会从任意环境变量导入 Key,不覆盖非空目标,也不接纳其他部署的 Key。已有配置文件按兼容规则读取,不会被覆盖改写。
30
+
31
+ 另一机构完成绑定并写入公共槽后,只有拥有当前指纹的会话才能调用该 Provider。其他会话保留身份但需重新连接资源;它们注销时不能删除新所有者的 Key。用户单独配置的个人模型 Key 不受影响。资源端点改变可保留身份,但必须重新绑定模型凭据;issuer/client ID 改变需重新登录。不要手动复制 Key 绕过归属校验。
32
+
33
+ 两种新桌面壳共用 desktop backend。旧 `native` 账号桥仍由宿主管理凭据存储并返回匹配引用;本插件不改写操作系统凭据库。插件迁移不搬动工作区、历史目录或应用数据;更换桌面壳的数据迁移由产品处理。
34
+
35
+ 已冻结 dev.7 包保持原样。`0.2.0` 将同一运行实现按稳定语义版本提供,正式装配固定 npm `@eduwork/dsh-oidc@0.2.0` 和 integrity,并统一宿主 DSH `0.1.5-rc.1` 依赖;发布状态和[发布检查](release-checklist.md)分别记录,不重写旧 npm 版本或公开 tag。
@@ -0,0 +1,40 @@
1
+ # Institution account extensions
2
+
3
+ [简体中文](account-extensions.md) | **English**
4
+
5
+ As of `0.2.0-dev.20260910.6`, public OIDC owns identity, managed model keys, models/default selection and sign-out. Quota HTTP, normalization and presentation are external, and public OIDC sends no heartbeat. `resources(profileID)` returns only `{profileID, modelSource, models, issues}`. Extracting quota alone does not require a new login. The dev.7 credential rename migrates only verified ownership and an identical deployment binding; unproven ownership retains identity but requires model-resource reconnection. Deploy matching client and Host type descriptors.
6
+
7
+ ## Host transport
8
+
9
+ An institution plugin depends on `oidcAccounts` and MUST first check its explicitly configured `profileIDs` allowlist. Installing an institution edition does not authorize quota requests for every organization the user adds.
10
+
11
+ ```js
12
+ const response = await ctx.oidcAccounts.modelResourceFetch(profileID, '/quota', { signal })
13
+ ```
14
+
15
+ This Host-only method has no Remote decorator and never exposes credentials. It uses the configured `profile.provider.baseURL`, active identity and current managed model key; `provider` and `keyBinding` are required. Only GET is supported. Paths consist of slash-separated letters, digits, underscores or hyphens; absolute URLs, query/hash, escaped or dot paths and extra options are rejected. Redirects are denied, timeout is 20 seconds, and the buffered response limit is 1 MiB. HTTP failures return Response; the extension defines safe user-facing states. Do not display raw request/response secrets.
16
+
17
+ Logout or key replacement during response reading invalidates the result. The extension MUST also subscribe to `oidc/accounts-changed` and `credentials/reference-updated`, invalidate its generation, and check that generation after async operations. Abort requests on disposal. The public package does not cache extension data.
18
+
19
+ For identity-token services, use the separate `authorizedFetch(profileID, endpoint, init)` method with approved origins, token refresh and one 401 retry. See [the public protocol](public-resource-protocol.en.md). Neither transport schedules business requests itself.
20
+
21
+ ## Client account menu
22
+
23
+ The public sidebar account declares the official `oidc.account.menu.details` child slot, `kind: single`, `scope: root`. Use `slots.inject()` before registering the occupant. Public UI continues to own identity, login, model credential provisioning and sign-out.
24
+
25
+ | Owner prop | Meaning |
26
+ | --- | --- |
27
+ | `profile`, `status` | Trusted configuration and non-secret current state; read-only |
28
+ | `busy` | Public account operation in progress; disable competing operations |
29
+ | `run(operation)` | Shared busy/error handling for an async user action |
30
+ | `refreshAccount()` | Reconcile identity/model connection without automatic provisioning |
31
+ | `defaultContent` | Public Refresh account action; return it for inapplicable profiles |
32
+
33
+ ```js
34
+ ctx.slots.inject('oidc.account.menu.details', () =>
35
+ ctx.slots.register({ name: 'oidc.account.menu.details', priority: -100 }, Details))
36
+ ```
37
+
38
+ The extension owns its own RPC/schema. Check explicit profile ID, provider configuration and `status.credentialReady` before reading; otherwise return `defaultContent` without querying quota. Discard late results after account change, sign-out or unmount. Focusable actions use `role="menuitem"` to share arrow/Escape/outside-focus behavior. Refresh must not replace a personal model selected later by the user.
39
+
40
+ An ECNU extension may display model allowance, reset dates, resource packs, details and refresh. Missing quantities are unknown; without a total, do not invent percentages. Its `/quota` wire is an institution contract outside the public resource protocol.
@@ -0,0 +1,42 @@
1
+ # 机构账户扩展接口
2
+
3
+ **简体中文** | [English](account-extensions.en.md)
4
+
5
+ 从 `0.2.0-dev.20260910.6` 起,公版负责 OIDC 身份、托管模型 Key、模型目录、默认模型与注销;不再包含配额请求、字段归一化或配额 UI,也不发送心跳。`resources(profileID)` 只返回 `{profileID, modelSource, models, issues}`。配额拆分本身不要求重新登录;dev.7 的凭据改名按完整绑定与归属校验迁移,无法证明归属时保留身份并重新连接模型。安装新客户端和公共包须使用一致的类型描述。
6
+
7
+ ## Host 授权传输
8
+
9
+ 机构插件可以依赖 `oidcAccounts` 服务,但必须先用自己的显式 `profileIDs` 白名单判断请求对象。不能仅凭“安装在机构发行版”就查询用户后来添加的其他企业。
10
+
11
+ ```js
12
+ const response = await ctx.oidcAccounts.modelResourceFetch(profileID, '/quota', { signal })
13
+ ```
14
+
15
+ 这是 Host 专属方法,**没有 Remote 标记**,不向客户端返回 Key。请求使用已配置的 `profile.provider.baseURL` 和当前托管模型 Key;需要已配置 `provider`、`keyBinding` 和有效登录。只允许 GET,路径必须是 `/segment` 形式(字母、数字、下划线、连字符,可多级),拒绝 URL、查询、片段、编码路径、点段和额外请求选项。请求不跟随重定向,超时 20 秒,缓冲响应最多 1 MiB。HTTP 错误仍返回 Response,由扩展定义友好状态。网络异常和身份变化可能抛出错误;扩展不得向 UI 回显原始请求或响应中的秘密。
16
+
17
+ 读取响应期间注销或替换 Key 会拒绝结果。扩展还必须在自身层订阅 `oidc/accounts-changed` 和 `credentials/reference-updated`,失效正在请求的账户快照;每次异步操作结束后检查世代编号,不能将旧用户结果写入新用户状态。扩展卸载时中止请求。公版不缓存扩展资源。
18
+
19
+ 需要 OIDC 身份 Token 的机构服务仍用 `authorizedFetch(profileID, endpoint, init)`:它遵循已批准的 origin、令牌刷新及一次 401 重试,与上述模型 Key 运输不同。见 [公共身份与资源协议](public-resource-protocol.md)。这两个方法都不会自动触发业务请求。
20
+
21
+ ## 客户端账户菜单
22
+
23
+ 公共 `ui.sidebar.footer.account` 注册一个官方 DSH 子插槽 `oidc.account.menu.details`,类型 `single`、作用域 `root`。可选扩展通过 `slots.inject()` 等待插槽,然后 `slots.register()` 注册组件。公共部分始终拥有身份信息、登录、模型凭据创建及注销;扩展只提供中间附加内容。
24
+
25
+ 组件接收以下 owner props:
26
+
27
+ | 字段 | 含义 |
28
+ | --- | --- |
29
+ | `profile`, `status` | 当前受信配置与无秘密的账户状态;不可修改 |
30
+ | `busy` | 公共账户操作进行中,扩展操作应禁用 |
31
+ | `run(operation)` | 运行用户操作,复用忙碌及错误呈现;operation 不应泄露响应正文 |
32
+ | `refreshAccount()` | 重新核实账户和模型连接,不自动 Provision |
33
+ | `defaultContent` | 公共“刷新账户”按钮;不适用的组织必须返回它 |
34
+
35
+ ```js
36
+ ctx.slots.inject('oidc.account.menu.details', () =>
37
+ ctx.slots.register({ name: 'oidc.account.menu.details', priority: -100 }, Details))
38
+ ```
39
+
40
+ 扩展自定义 RPC 与字段 schema 归自己的包。组件必须根据明确配置的 profile ID、Provider 是否存在和 `status.credentialReady` 决定是否读取;不匹配或缺少 Key 时返回 `defaultContent`,不得请求配额。账户切换、退出及组件卸载后丢弃迟到结果。可聚焦操作使用 `role="menuitem"`,复用公共菜单的方向键、Escape 与失焦关闭规则。刷新不应夺走用户后来选择的个人模型。
41
+
42
+ ECNU 发行方的独立扩展可以提供模型额度、资源包、重置时间、详情和刷新。数量缺失代表未知;没有总量不能绘制百分比。该业务及其 `/quota` wire 不属于公共资源协议。