@awiki/dsh-plugin 0.2.4 → 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 (142) hide show
  1. package/README.md +131 -22
  2. package/README.zh.md +110 -20
  3. package/THIRD_PARTY_NOTICES.md +8 -1
  4. package/cordis.patch.yml +5 -0
  5. package/lib/client.js +12534 -2647
  6. package/lib/client.js.map +1 -1
  7. package/lib/index.js +2431 -92
  8. package/lib/model-proxy-contract.js +96 -0
  9. package/lib/provider.js +4 -1
  10. package/lib/sdk-adapter-DLhLrLI6.mjs +886 -0
  11. package/lib/typert.host.js +1269 -534
  12. package/lib/typert.remote-client.d.ts +47 -1
  13. package/lib/typert.remote-client.d.ts.map +1 -1
  14. package/lib/typert.remote-client.js +1254 -141
  15. package/lib/types/attachment-cache.d.ts +28 -0
  16. package/lib/types/attachment-cache.d.ts.map +1 -0
  17. package/lib/types/attachment-cache.js +194 -0
  18. package/lib/types/attachment-cache.js.map +1 -0
  19. package/lib/types/client/AwikiGroupDetails.d.ts +16 -0
  20. package/lib/types/client/AwikiGroupDetails.d.ts.map +1 -0
  21. package/lib/types/client/AwikiGroupDetails.js +108 -0
  22. package/lib/types/client/AwikiGroupDetails.js.map +1 -0
  23. package/lib/types/client/AwikiIdentityAccess.d.ts +21 -0
  24. package/lib/types/client/AwikiIdentityAccess.d.ts.map +1 -0
  25. package/lib/types/client/AwikiIdentityAccess.js +148 -0
  26. package/lib/types/client/AwikiIdentityAccess.js.map +1 -0
  27. package/lib/types/client/AwikiIdentityPage.d.ts +11 -0
  28. package/lib/types/client/AwikiIdentityPage.d.ts.map +1 -0
  29. package/lib/types/client/AwikiIdentityPage.js +8 -0
  30. package/lib/types/client/AwikiIdentityPage.js.map +1 -0
  31. package/lib/types/client/AwikiMail.d.ts +15 -0
  32. package/lib/types/client/AwikiMail.d.ts.map +1 -0
  33. package/lib/types/client/AwikiMail.js +380 -0
  34. package/lib/types/client/AwikiMail.js.map +1 -0
  35. package/lib/types/client/AwikiOnboarding.d.ts +22 -0
  36. package/lib/types/client/AwikiOnboarding.d.ts.map +1 -0
  37. package/lib/types/client/AwikiOnboarding.js +104 -0
  38. package/lib/types/client/AwikiOnboarding.js.map +1 -0
  39. package/lib/types/client/AwikiOverlay.d.ts +10 -0
  40. package/lib/types/client/AwikiOverlay.d.ts.map +1 -1
  41. package/lib/types/client/AwikiOverlay.js +370 -127
  42. package/lib/types/client/AwikiOverlay.js.map +1 -1
  43. package/lib/types/client/AwikiProfileCard.d.ts +9 -0
  44. package/lib/types/client/AwikiProfileCard.d.ts.map +1 -0
  45. package/lib/types/client/AwikiProfileCard.js +90 -0
  46. package/lib/types/client/AwikiProfileCard.js.map +1 -0
  47. package/lib/types/client/AwikiRecoveryForm.d.ts +24 -0
  48. package/lib/types/client/AwikiRecoveryForm.d.ts.map +1 -0
  49. package/lib/types/client/AwikiRecoveryForm.js +148 -0
  50. package/lib/types/client/AwikiRecoveryForm.js.map +1 -0
  51. package/lib/types/client/AwikiSettingsSection.d.ts +18 -4
  52. package/lib/types/client/AwikiSettingsSection.d.ts.map +1 -1
  53. package/lib/types/client/AwikiSettingsSection.js +277 -23
  54. package/lib/types/client/AwikiSettingsSection.js.map +1 -1
  55. package/lib/types/client/MentionText.d.ts +7 -0
  56. package/lib/types/client/MentionText.d.ts.map +1 -0
  57. package/lib/types/client/MentionText.js +10 -0
  58. package/lib/types/client/MentionText.js.map +1 -0
  59. package/lib/types/client/RechargeComingSoonDialog.d.ts +11 -0
  60. package/lib/types/client/RechargeComingSoonDialog.d.ts.map +1 -0
  61. package/lib/types/client/RechargeComingSoonDialog.js +8 -0
  62. package/lib/types/client/RechargeComingSoonDialog.js.map +1 -0
  63. package/lib/types/client/controller.d.ts +174 -4
  64. package/lib/types/client/controller.d.ts.map +1 -1
  65. package/lib/types/client/controller.js +975 -79
  66. package/lib/types/client/controller.js.map +1 -1
  67. package/lib/types/client/image-cache.d.ts +20 -0
  68. package/lib/types/client/image-cache.d.ts.map +1 -0
  69. package/lib/types/client/image-cache.js +177 -0
  70. package/lib/types/client/image-cache.js.map +1 -0
  71. package/lib/types/client/index.d.ts +2 -0
  72. package/lib/types/client/index.d.ts.map +1 -1
  73. package/lib/types/client/index.js +102 -42
  74. package/lib/types/client/index.js.map +1 -1
  75. package/lib/types/client/mail-list-cache.d.ts +15 -0
  76. package/lib/types/client/mail-list-cache.d.ts.map +1 -0
  77. package/lib/types/client/mail-list-cache.js +212 -0
  78. package/lib/types/client/mail-list-cache.js.map +1 -0
  79. package/lib/types/client/mentions.d.ts +51 -0
  80. package/lib/types/client/mentions.d.ts.map +1 -0
  81. package/lib/types/client/mentions.js +165 -0
  82. package/lib/types/client/mentions.js.map +1 -0
  83. package/lib/types/client/model-availability-controller.d.ts +27 -0
  84. package/lib/types/client/model-availability-controller.d.ts.map +1 -0
  85. package/lib/types/client/model-availability-controller.js +111 -0
  86. package/lib/types/client/model-availability-controller.js.map +1 -0
  87. package/lib/types/client/model-proxy-controller.d.ts +45 -0
  88. package/lib/types/client/model-proxy-controller.d.ts.map +1 -0
  89. package/lib/types/client/model-proxy-controller.js +306 -0
  90. package/lib/types/client/model-proxy-controller.js.map +1 -0
  91. package/lib/types/client/recharge-availability.d.ts +6 -0
  92. package/lib/types/client/recharge-availability.d.ts.map +1 -0
  93. package/lib/types/client/recharge-availability.js +6 -0
  94. package/lib/types/client/recharge-availability.js.map +1 -0
  95. package/lib/types/client/settings-locales.d.ts +1 -1
  96. package/lib/types/client/settings-locales.d.ts.map +1 -1
  97. package/lib/types/client/settings-locales.js +186 -8
  98. package/lib/types/client/settings-locales.js.map +1 -1
  99. package/lib/types/client/slots.d.ts +34 -2
  100. package/lib/types/client/slots.d.ts.map +1 -1
  101. package/lib/types/index.d.ts +95 -7
  102. package/lib/types/index.d.ts.map +1 -1
  103. package/lib/types/index.js +968 -37
  104. package/lib/types/index.js.map +1 -1
  105. package/lib/types/listener-state.d.ts +23 -0
  106. package/lib/types/listener-state.d.ts.map +1 -0
  107. package/lib/types/listener-state.js +124 -0
  108. package/lib/types/listener-state.js.map +1 -0
  109. package/lib/types/listener.d.ts +96 -0
  110. package/lib/types/listener.d.ts.map +1 -0
  111. package/lib/types/listener.js +575 -0
  112. package/lib/types/listener.js.map +1 -0
  113. package/lib/types/mail.d.ts +8 -0
  114. package/lib/types/mail.d.ts.map +1 -0
  115. package/lib/types/mail.js +75 -0
  116. package/lib/types/mail.js.map +1 -0
  117. package/lib/types/model-proxy-contract.d.ts +67 -0
  118. package/lib/types/model-proxy-contract.d.ts.map +1 -0
  119. package/lib/types/model-proxy-contract.js +135 -0
  120. package/lib/types/model-proxy-contract.js.map +1 -0
  121. package/lib/types/provider-api.d.ts +106 -2
  122. package/lib/types/provider-api.d.ts.map +1 -1
  123. package/lib/types/provider.d.ts.map +1 -1
  124. package/lib/types/provider.js +3 -0
  125. package/lib/types/provider.js.map +1 -1
  126. package/lib/types/sdk-adapter.d.ts +43 -2
  127. package/lib/types/sdk-adapter.d.ts.map +1 -1
  128. package/lib/types/sdk-adapter.js +622 -24
  129. package/lib/types/sdk-adapter.js.map +1 -1
  130. package/lib/types/sent-mail-store.d.ts +22 -0
  131. package/lib/types/sent-mail-store.d.ts.map +1 -0
  132. package/lib/types/sent-mail-store.js +246 -0
  133. package/lib/types/sent-mail-store.js.map +1 -0
  134. package/lib/types/tools.d.ts +10 -0
  135. package/lib/types/tools.d.ts.map +1 -1
  136. package/lib/types/tools.js +98 -0
  137. package/lib/types/tools.js.map +1 -1
  138. package/lib/types/types.d.ts +254 -2
  139. package/lib/types/types.d.ts.map +1 -1
  140. package/lib/types/types.js.map +1 -1
  141. package/package.json +31 -17
  142. package/lib/sdk-adapter-DK6RqV-c.mjs +0 -355
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,20 +17,44 @@ 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. Opening a conversation keeps loading feedback inside the history and lands on the newest message; 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
- - Text messages plus one attachment per message, with Enter-to-send, Shift+Enter line breaks, optimistic sending bubbles, image previews, and SHA verification.
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.
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.
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.
24
26
  - A draggable circular launcher, adaptive popup placement, dark mode, and remembered active conversation.
