@awiki/dsh-plugin 0.2.5 → 0.3.0-rc.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 (110) hide show
  1. package/README.md +63 -23
  2. package/README.zh.md +55 -20
  3. package/THIRD_PARTY_NOTICES.md +1 -1
  4. package/cordis.patch.yml +0 -8
  5. package/lib/client.js +5452 -1849
  6. package/lib/client.js.map +1 -1
  7. package/lib/index.js +950 -38
  8. package/lib/model-proxy-contract.js +8 -1
  9. package/lib/provider.js +3 -1
  10. package/lib/{sdk-adapter-DKgkyApB.mjs → sdk-adapter-DLhLrLI6.mjs} +219 -2
  11. package/lib/typert.host.js +796 -49
  12. package/lib/typert.remote-client.d.ts +33 -1
  13. package/lib/typert.remote-client.d.ts.map +1 -1
  14. package/lib/typert.remote-client.js +796 -49
  15. package/lib/types/client/AwikiGroupDetails.d.ts +16 -0
  16. package/lib/types/client/AwikiGroupDetails.d.ts.map +1 -0
  17. package/lib/types/client/AwikiGroupDetails.js +108 -0
  18. package/lib/types/client/AwikiGroupDetails.js.map +1 -0
  19. package/lib/types/client/AwikiIdentityAccess.d.ts +21 -0
  20. package/lib/types/client/AwikiIdentityAccess.d.ts.map +1 -0
  21. package/lib/types/client/AwikiIdentityAccess.js +148 -0
  22. package/lib/types/client/AwikiIdentityAccess.js.map +1 -0
  23. package/lib/types/client/AwikiIdentityPage.d.ts +11 -0
  24. package/lib/types/client/AwikiIdentityPage.d.ts.map +1 -0
  25. package/lib/types/client/AwikiIdentityPage.js +8 -0
  26. package/lib/types/client/AwikiIdentityPage.js.map +1 -0
  27. package/lib/types/client/AwikiMail.d.ts +2 -1
  28. package/lib/types/client/AwikiMail.d.ts.map +1 -1
  29. package/lib/types/client/AwikiMail.js +153 -33
  30. package/lib/types/client/AwikiMail.js.map +1 -1
  31. package/lib/types/client/AwikiOnboarding.d.ts.map +1 -1
  32. package/lib/types/client/AwikiOnboarding.js +26 -9
  33. package/lib/types/client/AwikiOnboarding.js.map +1 -1
  34. package/lib/types/client/AwikiOverlay.d.ts +0 -5
  35. package/lib/types/client/AwikiOverlay.d.ts.map +1 -1
  36. package/lib/types/client/AwikiOverlay.js +136 -124
  37. package/lib/types/client/AwikiOverlay.js.map +1 -1
  38. package/lib/types/client/AwikiProfileCard.d.ts +9 -0
  39. package/lib/types/client/AwikiProfileCard.d.ts.map +1 -0
  40. package/lib/types/client/AwikiProfileCard.js +90 -0
  41. package/lib/types/client/AwikiProfileCard.js.map +1 -0
  42. package/lib/types/client/AwikiRecoveryForm.d.ts +24 -0
  43. package/lib/types/client/AwikiRecoveryForm.d.ts.map +1 -0
  44. package/lib/types/client/AwikiRecoveryForm.js +148 -0
  45. package/lib/types/client/AwikiRecoveryForm.js.map +1 -0
  46. package/lib/types/client/AwikiSettingsSection.d.ts +0 -2
  47. package/lib/types/client/AwikiSettingsSection.d.ts.map +1 -1
  48. package/lib/types/client/AwikiSettingsSection.js +13 -15
  49. package/lib/types/client/AwikiSettingsSection.js.map +1 -1
  50. package/lib/types/client/MentionText.d.ts +7 -0
  51. package/lib/types/client/MentionText.d.ts.map +1 -0
  52. package/lib/types/client/MentionText.js +10 -0
  53. package/lib/types/client/MentionText.js.map +1 -0
  54. package/lib/types/client/controller.d.ts +94 -2
  55. package/lib/types/client/controller.d.ts.map +1 -1
  56. package/lib/types/client/controller.js +466 -13
  57. package/lib/types/client/controller.js.map +1 -1
  58. package/lib/types/client/index.d.ts.map +1 -1
  59. package/lib/types/client/index.js +21 -4
  60. package/lib/types/client/index.js.map +1 -1
  61. package/lib/types/client/mail-list-cache.d.ts +15 -0
  62. package/lib/types/client/mail-list-cache.d.ts.map +1 -0
  63. package/lib/types/client/mail-list-cache.js +212 -0
  64. package/lib/types/client/mail-list-cache.js.map +1 -0
  65. package/lib/types/client/mentions.d.ts +51 -0
  66. package/lib/types/client/mentions.d.ts.map +1 -0
  67. package/lib/types/client/mentions.js +165 -0
  68. package/lib/types/client/mentions.js.map +1 -0
  69. package/lib/types/client/model-proxy-controller.d.ts +4 -0
  70. package/lib/types/client/model-proxy-controller.d.ts.map +1 -1
  71. package/lib/types/client/model-proxy-controller.js +68 -3
  72. package/lib/types/client/model-proxy-controller.js.map +1 -1
  73. package/lib/types/client/settings-locales.js +8 -8
  74. package/lib/types/client/settings-locales.js.map +1 -1
  75. package/lib/types/client/slots.d.ts +21 -2
  76. package/lib/types/client/slots.d.ts.map +1 -1
  77. package/lib/types/index.d.ts +40 -6
  78. package/lib/types/index.d.ts.map +1 -1
  79. package/lib/types/index.js +523 -23
  80. package/lib/types/index.js.map +1 -1
  81. package/lib/types/model-proxy-contract.d.ts +6 -0
  82. package/lib/types/model-proxy-contract.d.ts.map +1 -1
  83. package/lib/types/model-proxy-contract.js +6 -0
  84. package/lib/types/model-proxy-contract.js.map +1 -1
  85. package/lib/types/provider-api.d.ts +29 -1
  86. package/lib/types/provider-api.d.ts.map +1 -1
  87. package/lib/types/provider.d.ts.map +1 -1
  88. package/lib/types/provider.js +2 -0
  89. package/lib/types/provider.js.map +1 -1
  90. package/lib/types/sdk-adapter.d.ts +18 -1
  91. package/lib/types/sdk-adapter.d.ts.map +1 -1
  92. package/lib/types/sdk-adapter.js +244 -2
  93. package/lib/types/sdk-adapter.js.map +1 -1
  94. package/lib/types/sent-mail-store.d.ts +22 -0
  95. package/lib/types/sent-mail-store.d.ts.map +1 -0
  96. package/lib/types/sent-mail-store.js +246 -0
  97. package/lib/types/sent-mail-store.js.map +1 -0
  98. package/lib/types/types.d.ts +152 -2
  99. package/lib/types/types.d.ts.map +1 -1
  100. package/lib/types/types.js.map +1 -1
  101. package/package.json +15 -26
  102. package/lib/model-proxy.js +0 -383
  103. package/lib/types/client/model-account-settings-availability.d.ts +0 -4
  104. package/lib/types/client/model-account-settings-availability.d.ts.map +0 -1
  105. package/lib/types/client/model-account-settings-availability.js +0 -4
  106. package/lib/types/client/model-account-settings-availability.js.map +0 -1
  107. package/lib/types/model-proxy.d.ts +0 -14
  108. package/lib/types/model-proxy.d.ts.map +0 -1
  109. package/lib/types/model-proxy.js +0 -371
  110. package/lib/types/model-proxy.js.map +0 -1