25
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.
26
- - OTP registration keeps the verification form visible and disables resend with a visible server-directed cooldown countdown.
27
- - An AWiki page in DSH Settings for a durable, validated default 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.
28
32
  - A typed second confirmation in the Settings danger zone before permanently clearing local AWiki identity, key, token, registration-draft, and message-index state.
29
- - Five approval-aware Agent tools: identity status, conversations, history, text send, and attachment send.
33
+ - Five messaging Agent tools: identity status, conversations, history, approved text send, and approved attachment send.
34
+ - Five on-demand mail Agent tools: mailbox account, inbox, plain-text read, approved mark-read, and approved plain-text send.
35
+ - An opt-in realtime listener that lets exact-allowlisted Direct peers continue one DSH Agent session or use `/new`, `/status`, and `/help`.
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)
30
46
 
31
47
  The first release does not implement end-to-end encryption, multiple identities,
32
- group administration, realtime push, or multiple attachments in one message.
48
+ post-creation group administration or multiple attachments in one message. The Agent listener accepts only
49
+ plain Direct text; Groups, attachments, encrypted/payload content, and unknown slash commands never
50
+ reach the Agent.
51
+
52
+ Mail v1 is on demand only and has no browser mailbox or compose UI. It does not wake an Agent for
53
+ new mail, render or send HTML, transfer mail attachments, or implement reply, forward, and
54
+ threading. Mail subject, addresses, preview, body, timestamps, and attachment metadata are
55
+ untrusted external data, never Agent instructions. `awiki_mail_mark_read` and `awiki_mail_send`
56
+ require execution approval. Mail send is attempted once without automatic retry; a timeout or
57
+ transport loss returns `delivery-unknown`, so inspect the mailbox before approving another send.
33
58
 
34
59
  ## Install
35
60
 
@@ -39,6 +64,13 @@ Install the official public npm package:
39
64
  dsh plugin --profile web add @awiki/dsh-plugin@latest
40
65
  ```
41
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
+
42
74
  The profile installer both adds the package and activates its bundle layer. A
43
75
  plain `npm i @awiki/dsh-plugin` in a DSH project only installs the package; it
44
76
  does not activate the bundle, so the profile command remains the recommended
@@ -51,8 +83,11 @@ families in a DSH root dependency tree.
51
83
  not an installation source for this release line.
52
84
 
53
85
  Apply the package after the normal DSH base and Web app bundles. Its
54
- `cordis.patch.yml` adds the Host service and provider; DSH discovers and injects
55
- 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.
56
91
 
57
92
  ## Configuration
58
93
 
@@ -63,18 +98,77 @@ The plugin works against the public `awiki.ai` tenant without environment config
63
98
  | `DSH_AWIKI_USER_SERVICE_URL` | Absolute AWiki user-service URL | `https://awiki.ai` |
64
99
  | `DSH_AWIKI_USER_SERVICE_DOMAIN` | Composition default for the Handle provider domain | `awiki.ai` |
65
100
  | `DSH_AWIKI_MESSAGE_SERVICE_URL` | Message-service URL called by the Host | `https://awiki.ai` |
101
+ | `DSH_AWIKI_MAIL_SERVICE_URL` | Mail-service URL called by the Host | Resolved user-service URL |
66
102
  | `DSH_AWIKI_MESSAGE_SERVICE_DID` | Authoritative message-service DID | `did:wba:awiki.ai` |
67
103
  | `DSH_AWIKI_MESSAGE_SERVICE_PUBLIC_URL` | Public endpoint written to protocol records | `https://awiki.ai` |
68
104
  | `DSH_AWIKI_ALLOWED_ATTACHMENT_ORIGINS` | JSON array of extra exact HTTPS origins | `[]` |
69
105
  | `DSH_AWIKI_STATE_ROOT` | Private Rust IM Core state directory | `$DSH_HOME/awiki/im-core` or `~/.dsh/awiki/im-core` |
106
+ | `DSH_AWIKI_VAULT_ROOT_KEY_FILE` | Existing private file containing a base64/base64url 32-byte Vault root key | `$DSH_HOME/awiki/secret-vault/root-key.b64u` |
107
+ | `DSH_AWIKI_VAULT_WORKSPACE_ID` | Stable non-secret Vault workspace context | `dsh-awiki` |
108
+ | `DSH_AWIKI_VAULT_DEVICE_ID` | Stable non-secret Vault device context | `local-device` |
70
109
  | `DSH_AWIKI_POLL_INTERVAL_MS` | Open-dialog polling interval | `5000` |
71
110
  | `DSH_AWIKI_ATTACHMENT_MAX_BYTES` | Decoded attachment limit | `10485760` |
111
+ | `DSH_AWIKI_IMAGE_CACHE_MAX_BYTES` | Private verified image-preview cache budget | `67108864` |
112
+ | `DSH_AWIKI_LISTENER_ENABLED` | Enable the Direct-to-Agent listener | `false` |
113
+ | `DSH_AWIKI_LISTENER_ALLOWED_PEERS` | JSON array of exact Handles or DIDs; required when enabled | `[]` |
114
+ | `DSH_AWIKI_LISTENER_WORKSPACE_PATH` | Absolute shared Workspace for AWiki-originated Sessions | `$DSH_HOME/workspaces/awiki` or `~/.dsh/workspaces/awiki` |
72
115
  | `DSH_AWIKI_SUMMARY_MAX_INPUT_BYTES` | UTF-8 cap after Host-side summary minimization | `32768` |
73
116
  | `DSH_AWIKI_SUMMARY_TIMEOUT_MS` | One-shot model deadline | `30000` |
74
117
  | `DSH_AWIKI_SUMMARY_MAX_OUTPUT_TOKENS` | Structured summary output cap | `768` |