package/README.md CHANGED
@@ -6,9 +6,10 @@ the model tools, and a Web client with a draggable AWiki Me launcher.
6
6
 
7
7
  [中文说明](./README.zh.md)
8
8
 
9
- Registration failures preserve the form and local pending identity material. Closed registration,
10
- unavailable verification state, and commit conflicts each give a safe next action without exposing
11
- remote response details.
9
+ Identity-entry failures preserve the currently mounted form and local pending identity material. The
10
+ phone and OTP never enter browser persistence, controller snapshots, or public
11
+ Remote results. Closed registration, unavailable verification state, and commit conflicts each give
12
+ a safe next action without exposing remote response details.
12
13
 
13
14
  The Rust SDK exclusively owns the identity, SecretVault, database, cache, and metadata below the
14
15
  configured `stateRoot`. This release performs a clean cutover and does not import the former
@@ -16,23 +17,33 @@ TypeScript SDK `identity.json`; create a new Rust-backed identity after upgradin
16
17
 
17
18
  ## Features
18
19
 
19
- - Register one deployment-level AWiki identity from the Web UI.
20
- - Open the top-left AWiki account menu to sign out locally without deleting the encrypted identity or message database; **Resume** restores the same DID and Handle, including across DSH restarts.
20
+ - Enter a Handle and phone through one Web UI flow. Before any code is sent, the Host classifies the Handle: a new Handle receives a registration OTP and creates the deployment identity, while an existing Handle receives one Recovery V4 OTP and enters the recovery state machine directly.
21
+ - Open the top-left AWiki account menu to sign out locally without deleting the encrypted identity or message database; **Resume local identity** restores the same DID and Handle, including across DSH restarts. The signed-out screen reveals phone recovery only after local resume fails. Switching identities requires an explicit confirmation that permanently clears local AWiki data first.
21
22
  - Reuse that identity across the root Agent and its subagents.