118
+ ## AWiki-hosted DeepSeek account
119
+
120
+ This capability now requires the separate `@awiki/dsh-model-proxy` package. It
121
+ uses `ctx.awiki.externalHttpAuth` to obtain a short-lived
122
+ model token inside the Host and reuses the Harness DeepSeek adapter. The Browser receives only
123
+ sanitized account, usage, and order state over a loopback RPC channel. DID signatures, bearer
124
+ tokens, and upstream platform credentials are absent from the browser bundle.
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
+
146
+ AWiki-hosted DeepSeek is disabled by default. Only an explicit choice in onboarding or Settings → AWiki →
147
+ Account & Recharge registers the `awiki-deepseek` route and selects Flash. Disabling restores the
148
+ previous provider, model, and reasoning effort. A successful recharge refreshes the balance but
149
+ never enables AWiki or changes the selected model automatically.
150
+
151
+ The settings UI supports both payment redirects and TongQiFu `ALI_QR` content. When payments are
152
+ disabled it reports the development restriction without blocking an account whose
153
+ `model_access_available` flag is true. Development bypass displays calculated and charged amounts
154
+ separately, with zero charged; it does not invent a price when no price table is active.
155
+ Public recharge creation also has a client release gate in
156
+ `src/client/recharge-availability.ts`. The gate is currently closed: recharge controls remain
157
+ visible, but attempting to recharge shows a localized coming-soon dialog and sends no order RPC.
158
+ Open that single gate only after the production collection account is ready; the existing payment,
159
+ polling, and cancellation flows remain intact behind it.
160
+ Strict billing keeps the internal billing-mode label out of the normal account summary. When the
161
+ backend reports `model_access_reason=insufficient_balance`, recharge becomes the primary action and
162
+ model enablement is withheld until credit is available. The Host restores the newest pending order
163
+ and its payment action whenever the settings page is reopened, polls it without creating duplicates,
164
+ and still requires an explicit model opt-in after payment. Recharge amounts are immutable after order
165
+ creation. To choose another amount, the user confirms **Cancel and change amount**; the Host first
166
+ closes the provider order, then restores the amount editor without creating a replacement. A close
167
+ failure leaves the existing payment action available, while a payment that wins the race refreshes
168
+ the credited account instead of being reported as cancelled.
75
169
 
76
170
  The default Handle provider domain is `awiki.ai`. A local user can override it
77
- from Settings → AWiki; DSH persists that choice in its settings document and
171
+ from Settings → AWiki → Advanced; DSH persists that choice in its settings document and
78
172
  applies it after the next Harness restart. The setting affects future identity
79
173
  registration and completion of short Handles. It does not rewrite an already
80
174
  registered DID or Handle.
@@ -84,22 +178,37 @@ accepts only from loopback. This keeps an independently installed `@awiki/dsh-pl
84
178
  compatible with stock DSH releases without adding AWiki to a core settings
85
179
  allowlist; non-local browser origins cannot read or mutate the Host setting.
86
180
 
87
- Settings → AWiki → Danger zone clears only this installation's local AWiki
181
+ Settings → AWiki → Advanced → Danger zone clears only this installation's local AWiki
88
182
  state; it does not delete the server-side account or Handle. The dialog requires
89
183
  the displayed confirmation phrase. After success, the local DID keys, access
90
- token, registration draft, conversations, and attachment index cannot be
184
+ token, registration draft, conversations, attachment index, and cached image previews cannot be
91
185
  recovered by the app, and this installation may lose access to the old identity.
92
186
 
93
187
  Ordinary sign-out is separate from that destructive action. It writes only a private
94
188
  Host-owned session marker, gates both Web and Agent operations, and retains the SDK-owned
95
- SecretVault identity, keys, tokens, conversations, and attachment index. Resuming removes
96
- 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.
97
194
 
98
195
  The provider domain and message-service DID are protocol identifiers. Do not
99
196
  infer them from an API hostname. Production service URLs must use HTTPS. The IM Core state directory contains access material;
100
197
  keep it outside the repository, restrict filesystem access, and protect the
101
198
  underlying disk and backups.
102
199
 
200
+ The Node facade owns `stateRoot/vault/root-key.b64u`; the Host does not provide, copy, or log Vault
201
+ key material. Preserve the complete SDK state root across ordinary restarts and upgrades.
202
+
203
+ The listener is disabled unless both `DSH_AWIKI_LISTENER_ENABLED=true` and a non-empty exact
204
+ allowlist are configured. On startup and every Core realtime scheduling signal it runs canonical
205
+ reliable sync before reading committed history. Core owns WebSocket connection and reconnect;
206
+ stream closure is recovered as stop, reconnect sync, then replacement realtime session. One
207
+ persisted route and message watermark per Direct conversation preserve the current DSH Session
208
+ across restarts. Every AWiki-originated Session is created in and attached to the registered shared
209
+ AWiki Workspace. Listener messages are untrusted user data and do not approve tools or bridge
210
+ approval/user-question prompts.
211
+
103
212
  For the default 10 MiB decoded attachment cap, configure a reverse-proxy request
104
213
  limit of at least 14 MiB to account for base64 and JSON overhead.
105
214
 
@@ -147,22 +256,22 @@ Web client bundle. Exposing it across an untrusted boundary would create a signi
147
256
 
148
257
  ## Development
149
258
 
150
- Requirements: Node.js 22.19+ (or 24+) and pnpm 11.7.
259
+ Requirements: Node.js 22.19+ (or 24+) and pnpm 11.22.
151
260
 
152
261
  ```bash
153
262
  pnpm install --frozen-lockfile
154
- pnpm run verify
263
+ pnpm run verify:workspace
155
264
  pnpm pack --dry-run
156
265
  ```
157
266
 
158
- The production Host loads the exact `@awiki/im-core-node@0.1.3` runtime package;
267
+ The production Host loads the exact `@awiki/im-core-node@0.1.6` runtime package;
159
268
  the platform-specific native addon is selected through its optional dependencies
160
269
  and remains external to the JavaScript bundle. Consumers do not need Rust or an
161
270
  `awiki-cli-rs2` checkout. See `THIRD_PARTY_NOTICES.md` for provenance and
162
271
  licensing.
163
272
 
164
273
  The checked-in Typert Host/Remote artifacts were generated from the same Host
165
- contract. `pnpm check:generated` pins their complete seventeen-method surface until
274
+ contract. `pnpm check:generated` pins their complete eighteen-method surface until
166
275
  the standalone Typert generator supports root-level packages.
167
276
 
168
277
  ## Security
package/README.zh.md CHANGED
@@ -10,19 +10,41 @@ Rust 身份。
10
10
 
11
11
  ## 功能
12
12
 
13
- - 在 Web UI 中注册一个部署级 AWiki 身份,根 Agent 与子 Agent 共用。
14
- - 点击 AWiki 面板左上角图标可打开账户菜单;普通退出只锁定本机会话,不删除加密身份或消息数据库,重新进入及重启 DSH 后仍恢复同一个 DID 和 Handle
15
- - 注册失败时保留手机号、Handle、验证码和本机待注册密钥;注册未开放、验证码状态失效和提交冲突会给出对应的安全处理提示。
16
- - 私聊和已有群聊列表、未读角标、最新消息预览、时间更新与昵称持久化。打开会话时在消息区内显示加载状态并落到最新消息;向上阅读时显示下滑箭头,新消息到达后在同一控件中累计数量且不打断阅读位置。只有最新一条已渲染消息到达可视区域底部后,当前会话才会自动标记为已读。
17
- - 文本和单附件消息;Enter 发送、Shift+Enter 换行,发送中立即显示带 loading 动画的乐观气泡,并支持图片预览、附件说明与 SHA 校验。
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
+ - 可从 Web UI 输入群名和 1–50 Handle 或 DID 发起私有发现、开放加入、传输保护的群聊。建群成功后立即进入新会话;个别成员添加失败会单独提示,不会隐藏已经创建的群。
18
+ - 文本和单附件消息;Enter 发送、Shift+Enter 换行,发送中立即显示带 loading 动画的乐观气泡,并通过精确的客户端消息 ID 与已提交消息对账,避免同一条消息显示两个气泡;同时支持图片预览、附件说明与 SHA 校验。校验通过的图片字节使用三层有界缓存:浏览器运行期 LRU 让会话重新挂载时立即出图,按身份隔离的 IndexedDB 在整页刷新后无需访问 Host,Host 私有磁盘缓存则应对浏览器缓存丢失并跨 Harness 重启复用;“清除本地数据”会删除三层缓存。
18
19
  - 圆形可拖动入口、自适应四角弹窗、深色模式和当前会话记忆。
19
20
  - 用户点击后才生成的 AI 对话总结:最多处理 50 条最近或未读消息,按会话保留本次运行期缓存,并支持过期提示、重试、复制与跳转原消息。
20
- - OTP 注册会保留验证码输入表单,并按服务端返回的冷却时间显示重发倒计时、禁用提前重发。
21
- - DSH 设置中提供 AWiki 页面,可持久化修改并校验默认 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` 后才显示“账户与充值”和“用量明细”,用于显式启停模型并查看计算费用和实际扣费。
22
25
  - 在设置页危险区域中,经输入确认词的二次确认后,永久清空本机 AWiki 身份、密钥、令牌、注册草稿和消息索引。
23
- - 五个受 Harness 审批约束的 Agent 工具:身份、会话、历史、文本发送、附件发送。
26
+ - 五个消息 Agent 工具:身份、会话、历史、需审批的文本发送和需审批的附件发送。
27
+ - 五个按需邮件 Agent 工具:邮箱账户、收件箱、纯文本读取、需审批的标记已读和需审批的纯文本发送。
28
+ - 可选的实时监听模式:exact allowlist 中的私聊对方可续接一个 DSH Agent 会话,或使用 `/new`、`/status`、`/help`。
24
29
 
25
- 首版不包含端到端加密、多身份、群管理、实时推送和单消息多附件。
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
+
40
+ 首版不包含端到端加密、多身份、建群后的成员或群设置管理和单消息多附件。Agent listener 只接受明文私聊文本;
41
+ 群聊、附件、加密/payload 内容和未知斜杠命令都不会进入 Agent。
42
+
43
+ 邮件 v1 仅支持按需调用,不提供浏览器收件箱或写信 UI,也不会以新邮件唤醒 Agent;不渲染或
44
+ 发送 HTML,不传输邮件附件,也不支持回复、转发和会话串联。邮件主题、地址、预览、正文、
45
+ 时间戳和附件元数据都是不可信外部数据,不能作为 Agent 指令。`awiki_mail_mark_read` 和
46
+ `awiki_mail_send` 每次执行都需要审批。邮件发送只尝试一次且不自动重试;超时或传输中断返回
47
+ `delivery-unknown`,再次审批发送前应先检查邮箱。
26
48
 