22
- - Direct-message and existing-group conversation lists, unread counts, latest-message previews, and persisted display names. Core SQLite remains the persistent source of truth: the Host joins persisted peer profiles onto Direct roster rows, while the browser keeps the active identity's last trustworthy Direct profile and group title. Sparse polling identifiers therefore cannot overwrite a resolved display name or real group title. Opening a conversation renders the committed local timeline first, hydrates group sender labels from the Core display-profile cache, reconciles remote history and Direct profile data in the background, and keeps local messages visible if refresh fails. A failed background roster poll also leaves the usable local view quiet; explicit loads still surface their errors. This local-first path covers the newest projected page; loading older messages still requires the remote history service. Scrolling up reveals a latest-message control that counts newer arrivals without interrupting reading. A conversation is marked read only after its newest rendered message reaches the visible bottom.
23
+ - Direct-message and existing-group conversation lists, unread counts, latest-message previews, and persisted display names. Core SQLite remains the persistent source of truth: the Host joins persisted peer profiles onto Direct roster rows, while the browser keeps the active identity's last trustworthy Direct profile and group title. Sparse polling identifiers therefore cannot overwrite a resolved display name or real group title. After an existing Handle is recovered, the Host synchronizes account projections before asking Core to restore old group memberships; pending or blocked groups expose a retryable status without disabling Direct messages or other groups. Opening a conversation renders the committed local timeline first, hydrates group sender labels from the Core display-profile cache, reconciles remote history and Direct profile data in the background, and keeps local messages visible if refresh fails. A failed background roster poll also leaves the usable local view quiet; explicit loads still surface their errors. This local-first path covers the newest projected page; loading older messages still requires the remote history service. Scrolling up reveals a latest-message control that counts newer arrivals without interrupting reading. A conversation is marked read only after its newest rendered message reaches the visible bottom.
23
24
  - Create a private-discovery, open-join, transport-protected group from the Web UI with a name and 1–50 initial Handle or DID members. The group opens immediately; members that could not be added are reported without hiding the successfully created group.
24
25
  - Text messages plus one attachment per message, with Enter-to-send, Shift+Enter line breaks, optimistic sending bubbles reconciled by an exact client message ID, image previews, and SHA verification. Verified image bytes use three bounded layers: a browser-runtime LRU makes conversation remounts immediate, identity-scoped IndexedDB survives full page reloads without a Host call, and the private Host disk cache survives browser-storage loss and Harness restarts. Clear Local Data removes all three layers.
25
26
  - A draggable circular launcher, adaptive popup placement, dark mode, and remembered active conversation.
26
27
  - User-triggered AI summaries for up to 50 recent or unread messages, kept only in runtime memory with explicit stale, retry, copy, and source-navigation states.
27
- - OTP registration keeps the verification form visible and disables resend with a visible server-directed cooldown countdown.
28
- - An AWiki-hosted DeepSeek choice before the official API-key onboarding step only when Harness has no usable model provider, with an explicit opt-in and an unchanged API-key escape path. New sessions do not show AWiki model or payment prompts after the official or another provider is usable.
29
- - A Host-only short-token flow registering `awiki-deepseek` with `deepseek-v4-flash` and `deepseek-v4-pro`; Flash is recommended and credentials never enter the Browser.
30
- - Account & Recharge, Usage, and Advanced tabs in DSH Settings for explicit model state, calculated versus charged usage, and the durable validated Handle domain.
28
+ - OTP identity access keeps the verification form visible and disables resend with a visible server-directed cooldown countdown. Handle classification happens before OTP delivery, so each attempt sends exactly one purpose-correct registration or recovery code.
29
+ - When the separate `@awiki/dsh-model-proxy` package is installed, an AWiki-hosted DeepSeek choice appears before the official API-key onboarding step only when Harness has no usable model provider, with an explicit opt-in and an unchanged API-key escape path. New sessions do not show AWiki model or payment prompts after the official or another provider is usable.
30
+ - The optional model-proxy package owns the Host-only short-token flow registering `awiki-deepseek` with `deepseek-v4-flash` and `deepseek-v4-pro`; Flash is recommended and credentials never enter the Browser.
31
+ - Advanced AWiki settings are always available. Account & Recharge and Usage tabs appear only when `@awiki/dsh-model-proxy` is loaded, exposing explicit model state and calculated versus charged usage.
31
32
  - A typed second confirmation in the Settings danger zone before permanently clearing local AWiki identity, key, token, registration-draft, and message-index state.
32
33
  - Five messaging Agent tools: identity status, conversations, history, approved text send, and approved attachment send.
33
34
  - Five on-demand mail Agent tools: mailbox account, inbox, plain-text read, approved mark-read, and approved plain-text send.
34
35
  - An opt-in realtime listener that lets exact-allowlisted Direct peers continue one DSH Agent session or use `/new`, `/status`, and `/help`.
35
36
 
37
+ ## Screenshots
38
+
39
+ ### Messaging
40
+
41
+ ![AWiki direct and group messaging in DeepSeek Harness](./assets/screenshots/awiki-messaging.png)
42
+
43
+ ### Mail
44
+
45
+ ![AWiki mailbox in DeepSeek Harness](./assets/screenshots/awiki-mail.jpg)
46
+
36
47
  The first release does not implement end-to-end encryption, multiple identities,
37
48
  post-creation group administration or multiple attachments in one message. The Agent listener accepts only
38
49
  plain Direct text; Groups, attachments, encrypted/payload content, and unknown slash commands never