27
49
  ## 安装
28
50
 
@@ -32,6 +54,13 @@ Rust 身份。
32
54
  dsh plugin --profile web add @awiki/dsh-plugin@latest
33
55
  ```
34
56
 
57
+ 主包不再默认安装 AWiki 托管模型 Provider。仅在需要该能力时,另行安装独立版本的
58
+ Host-only 包:
59
+
60
+ ```bash
61
+ dsh plugin --profile web add @awiki/dsh-model-proxy@latest
62
+ ```
63
+
35
64
  Profile 安装器会同时添加包并激活 bundle layer。在 DSH 项目根目录执行普通的
36
65
  `npm i @awiki/dsh-plugin` 只会安装依赖,不会激活 bundle,因此仍推荐使用上述
37
66
  Profile 命令。本发布线面向 `0.1.0-rc.7` 包族,并精确锁定所有直接 Host peer,
@@ -40,8 +69,10 @@ Profile 命令。本发布线面向 `0.1.0-rc.7` 包族,并精确锁定所有
40
69
  从 `0.2.0-rc.4` 起,`@awiki/dsh-plugin` 是唯一规范包名。原
41
70
  `@awiki/dsh` registry 条目已被 unpublish,不再作为本发布线的安装来源。
42
71
 
43
- 请在常规 DSH base 和 Web app bundle 之后应用本包。`cordis.patch.yml` 会加入
44
- 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` 服务。
45
76
 
46
77
  ## 配置
47
78
 
@@ -52,17 +83,64 @@ Host Service 和 Provider;浏览器客户端由 DSH 根据包元数据自动
52
83
  | `DSH_AWIKI_USER_SERVICE_URL` | AWiki user service 绝对 URL | `https://awiki.ai` |
53
84
  | `DSH_AWIKI_USER_SERVICE_DOMAIN` | Handle 提供方域名的部署默认值 | `awiki.ai` |
54
85
  | `DSH_AWIKI_MESSAGE_SERVICE_URL` | Host 调用的 message service URL | `https://awiki.ai` |
86
+ | `DSH_AWIKI_MAIL_SERVICE_URL` | Host 调用的 mail service URL | 解析后的 user service URL |
55
87
  | `DSH_AWIKI_MESSAGE_SERVICE_DID` | 权威消息服务 DID | `did:wba:awiki.ai` |
56
88
  | `DSH_AWIKI_MESSAGE_SERVICE_PUBLIC_URL` | 写入协议记录的公开 endpoint | `https://awiki.ai` |
57
89
  | `DSH_AWIKI_ALLOWED_ATTACHMENT_ORIGINS` | 额外附件 HTTPS origin 的 JSON 数组 | `[]` |
58
90
  | `DSH_AWIKI_STATE_ROOT` | 私有 Rust IM Core 状态目录 | `$DSH_HOME/awiki/im-core` 或 `~/.dsh/awiki/im-core` |
91
+ | `DSH_AWIKI_VAULT_ROOT_KEY_FILE` | 含 base64/base64url 32-byte Vault root key 的既有私有文件 | `$DSH_HOME/awiki/secret-vault/root-key.b64u` |
92
+ | `DSH_AWIKI_VAULT_WORKSPACE_ID` | 稳定、非秘密的 Vault workspace context | `dsh-awiki` |
93
+ | `DSH_AWIKI_VAULT_DEVICE_ID` | 稳定、非秘密的 Vault device context | `local-device` |
59
94
  | `DSH_AWIKI_POLL_INTERVAL_MS` | 弹窗打开时的轮询间隔 | `5000` |
60
95
  | `DSH_AWIKI_ATTACHMENT_MAX_BYTES` | 解码后的附件上限 | `10485760` |
96
+ | `DSH_AWIKI_IMAGE_CACHE_MAX_BYTES` | 私有图片预览缓存的磁盘预算 | `67108864` |
97
+ | `DSH_AWIKI_LISTENER_ENABLED` | 开启私聊到 Agent 的 listener | `false` |
98
+ | `DSH_AWIKI_LISTENER_ALLOWED_PEERS` | exact Handle/DID JSON 数组;开启时必填 | `[]` |
99
+ | `DSH_AWIKI_LISTENER_WORKSPACE_PATH` | 所有 AWiki Session 共用的绝对 Workspace 路径 | `$DSH_HOME/workspaces/awiki` 或 `~/.dsh/workspaces/awiki` |
61
100
  | `DSH_AWIKI_SUMMARY_MAX_INPUT_BYTES` | Host 最小化后的 UTF-8 输入上限 | `32768` |
62
101
  | `DSH_AWIKI_SUMMARY_TIMEOUT_MS` | 单次模型调用超时 | `30000` |
63
102
  | `DSH_AWIKI_SUMMARY_MAX_OUTPUT_TOKENS` | 结构化摘要输出上限 | `768` |