@@ -53,6 +64,13 @@ Install the official public npm package:
53
64
  dsh plugin --profile web add @awiki/dsh-plugin@latest
54
65
  ```
55
66
 
67
+ The main package no longer installs the AWiki-hosted model provider. Add the
68
+ independently versioned Host-only package only when that capability is wanted:
69
+
70
+ ```bash
71
+ dsh plugin --profile web add @awiki/dsh-model-proxy@latest
72
+ ```
73
+
56
74
  The profile installer both adds the package and activates its bundle layer. A
57
75
  plain `npm i @awiki/dsh-plugin` in a DSH project only installs the package; it
58
76
  does not activate the bundle, so the profile command remains the recommended
@@ -65,8 +83,11 @@ families in a DSH root dependency tree.
65
83
  not an installation source for this release line.
66
84
 
67
85
  Apply the package after the normal DSH base and Web app bundles. Its
68
- `cordis.patch.yml` adds the Host service and provider; DSH discovers and injects
69
- the browser client through the package metadata.
86
+ The main `cordis.patch.yml` adds the AWiki Host service, Rust SDK provider, and
87
+ summary provider; DSH discovers and injects the browser client through the
88
+ package metadata. It does not insert Model Proxy. The optional package has its
89
+ own patch, inserts exactly one `awiki-model-proxy` row after AWiki, and declares
90
+ an explicit dependency on the loaded `awiki` service.
70
91
 
71
92
  ## Configuration
72
93
 
@@ -94,18 +115,34 @@ The plugin works against the public `awiki.ai` tenant without environment config
94
115
  | `DSH_AWIKI_SUMMARY_MAX_INPUT_BYTES` | UTF-8 cap after Host-side summary minimization | `32768` |
95
116
  | `DSH_AWIKI_SUMMARY_TIMEOUT_MS` | One-shot model deadline | `30000` |
96
117
  | `DSH_AWIKI_SUMMARY_MAX_OUTPUT_TOKENS` | Structured summary output cap | `768` |
97
- | `DSH_AWIKI_MODEL_PROXY_URL` | AWiki-hosted DeepSeek proxy root URL | `https://model.awiki.info` |
98
- | `DSH_AWIKI_MODEL_CONTEXT_WINDOW` | AWiki-hosted DeepSeek context window | `1000000` |
99
- | `DSH_AWIKI_MODEL_MAX_TOKENS` | Maximum AWiki-hosted DeepSeek output | `8192` |
100
- | `DSH_AWIKI_MODEL_TOKEN_REFRESH_SKEW_SECONDS` | Early short-token refresh interval | `60` |
101
-
102
118
  ## AWiki-hosted DeepSeek account
103
119
 
104
- `@awiki/dsh-plugin/model-proxy` uses `ctx.awiki.externalHttpAuth` to obtain a short-lived
120
+ This capability now requires the separate `@awiki/dsh-model-proxy` package. It
121
+ uses `ctx.awiki.externalHttpAuth` to obtain a short-lived
105
122
  model token inside the Host and reuses the Harness DeepSeek adapter. The Browser receives only
106
123
  sanitized account, usage, and order state over a loopback RPC channel. DID signatures, bearer
107
124
  tokens, and upstream platform credentials are absent from the browser bundle.
108
125
 
126
+ The former runtime import `@awiki/dsh-plugin/model-proxy` has been removed. Use
127
+ `@awiki/dsh-model-proxy`; the shared browser-safe contract intentionally remains
128
+ `@awiki/dsh-plugin/model-proxy-contract`. Installing only the main package keeps
129
+ model onboarding, account/recharge, and usage entry points hidden while leaving
130
+ AWiki Advanced settings functional.
131
+
132
+ This RC split starts with `@awiki/dsh-plugin@0.3.0-rc.1` and
133
+ `@awiki/dsh-model-proxy@0.1.0-rc.1`. The optional package requires main `^0.3.0-rc.1`, so
134
+ it cannot be combined with a `0.2.x` main package that still inserted the old
135
+ runtime by default.
136
+
137
+ The optional package owns these configuration variables:
138
+
139
+ | Variable | Purpose | Default |
140
+ | --- | --- | --- |
141
+ | `DSH_AWIKI_MODEL_PROXY_URL` | AWiki-hosted DeepSeek proxy root URL | `https://model.awiki.info` |
142
+ | `DSH_AWIKI_MODEL_CONTEXT_WINDOW` | AWiki-hosted DeepSeek context window | `1000000` |
143
+ | `DSH_AWIKI_MODEL_MAX_TOKENS` | Maximum AWiki-hosted DeepSeek output | `8192` |
144
+ | `DSH_AWIKI_MODEL_TOKEN_REFRESH_SKEW_SECONDS` | Early short-token refresh interval | `60` |
145
+
109
146
  AWiki-hosted DeepSeek is disabled by default. Only an explicit choice in onboarding or Settings → AWiki →
110
147
  Account & Recharge registers the `awiki-deepseek` route and selects Flash. Disabling restores the
111
148
  previous provider, model, and reasoning effort. A successful recharge refreshes the balance but
@@ -149,8 +186,11 @@ recovered by the app, and this installation may lose access to the old identity.
149
186
 
150
187
  Ordinary sign-out is separate from that destructive action. It writes only a private
151
188
  Host-owned session marker, gates both Web and Agent operations, and retains the SDK-owned
152
- SecretVault identity, keys, tokens, conversations, attachment index, and cached image previews. Resuming removes
153
- the marker and reloads the same local identity without registration.
189
+ SecretVault identity, keys, tokens, conversations, attachment index, and cached image previews. **Resume local
190
+ identity** removes the marker and reloads that identity without registration. The signed-out screen does not
191
+ show a competing recovery path by default; phone recovery appears only after resume fails. **Use another
192
+ identity** requires a checked destructive-data confirmation and returns to the unified Handle entry only after
193
+ local clearing succeeds, where the same form creates a new identity or recovers an existing one.
154
194
 
155
195
  The provider domain and message-service DID are protocol identifiers. Do not
156
196
  infer them from an API hostname. Production service URLs must use HTTPS. The IM Core state directory contains access material;
@@ -216,15 +256,15 @@ Web client bundle. Exposing it across an untrusted boundary would create a signi
216
256
 
217
257
  ## Development
218
258
 
219
- Requirements: Node.js 22.19+ (or 24+) and pnpm 11.7.
259
+ Requirements: Node.js 22.19+ (or 24+) and pnpm 11.22.
220
260
 
221
261
  ```bash
222
262
  pnpm install --frozen-lockfile
223
- pnpm run verify
263
+ pnpm run verify:workspace
224
264
  pnpm pack --dry-run
225
265
  ```
226
266
 
227
- The production Host loads the exact `@awiki/im-core-node@0.1.5` runtime package;
267
+ The production Host loads the exact `@awiki/im-core-node@0.1.6` runtime package;
228
268
  the platform-specific native addon is selected through its optional dependencies
229
269
  and remains external to the JavaScript bundle. Consumers do not need Rust or an
230
270
  `awiki-cli-rs2` checkout. See `THIRD_PARTY_NOTICES.md` for provenance and
package/README.zh.md CHANGED
@@ -10,23 +10,33 @@ Rust 身份。
10
10
 
11
11
  ## 功能
12
12
 
13
- - 在 Web UI 中注册一个部署级 AWiki 身份,根 Agent 与子 Agent 共用。
14
- - 点击 AWiki 面板左上角图标可打开账户菜单;普通退出只锁定本机会话,不删除加密身份或消息数据库,重新进入及重启 DSH 后仍恢复同一个 DID 和 Handle
15
- - 注册失败时保留手机号、Handle、验证码和本机待注册密钥;注册未开放、验证码状态失效和提交冲突会给出对应的安全处理提示。
16
- - 私聊和已有群聊列表、未读角标、最新消息预览、时间更新与昵称持久化。Core SQLite 是持久化真相源:Host 将持久化的对端资料合并进私聊列表,浏览器再按当前身份保留最后一次可信的私聊资料和群名,稀疏轮询中的 Handle、DID 或 Group DID 占位不会覆盖真实名称。打开会话时先显示 Core 已提交的本地时间线,并从 Core 显示资料缓存补齐群消息发送者名称,再在后台补齐远端历史和私聊资料;刷新失败不会清空本地消息。后台会话轮询失败也不会用全局红条打断仍可用的本地页面,用户主动加载失败仍会正常提示。当前 local-first 只覆盖本地最新一页,“加载更早消息”仍需访问远端 history。向上阅读时显示下滑箭头,新消息到达后在同一控件中累计数量且不打断阅读位置。只有最新一条已渲染消息到达可视区域底部后,当前会话才会自动标记为已读。
13
+ - 在 Web UI 的统一入口输入 Handle 和手机号。Host 会在发送验证码前判断 Handle 状态:新 Handle 只发送注册验证码并创建部署级身份,已有 Handle 只发送 Recovery V4 恢复验证码并直接进入恢复流程;根 Agent 与子 Agent 共用最终身份。
14
+ - 点击 AWiki 面板左上角图标可打开账户菜单;普通退出只锁定本机会话,不删除加密身份或消息数据库,重新进入及重启 DSH 后仍恢复同一个 DID 和 Handle。退出页默认只提供重新进入本机身份和使用其他身份;只有本机重新进入失败后才显示手机号恢复入口。改用其他身份必须先确认永久清除本地 AWiki 数据。
15
+ - 身份入口失败时保留当前挂载表单中的手机号、Handle 和验证码,以便修正后重试;手机号和验证码不进入 Browser 持久化状态、controller snapshot 或公开 Remote 结果。仅恢复操作编号可用于崩溃续跑。注册未开放、验证码状态失效和提交冲突会给出对应的安全处理提示。
16
+ - 私聊和已有群聊列表、未读角标、最新消息预览、时间更新与昵称持久化。Core SQLite 是持久化真相源:Host 将持久化的对端资料合并进私聊列表,浏览器再按当前身份保留最后一次可信的私聊资料和群名,稀疏轮询中的 Handle、DID 或 Group DID 占位不会覆盖真实名称。恢复已有 Handle 后,Host 会先同步账号投影,再让 Core 自动恢复旧群聊成员身份;未完成或受阻的群聊会显示可重试状态,但不影响私聊和其他群聊。打开会话时先显示 Core 已提交的本地时间线,并从 Core 显示资料缓存补齐群消息发送者名称,再在后台补齐远端历史和私聊资料;刷新失败不会清空本地消息。后台会话轮询失败也不会用全局红条打断仍可用的本地页面,用户主动加载失败仍会正常提示。当前 local-first 只覆盖本地最新一页,“加载更早消息”仍需访问远端 history。向上阅读时显示下滑箭头,新消息到达后在同一控件中累计数量且不打断阅读位置。只有最新一条已渲染消息到达可视区域底部后,当前会话才会自动标记为已读。
17
17
  - 可从 Web UI 输入群名和 1–50 个 Handle 或 DID 发起私有发现、开放加入、传输保护的群聊。建群成功后立即进入新会话;个别成员添加失败会单独提示,不会隐藏已经创建的群。