103
+ ## AWiki 托管模型账户
104
+
105
+ 该能力现在需要单独安装 `@awiki/dsh-model-proxy`。它通过
106
+ `ctx.awiki.externalHttpAuth` 在 Host 内向模型代理换取
107
+ 短期 Token,并复用 Harness 的 DeepSeek Adapter。Browser 只能通过 loopback RPC 读取经过
108
+ 裁剪的账户、用量和订单状态;DID 签名、Bearer Token 和上游平台密钥都不会进入浏览器包。
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
+ 以下环境变量归可选包所有:
64
120
 
65
- Handle 提供方的默认域名为 `awiki.ai`。本机用户可以在“设置 AWiki”中覆盖该值;
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
+
128
+ 插件默认关闭 AWiki 托管模型。用户在首次引导或“设置 → AWiki → 账户与充值”明确启用后,
129
+ 才注册 `awiki-deepseek` 路由并把 Flash 设为默认模型;停用时会恢复启用前的默认 Provider、
130
+ 模型和 reasoning effort。充值到账只刷新余额,不会自动启用 AWiki 或切换当前模型。
131
+
132
+ 设置页同时支持支付跳转和通企付 `ALI_QR` 二维码。支付功能关闭时会显示“开发环境暂未开放
133
+ 充值”,但只要账户响应中的 `model_access_available` 为真,仍可启用模型。开发绕过模式会
134
+ 展示计算费用和实际扣费的区别,实际扣费固定为 0;未激活价表时不显示臆造价格。
135
+ 正式计费时,账户摘要不会显示内部的“计费模式”项。后端返回
136
+ `model_access_reason=insufficient_balance` 时,界面会把充值作为当前主要操作,余额到账前
137
+ 不显示误导性的启用按钮。Host 会在每次重新打开设置时恢复最新的待支付订单和支付入口,
138
+ 持续查询状态并阻止重复创建;支付到账后仍必须由用户明确启用托管模型。
139
+ 充值金额在订单创建后不可修改。需要更换金额时,用户必须确认“取消并修改金额”;Host 会先
140
+ 关闭支付平台订单,再恢复金额输入框,并且不会自动创建替代订单。关闭失败时原支付入口继续
141
+ 有效;若支付在关闭竞态中先完成,界面会刷新已入账账户,而不会误报订单已取消。
142
+
143
+ Handle 提供方的默认域名为 `awiki.ai`。本机用户可以在“设置 → AWiki → 高级设置”中覆盖该值;
66
144
  DSH 会把选择写入自己的设置文件,并在下次重启 Harness 后生效。该设置影响后续
67
145
  身份注册和短 Handle 的域名补全,不会改写已经注册的 DID 或 Handle。
68
146
 
@@ -70,18 +148,30 @@ DSH 会把选择写入自己的设置文件,并在下次重启 Harness 后生
70
148
  因此独立安装的 `@awiki/dsh-plugin` 无需修改 DSH 核心设置白名单;非本机浏览器来源不能
71
149
  读取或修改这项 Host 设置。
72
150
 
73
- “设置 → AWiki → 危险区域”中的清空操作只删除此安装的本地 AWiki 状态,不删除
151
+ “设置 → AWiki → 高级设置 → 危险区域”中的清空操作只删除此安装的本地 AWiki 状态,不删除
74
152
  服务端账号或 Handle。执行前必须在确认弹窗中输入指定确认词;成功后本机 DID 私钥、
75
- 访问令牌、注册草稿、会话记录和附件索引无法通过应用恢复,原身份也可能无法再由本机使用。
153
+ 访问令牌、注册草稿、会话记录、附件索引和图片预览缓存无法通过应用恢复,原身份也可能无法再由本机使用。
76
154
 
77
155
  普通“退出登录”与危险区域的永久清空相互独立。退出只写入一个 Host 私有会话标记,
78
- 同时阻止 Web UI 和 Agent 使用该身份;SecretVault 中的身份、密钥、令牌、会话和附件索引
79
- 全部保留。“重新进入”会移除标记并恢复同一个本机身份,不需要重新注册。
156
+ 同时阻止 Web UI 和 Agent 使用该身份;SecretVault 中的身份、密钥、令牌、会话、附件索引和图片预览缓存
157
+ 全部保留。“重新进入本机身份”会移除标记并恢复同一个本机身份,不需要重新注册。退出页默认不显示恢复入口;
158
+ 只有重新进入失败后,才提供原身份的手机号恢复。“使用其他身份”必须先勾选不可逆数据清除确认,清理成功后回到
159
+ 统一身份入口,并由同一个 Handle 表单判断是创建新身份还是恢复已有身份。
80
160
 
81
161
  Provider 域名和消息服务 DID 都是协议标识,不能根据 API host 猜测。生产环境 URL
82
162
  必须使用 HTTPS。IM Core 状态目录含访问材料,应置于仓库外,限制文件权限,并为磁盘
83
163
  和备份提供保护。
84
164
 
165
+ Node facade 独占 `stateRoot/vault/root-key.b64u`;Host 不提供、不复制也不记录 Vault key
166
+ material。普通重启与升级期间应完整保留 SDK state root。
167
+
168
+ Listener 只有在 `DSH_AWIKI_LISTENER_ENABLED=true` 且 exact allowlist 非空时才启用。启动和每个
169
+ Core realtime 调度信号都会先执行 canonical reliable sync,再读取已提交 history。WebSocket
170
+ 连接与重连由 Core 所有;stream 关闭固定按“停止旧 session、reconnect sync、启动 replacement”
171
+ 恢复。每个私聊持久化一个当前 DSH Session route 和消息 watermark,重启后可续接;所有 AWiki
172
+ 来源 Session 都创建并 attach 到已注册的共享 AWiki Workspace。Listener 消息始终是不可信用户
173
+ 数据,不会自动批准工具,也不会桥接 approval 或 user-question prompt。
174
+
85
175
  默认附件上限为解码后 10 MiB;反向代理请求体上限至少应为 14 MiB,以容纳
86
176
  base64 与 JSON 封装开销。
87
177
 
@@ -123,20 +213,20 @@ redirect,由 Rust 自动选择当前 origin 的进程内 Bearer Token 或新 H
123
213
 
124
214
  ## 开发与验证
125
215
 
126
- 需要 Node.js 22.19+(或 24+)以及 pnpm 11.7
216
+ 需要 Node.js 22.19+(或 24+)以及 pnpm 11.22
127
217
 
128
218
  ```bash
129
219
  pnpm install --frozen-lockfile
130
- pnpm run verify
220
+ pnpm run verify:workspace
131
221
  pnpm pack --dry-run
132
222
  ```
133
223
 
134
- 生产 Host 加载固定版本 `@awiki/im-core-node@0.1.3`;平台原生 addon 由它的
224
+ 生产 Host 加载固定版本 `@awiki/im-core-node@0.1.6`;平台原生 addon 由它的
135
225
  optional dependencies 选择,并保持在 JavaScript bundle 外。使用者无需安装 Rust,
136
226
  也无需检出 `awiki-cli-rs2`。来源与许可证见 `THIRD_PARTY_NOTICES.md`。
137
227
 
138
228
  Typert Host/Remote 产物与当前 Host 契约一同提交;在独立 Typert 生成器支持根级
139
- 包之前,`pnpm check:generated` 会固定检查完整的 17 个 Remote 方法。
229
+ 包之前,`pnpm check:generated` 会固定检查完整的 18 个 Remote 方法。
140
230
 
141
231
  ## 安全
142
232
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## AWiki Rust IM Core Node SDK
4
4
 
5
- `@awiki/im-core-node@0.1.3` 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
@@ -19,3 +19,10 @@ manager as a normal exact-version runtime dependency.
19
19
  The embedded launcher artwork in `src/client/assets.ts` comes from the AWiki Me
20
20
  application maintained by the same project team. Its use here is limited to
21
21
  identifying the AWiki integration.
22
+
23
+ ## QR Code generation
24
+
25
+ The browser bundle uses `qrcode@1.5.4` (node-qrcode) to render TongQiFu
26
+ `ALI_QR` payment content as an image. The package and its bundled browser
27
+ dependencies are distributed under their respective MIT licenses; their
28
+ license text is retained by the package manager and source distribution.
package/cordis.patch.yml CHANGED
@@ -8,13 +8,18 @@
8
8
  userServiceUrl: !!js process.env.DSH_AWIKI_USER_SERVICE_URL ?? 'https://awiki.ai'
9
9
  userServiceDomain: !!js process.env.DSH_AWIKI_USER_SERVICE_DOMAIN ?? 'awiki.ai'
10
10
  messageServiceUrl: !!js process.env.DSH_AWIKI_MESSAGE_SERVICE_URL ?? 'https://awiki.ai'
11
+ mailServiceUrl: !!js process.env.DSH_AWIKI_MAIL_SERVICE_URL
11
12
  messageServiceDid: !!js process.env.DSH_AWIKI_MESSAGE_SERVICE_DID ?? 'did:wba:awiki.ai'
12
13
  messageServicePublicUrl: !!js process.env.DSH_AWIKI_MESSAGE_SERVICE_PUBLIC_URL ?? 'https://awiki.ai'
13
14
  allowedAttachmentOrigins: !!js JSON.parse(process.env.DSH_AWIKI_ALLOWED_ATTACHMENT_ORIGINS ?? '[]')
14
15
  stateRoot: !!js process.env.DSH_AWIKI_STATE_ROOT
15
16
  pollIntervalMs: !!js Number(process.env.DSH_AWIKI_POLL_INTERVAL_MS ?? '5000')
16
17
  attachmentMaxBytes: !!js Number(process.env.DSH_AWIKI_ATTACHMENT_MAX_BYTES ?? '10485760')
18
+ imageAttachmentCacheMaxBytes: !!js Number(process.env.DSH_AWIKI_IMAGE_CACHE_MAX_BYTES ?? '67108864')
17
19
  summaryMaxInputBytes: !!js Number(process.env.DSH_AWIKI_SUMMARY_MAX_INPUT_BYTES ?? '32768')
20
+ listenerEnabled: !!js process.env.DSH_AWIKI_LISTENER_ENABLED === 'true'
21
+ listenerAllowedPeers: !!js JSON.parse(process.env.DSH_AWIKI_LISTENER_ALLOWED_PEERS ?? '[]')
22
+ listenerWorkspacePath: !!js process.env.DSH_AWIKI_LISTENER_WORKSPACE_PATH
18
23
 
19
24
  - id: awiki-provider
20
25
  name: '@awiki/dsh-plugin/provider'