18
18
  - 文本和单附件消息;Enter 发送、Shift+Enter 换行,发送中立即显示带 loading 动画的乐观气泡,并通过精确的客户端消息 ID 与已提交消息对账,避免同一条消息显示两个气泡;同时支持图片预览、附件说明与 SHA 校验。校验通过的图片字节使用三层有界缓存:浏览器运行期 LRU 让会话重新挂载时立即出图,按身份隔离的 IndexedDB 在整页刷新后无需访问 Host,Host 私有磁盘缓存则应对浏览器缓存丢失并跨 Harness 重启复用;“清除本地数据”会删除三层缓存。
19
19
  - 圆形可拖动入口、自适应四角弹窗、深色模式和当前会话记忆。
20
20
  - 用户点击后才生成的 AI 对话总结:最多处理 50 条最近或未读消息,按会话保留本次运行期缓存,并支持过期提示、重试、复制与跳转原消息。
21
- - OTP 注册会保留验证码输入表单,并按服务端返回的冷却时间显示重发倒计时、禁用提前重发。
22
- - 仅在 Harness 没有任何可用模型时,首次引导才会在官方 API Key 步骤前提供 AWiki 托管模型选项;用户可以明确启用,也可以跳过并继续原版 API Key 流程。已经配置官方或其他 Provider 时,新会话不会显示 AWiki 模型或支付提示。
23
- - 通过 Host 内部短期 Token 注册 `awiki-deepseek` Provider,提供 `deepseek-v4-flash` 和 `deepseek-v4-pro`,默认推荐 Flash;Token 不进入 Browser。
24
- - DSH 设置中提供“账户与充值、用量明细、高级设置”三页,可显式启停模型、查看计算费用和实际扣费,并持久化修改默认 Handle 域名。
21
+ - OTP 身份入口会保留验证码输入表单,并按服务端返回的冷却时间显示重发倒计时、禁用提前重发;Handle 分流发生在发送前,因此每次只会发送一个用途正确的注册或恢复验证码。
22
+ - 安装独立的 `@awiki/dsh-model-proxy` 后,仅在 Harness 没有任何可用模型时,首次引导才会在官方 API Key 步骤前提供 AWiki 托管模型选项;用户可以明确启用,也可以跳过并继续原版 API Key 流程。已经配置官方或其他 Provider 时,新会话不会显示 AWiki 模型或支付提示。
23
+ - 可选 Model Proxy 包独占 Host 内部短期 Token `awiki-deepseek` Provider,提供 `deepseek-v4-flash` 和 `deepseek-v4-pro`,默认推荐 Flash;Token 不进入 Browser。
24
+ - “高级设置”始终可用;只有加载 `@awiki/dsh-model-proxy` 后才显示“账户与充值”和“用量明细”,用于显式启停模型并查看计算费用和实际扣费。
25
25
  - 在设置页危险区域中,经输入确认词的二次确认后,永久清空本机 AWiki 身份、密钥、令牌、注册草稿和消息索引。
26
26
  - 五个消息 Agent 工具:身份、会话、历史、需审批的文本发送和需审批的附件发送。
27
27
  - 五个按需邮件 Agent 工具:邮箱账户、收件箱、纯文本读取、需审批的标记已读和需审批的纯文本发送。
28
28
  - 可选的实时监听模式:exact allowlist 中的私聊对方可续接一个 DSH Agent 会话,或使用 `/new`、`/status`、`/help`。
29
29
 
30
+ ## 界面截图
31
+
32
+ ### 消息
33
+
34
+ ![DeepSeek Harness 中的 AWiki 私聊与群聊界面](./assets/screenshots/awiki-messaging.png)
35
+
36
+ ### 邮件
37
+
38
+ ![DeepSeek Harness 中的 AWiki 邮箱界面](./assets/screenshots/awiki-mail.jpg)
39
+
30
40
  首版不包含端到端加密、多身份、建群后的成员或群设置管理和单消息多附件。Agent listener 只接受明文私聊文本;
31
41
  群聊、附件、加密/payload 内容和未知斜杠命令都不会进入 Agent。
32
42
 
@@ -44,6 +54,13 @@ Rust 身份。
44
54
  dsh plugin --profile web add @awiki/dsh-plugin@latest
45
55
  ```
46
56
 
57
+ 主包不再默认安装 AWiki 托管模型 Provider。仅在需要该能力时,另行安装独立版本的
58
+ Host-only 包:
59
+
60
+ ```bash
61
+ dsh plugin --profile web add @awiki/dsh-model-proxy@latest
62
+ ```
63
+
47
64
  Profile 安装器会同时添加包并激活 bundle layer。在 DSH 项目根目录执行普通的
48
65
  `npm i @awiki/dsh-plugin` 只会安装依赖,不会激活 bundle,因此仍推荐使用上述
49
66
  Profile 命令。本发布线面向 `0.1.0-rc.7` 包族,并精确锁定所有直接 Host peer,
@@ -52,8 +69,10 @@ Profile 命令。本发布线面向 `0.1.0-rc.7` 包族,并精确锁定所有
52
69
  从 `0.2.0-rc.4` 起,`@awiki/dsh-plugin` 是唯一规范包名。原
53
70
  `@awiki/dsh` registry 条目已被 unpublish,不再作为本发布线的安装来源。
54
71
 
55
- 请在常规 DSH base 和 Web app bundle 之后应用本包。`cordis.patch.yml` 会加入
56
- Host Service 和 Provider;浏览器客户端由 DSH 根据包元数据自动发现并注入。
72
+ 请在常规 DSH base 和 Web app bundle 之后应用本包。主包 `cordis.patch.yml` 会加入
73
+ AWiki Host Service、Rust SDK Provider Summary Provider;浏览器客户端由 DSH 根据
74
+ 包元数据自动发现并注入。主 patch 不再插入 Model Proxy。可选包使用自己的 patch,
75
+ 只插入一个 `awiki-model-proxy`,并显式依赖已经加载的 `awiki` 服务。
57
76
 
58
77
  ## 配置
59
78
 
@@ -81,17 +100,31 @@ Host Service 和 Provider;浏览器客户端由 DSH 根据包元数据自动
81
100
  | `DSH_AWIKI_SUMMARY_MAX_INPUT_BYTES` | Host 最小化后的 UTF-8 输入上限 | `32768` |
82
101
  | `DSH_AWIKI_SUMMARY_TIMEOUT_MS` | 单次模型调用超时 | `30000` |
83
102
  | `DSH_AWIKI_SUMMARY_MAX_OUTPUT_TOKENS` | 结构化摘要输出上限 | `768` |
84
- | `DSH_AWIKI_MODEL_PROXY_URL` | AWiki 托管的 DeepSeek 代理服务根 URL | `https://model.awiki.info` |
85
- | `DSH_AWIKI_MODEL_CONTEXT_WINDOW` | AWiki 托管模型上下文窗口 | `1000000` |
86
- | `DSH_AWIKI_MODEL_MAX_TOKENS` | AWiki 托管模型单次最大输出 | `8192` |
87
- | `DSH_AWIKI_MODEL_TOKEN_REFRESH_SKEW_SECONDS` | 短期 Token 提前刷新秒数 | `60` |
88
-
89
103
  ## AWiki 托管模型账户
90
104
 
91
- `@awiki/dsh-plugin/model-proxy` 通过 `ctx.awiki.externalHttpAuth` 在 Host 内向模型代理换取
105
+ 该能力现在需要单独安装 `@awiki/dsh-model-proxy`。它通过
106
+ `ctx.awiki.externalHttpAuth` 在 Host 内向模型代理换取
92
107
  短期 Token,并复用 Harness 的 DeepSeek Adapter。Browser 只能通过 loopback RPC 读取经过
93
108
  裁剪的账户、用量和订单状态;DID 签名、Bearer Token 和上游平台密钥都不会进入浏览器包。
94
109
 
110
+ 旧运行时导入 `@awiki/dsh-plugin/model-proxy` 已移除,请改用
111
+ `@awiki/dsh-model-proxy`;浏览器安全的公共契约继续保留在
112
+ `@awiki/dsh-plugin/model-proxy-contract`。只安装主包时,模型首次引导、账户/充值和
113
+ 用量入口保持隐藏,高级 AWiki 设置仍可正常使用。
114
+
115
+ 本次 RC 拆分从 `@awiki/dsh-plugin@0.3.0-rc.1` 与
116
+ `@awiki/dsh-model-proxy@0.1.0-rc.1` 开始。可选包 peer 固定为主包 `^0.3.0-rc.1`,避免与仍会
117
+ 默认插入旧 runtime 的 `0.2.x` 主包组合后加载两个 Model Proxy。
118
+
119
+ 以下环境变量归可选包所有:
120
+
121
+ | 环境变量 | 用途 | 默认值 |
122
+ | --- | --- | --- |
123
+ | `DSH_AWIKI_MODEL_PROXY_URL` | AWiki 托管的 DeepSeek 代理服务根 URL | `https://model.awiki.info` |
124
+ | `DSH_AWIKI_MODEL_CONTEXT_WINDOW` | AWiki 托管模型上下文窗口 | `1000000` |
125
+ | `DSH_AWIKI_MODEL_MAX_TOKENS` | AWiki 托管模型单次最大输出 | `8192` |
126
+ | `DSH_AWIKI_MODEL_TOKEN_REFRESH_SKEW_SECONDS` | 短期 Token 提前刷新秒数 | `60` |
127
+
95
128
  插件默认关闭 AWiki 托管模型。用户在首次引导或“设置 → AWiki → 账户与充值”明确启用后,
96
129
  才注册 `awiki-deepseek` 路由并把 Flash 设为默认模型;停用时会恢复启用前的默认 Provider、
97
130
  模型和 reasoning effort。充值到账只刷新余额,不会自动启用 AWiki 或切换当前模型。
@@ -121,7 +154,9 @@ DSH 会把选择写入自己的设置文件,并在下次重启 Harness 后生
121
154
 
122
155
  普通“退出登录”与危险区域的永久清空相互独立。退出只写入一个 Host 私有会话标记,
123
156
  同时阻止 Web UI 和 Agent 使用该身份;SecretVault 中的身份、密钥、令牌、会话、附件索引和图片预览缓存
124
- 全部保留。“重新进入”会移除标记并恢复同一个本机身份,不需要重新注册。
157
+ 全部保留。“重新进入本机身份”会移除标记并恢复同一个本机身份,不需要重新注册。退出页默认不显示恢复入口;
158
+ 只有重新进入失败后,才提供原身份的手机号恢复。“使用其他身份”必须先勾选不可逆数据清除确认,清理成功后回到
159
+ 统一身份入口,并由同一个 Handle 表单判断是创建新身份还是恢复已有身份。
125
160
 
126
161
  Provider 域名和消息服务 DID 都是协议标识,不能根据 API host 猜测。生产环境 URL
127
162
  必须使用 HTTPS。IM Core 状态目录含访问材料,应置于仓库外,限制文件权限,并为磁盘
@@ -178,15 +213,15 @@ redirect,由 Rust 自动选择当前 origin 的进程内 Bearer Token 或新 H
178
213
 
179
214
  ## 开发与验证
180
215
 
181
- 需要 Node.js 22.19+(或 24+)以及 pnpm 11.7
216
+ 需要 Node.js 22.19+(或 24+)以及 pnpm 11.22
182
217
 
183
218
  ```bash
184
219
  pnpm install --frozen-lockfile
185
- pnpm run verify
220
+ pnpm run verify:workspace
186
221
  pnpm pack --dry-run
187
222
  ```
188
223
 
189
- 生产 Host 加载固定版本 `@awiki/im-core-node@0.1.5`;平台原生 addon 由它的
224
+ 生产 Host 加载固定版本 `@awiki/im-core-node@0.1.6`;平台原生 addon 由它的
190
225
  optional dependencies 选择,并保持在 JavaScript bundle 外。使用者无需安装 Rust,
191
226
  也无需检出 `awiki-cli-rs2`。来源与许可证见 `THIRD_PARTY_NOTICES.md`。
192
227
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## AWiki Rust IM Core Node SDK
4
4
 
5
- `@awiki/im-core-node@0.1.5` and its target-specific optional package provide the
5
+ `@awiki/im-core-node@0.1.6` and its target-specific optional package provide the
6
6
  Rust IM Core runtime used by the Host provider. These packages are distributed
7
7
  under AGPL-3.0-only. Each package carries its own `LICENSE`, `NOTICE.md`,
8
8
  `SOURCE.md`, CycloneDX SBOM, checksums, and build provenance. The corresponding
package/cordis.patch.yml CHANGED
@@ -24,14 +24,6 @@
24
24
  - id: awiki-provider
25
25
  name: '@awiki/dsh-plugin/provider'
26
26
 
27
- - id: awiki-model-proxy
28
- name: '@awiki/dsh-plugin/model-proxy'
29
- config:
30
- baseURL: !!js process.env.DSH_AWIKI_MODEL_PROXY_URL ?? 'https://model.awiki.info'
31
- contextWindow: !!js Number(process.env.DSH_AWIKI_MODEL_CONTEXT_WINDOW ?? '1000000')
32
- maxTokens: !!js Number(process.env.DSH_AWIKI_MODEL_MAX_TOKENS ?? '8192')
33
- tokenRefreshSkewSeconds: !!js Number(process.env.DSH_AWIKI_MODEL_TOKEN_REFRESH_SKEW_SECONDS ?? '60')
34
-
35
27
  - id: awiki-summary-provider
36
28
  name: '@awiki/dsh-plugin/summary-provider'
37
29
  config: