@awiki/dsh-plugin 0.2.5 → 0.3.0-rc.2
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.
- package/README.md +69 -28
- package/README.zh.md +60 -21
- package/THIRD_PARTY_NOTICES.md +1 -1
- package/cordis.patch.yml +0 -8
- package/lib/client.js +6755 -2022
- package/lib/client.js.map +1 -1
- package/lib/index.js +1321 -72
- package/lib/model-proxy-contract.js +8 -1
- package/lib/provider.js +3 -1
- package/lib/{sdk-adapter-DKgkyApB.mjs → sdk-adapter-BIbsJmRj.mjs} +245 -4
- package/lib/typert.host.js +944 -57
- package/lib/typert.remote-client.d.ts +37 -1
- package/lib/typert.remote-client.d.ts.map +1 -1
- package/lib/typert.remote-client.js +944 -57
- package/lib/types/client/AwikiGroupAccessNotice.d.ts +12 -0
- package/lib/types/client/AwikiGroupAccessNotice.d.ts.map +1 -0
- package/lib/types/client/AwikiGroupAccessNotice.js +31 -0
- package/lib/types/client/AwikiGroupAccessNotice.js.map +1 -0
- package/lib/types/client/AwikiGroupDetails.d.ts +23 -0
- package/lib/types/client/AwikiGroupDetails.d.ts.map +1 -0
- package/lib/types/client/AwikiGroupDetails.js +144 -0
- package/lib/types/client/AwikiGroupDetails.js.map +1 -0
- package/lib/types/client/AwikiIdentityAccess.d.ts +22 -0
- package/lib/types/client/AwikiIdentityAccess.d.ts.map +1 -0
- package/lib/types/client/AwikiIdentityAccess.js +156 -0
- package/lib/types/client/AwikiIdentityAccess.js.map +1 -0
- package/lib/types/client/AwikiIdentityPage.d.ts +11 -0
- package/lib/types/client/AwikiIdentityPage.d.ts.map +1 -0
- package/lib/types/client/AwikiIdentityPage.js +8 -0
- package/lib/types/client/AwikiIdentityPage.js.map +1 -0
- package/lib/types/client/AwikiMail.d.ts +2 -1
- package/lib/types/client/AwikiMail.d.ts.map +1 -1
- package/lib/types/client/AwikiMail.js +157 -33
- package/lib/types/client/AwikiMail.js.map +1 -1
- package/lib/types/client/AwikiOnboarding.d.ts.map +1 -1
- package/lib/types/client/AwikiOnboarding.js +29 -9
- package/lib/types/client/AwikiOnboarding.js.map +1 -1
- package/lib/types/client/AwikiOverlay.d.ts +0 -5
- package/lib/types/client/AwikiOverlay.d.ts.map +1 -1
- package/lib/types/client/AwikiOverlay.js +202 -129
- package/lib/types/client/AwikiOverlay.js.map +1 -1
- package/lib/types/client/AwikiProfileCard.d.ts +9 -0
- package/lib/types/client/AwikiProfileCard.d.ts.map +1 -0
- package/lib/types/client/AwikiProfileCard.js +90 -0
- package/lib/types/client/AwikiProfileCard.js.map +1 -0
- package/lib/types/client/AwikiRecoveryForm.d.ts +27 -0
- package/lib/types/client/AwikiRecoveryForm.d.ts.map +1 -0
- package/lib/types/client/AwikiRecoveryForm.js +152 -0
- package/lib/types/client/AwikiRecoveryForm.js.map +1 -0
- package/lib/types/client/AwikiSettingsSection.d.ts +0 -2
- package/lib/types/client/AwikiSettingsSection.d.ts.map +1 -1
- package/lib/types/client/AwikiSettingsSection.js +18 -16
- package/lib/types/client/AwikiSettingsSection.js.map +1 -1
- package/lib/types/client/MentionText.d.ts +7 -0
- package/lib/types/client/MentionText.d.ts.map +1 -0
- package/lib/types/client/MentionText.js +10 -0
- package/lib/types/client/MentionText.js.map +1 -0
- package/lib/types/client/controller.d.ts +131 -3
- package/lib/types/client/controller.d.ts.map +1 -1
- package/lib/types/client/controller.js +908 -29
- package/lib/types/client/controller.js.map +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/index.js +24 -4
- package/lib/types/client/index.js.map +1 -1
- package/lib/types/client/mail-list-cache.d.ts +15 -0
- package/lib/types/client/mail-list-cache.d.ts.map +1 -0
- package/lib/types/client/mail-list-cache.js +212 -0
- package/lib/types/client/mail-list-cache.js.map +1 -0
- package/lib/types/client/mentions.d.ts +51 -0
- package/lib/types/client/mentions.d.ts.map +1 -0
- package/lib/types/client/mentions.js +165 -0
- package/lib/types/client/mentions.js.map +1 -0
- package/lib/types/client/model-proxy-controller.d.ts +4 -0
- package/lib/types/client/model-proxy-controller.d.ts.map +1 -1
- package/lib/types/client/model-proxy-controller.js +68 -3
- package/lib/types/client/model-proxy-controller.js.map +1 -1
- package/lib/types/client/recharge-availability.d.ts +1 -1
- package/lib/types/client/recharge-availability.d.ts.map +1 -1
- package/lib/types/client/recharge-availability.js +1 -1
- package/lib/types/client/recharge-availability.js.map +1 -1
- package/lib/types/client/settings-locales.d.ts +1 -1
- package/lib/types/client/settings-locales.d.ts.map +1 -1
- package/lib/types/client/settings-locales.js +14 -8
- package/lib/types/client/settings-locales.js.map +1 -1
- package/lib/types/client/slots.d.ts +27 -2
- package/lib/types/client/slots.d.ts.map +1 -1
- package/lib/types/conversation-preferences.d.ts +20 -0
- package/lib/types/conversation-preferences.d.ts.map +1 -0
- package/lib/types/conversation-preferences.js +294 -0
- package/lib/types/conversation-preferences.js.map +1 -0
- package/lib/types/index.d.ts +45 -6
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +562 -23
- package/lib/types/index.js.map +1 -1
- package/lib/types/model-proxy-contract.d.ts +6 -0
- package/lib/types/model-proxy-contract.d.ts.map +1 -1
- package/lib/types/model-proxy-contract.js +6 -0
- package/lib/types/model-proxy-contract.js.map +1 -1
- package/lib/types/provider-api.d.ts +29 -1
- package/lib/types/provider-api.d.ts.map +1 -1
- package/lib/types/provider.d.ts.map +1 -1
- package/lib/types/provider.js +2 -0
- package/lib/types/provider.js.map +1 -1
- package/lib/types/sdk-adapter.d.ts +18 -1
- package/lib/types/sdk-adapter.d.ts.map +1 -1
- package/lib/types/sdk-adapter.js +277 -4
- package/lib/types/sdk-adapter.js.map +1 -1
- package/lib/types/sent-mail-store.d.ts +22 -0
- package/lib/types/sent-mail-store.d.ts.map +1 -0
- package/lib/types/sent-mail-store.js +246 -0
- package/lib/types/sent-mail-store.js.map +1 -0
- package/lib/types/types.d.ts +183 -2
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/package.json +15 -26
- package/lib/model-proxy.js +0 -383
- package/lib/types/client/model-account-settings-availability.d.ts +0 -4
- package/lib/types/client/model-account-settings-availability.d.ts.map +0 -1
- package/lib/types/client/model-account-settings-availability.js +0 -4
- package/lib/types/client/model-account-settings-availability.js.map +0 -1
- package/lib/types/model-proxy.d.ts +0 -14
- package/lib/types/model-proxy.d.ts.map +0 -1
- package/lib/types/model-proxy.js +0 -371
- 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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
-
|
|
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
|
-
- A draggable circular launcher, adaptive popup placement, dark mode, and remembered active conversation.
|
|
26
|
+
- A draggable circular launcher that defaults to the lower-left sidebar area, 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
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
- Account & Recharge
|
|
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
|
+

|
|
42
|
+
|
|
43
|
+
### Mail
|
|
44
|
+
|
|
45
|
+

|
|
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
|
|
69
|
-
the browser client through the
|
|
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,35 @@ 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-
|
|
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
|
+
The current RC line uses `@awiki/dsh-plugin@0.3.0-rc.2` with
|
|
133
|
+
`@awiki/dsh-model-proxy@0.1.0-rc.1`. The optional package requires main
|
|
134
|
+
`^0.3.0-rc.1`, so
|
|
135
|
+
it cannot be combined with a `0.2.x` main package that still inserted the old
|
|
136
|
+
runtime by default.
|
|
137
|
+
|
|
138
|
+
The optional package owns these configuration variables:
|
|
139
|
+
|
|
140
|
+
| Variable | Purpose | Default |
|
|
141
|
+
| --- | --- | --- |
|
|
142
|
+
| `DSH_AWIKI_MODEL_PROXY_URL` | AWiki-hosted DeepSeek proxy root URL | `https://model.awiki.info` |
|
|
143
|
+
| `DSH_AWIKI_MODEL_CONTEXT_WINDOW` | AWiki-hosted DeepSeek context window | `1000000` |
|
|
144
|
+
| `DSH_AWIKI_MODEL_MAX_TOKENS` | Maximum AWiki-hosted DeepSeek output | `8192` |
|
|
145
|
+
| `DSH_AWIKI_MODEL_TOKEN_REFRESH_SKEW_SECONDS` | Early short-token refresh interval | `60` |
|
|
146
|
+
|
|
109
147
|
AWiki-hosted DeepSeek is disabled by default. Only an explicit choice in onboarding or Settings → AWiki →
|
|
110
148
|
Account & Recharge registers the `awiki-deepseek` route and selects Flash. Disabling restores the
|
|
111
149
|
previous provider, model, and reasoning effort. A successful recharge refreshes the balance but
|
|
@@ -116,10 +154,10 @@ disabled it reports the development restriction without blocking an account whos
|
|
|
116
154
|
`model_access_available` flag is true. Development bypass displays calculated and charged amounts
|
|
117
155
|
separately, with zero charged; it does not invent a price when no price table is active.
|
|
118
156
|
Public recharge creation also has a client release gate in
|
|
119
|
-
`src/client/recharge-availability.ts`. The
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
polling, and cancellation flows
|
|
157
|
+
`src/client/recharge-availability.ts`. The current RC line ships that gate open. Order creation still
|
|
158
|
+
requires the account response to report `payments_available=true`; otherwise the UI reports that
|
|
159
|
+
payments are unavailable and sends no order RPC. The gate remains a single emergency rollback for
|
|
160
|
+
the existing payment, polling, and cancellation flows.
|
|
123
161
|
Strict billing keeps the internal billing-mode label out of the normal account summary. When the
|
|
124
162
|
backend reports `model_access_reason=insufficient_balance`, recharge becomes the primary action and
|
|
125
163
|
model enablement is withheld until credit is available. The Host restores the newest pending order
|
|
@@ -149,8 +187,11 @@ recovered by the app, and this installation may lose access to the old identity.
|
|
|
149
187
|
|
|
150
188
|
Ordinary sign-out is separate from that destructive action. It writes only a private
|
|
151
189
|
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.
|
|
153
|
-
the marker and reloads
|
|
190
|
+
SecretVault identity, keys, tokens, conversations, attachment index, and cached image previews. **Resume local
|
|
191
|
+
identity** removes the marker and reloads that identity without registration. The signed-out screen does not
|
|
192
|
+
show a competing recovery path by default; phone recovery appears only after resume fails. **Use another
|
|
193
|
+
identity** requires a checked destructive-data confirmation and returns to the unified Handle entry only after
|
|
194
|
+
local clearing succeeds, where the same form creates a new identity or recovers an existing one.
|
|
154
195
|
|
|
155
196
|
The provider domain and message-service DID are protocol identifiers. Do not
|
|
156
197
|
infer them from an API hostname. Production service URLs must use HTTPS. The IM Core state directory contains access material;
|
|
@@ -216,15 +257,15 @@ Web client bundle. Exposing it across an untrusted boundary would create a signi
|
|
|
216
257
|
|
|
217
258
|
## Development
|
|
218
259
|
|
|
219
|
-
Requirements: Node.js 22.19+ (or 24+) and pnpm 11.
|
|
260
|
+
Requirements: Node.js 22.19+ (or 24+) and pnpm 11.22.
|
|
220
261
|
|
|
221
262
|
```bash
|
|
222
263
|
pnpm install --frozen-lockfile
|
|
223
|
-
pnpm run verify
|
|
264
|
+
pnpm run verify:workspace
|
|
224
265
|
pnpm pack --dry-run
|
|
225
266
|
```
|
|
226
267
|
|
|
227
|
-
The production Host loads the exact `@awiki/im-core-node@0.1.
|
|
268
|
+
The production Host loads the exact `@awiki/im-core-node@0.1.6` runtime package;
|
|
228
269
|
the platform-specific native addon is selected through its optional dependencies
|
|
229
270
|
and remains external to the JavaScript bundle. Consumers do not need Rust or an
|
|
230
271
|
`awiki-cli-rs2` checkout. See `THIRD_PARTY_NOTICES.md` for provenance and
|
package/README.zh.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
为 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 提供 AWiki
|
|
4
4
|
身份与消息能力。一个包同时包含 Host Service、Rust SDK Provider、Agent 工具,
|
|
5
|
-
以及带可拖动 AWiki Me 悬浮入口的 Web
|
|
5
|
+
以及带可拖动 AWiki Me 悬浮入口的 Web 客户端;入口默认位于 DSH 左下角侧栏区域。
|
|
6
6
|
|
|
7
7
|
Rust SDK 独占管理配置的 `stateRoot` 下的身份、SecretVault、数据库、缓存和元数据。
|
|
8
8
|
本版本采用干净切换,不导入旧 TypeScript SDK 的 `identity.json`;升级后需创建新的
|
|
@@ -10,23 +10,33 @@ Rust 身份。
|
|
|
10
10
|
|
|
11
11
|
## 功能
|
|
12
12
|
|
|
13
|
-
- 在 Web UI
|
|
14
|
-
- 点击 AWiki 面板左上角图标可打开账户菜单;普通退出只锁定本机会话,不删除加密身份或消息数据库,重新进入及重启 DSH 后仍恢复同一个 DID 和 Handle
|
|
15
|
-
-
|
|
16
|
-
- 私聊和已有群聊列表、未读角标、最新消息预览、时间更新与昵称持久化。Core SQLite 是持久化真相源:Host 将持久化的对端资料合并进私聊列表,浏览器再按当前身份保留最后一次可信的私聊资料和群名,稀疏轮询中的 Handle、DID 或 Group DID
|
|
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
|
-
-
|
|
23
|
-
-
|
|
24
|
-
-
|
|
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
|
+

|
|
35
|
+
|
|
36
|
+
### 邮件
|
|
37
|
+
|
|
38
|
+

|
|
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
|
|
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,32 @@ 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-
|
|
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.2`,可选包为
|
|
116
|
+
`@awiki/dsh-model-proxy@0.1.0-rc.1`。可选包 peer 固定为主包
|
|
117
|
+
`^0.3.0-rc.1`,避免与仍会
|
|
118
|
+
默认插入旧 runtime 的 `0.2.x` 主包组合后加载两个 Model Proxy。
|
|
119
|
+
|
|
120
|
+
以下环境变量归可选包所有:
|
|
121
|
+
|
|
122
|
+
| 环境变量 | 用途 | 默认值 |
|
|
123
|
+
| --- | --- | --- |
|
|
124
|
+
| `DSH_AWIKI_MODEL_PROXY_URL` | AWiki 托管的 DeepSeek 代理服务根 URL | `https://model.awiki.info` |
|
|
125
|
+
| `DSH_AWIKI_MODEL_CONTEXT_WINDOW` | AWiki 托管模型上下文窗口 | `1000000` |
|
|
126
|
+
| `DSH_AWIKI_MODEL_MAX_TOKENS` | AWiki 托管模型单次最大输出 | `8192` |
|
|
127
|
+
| `DSH_AWIKI_MODEL_TOKEN_REFRESH_SKEW_SECONDS` | 短期 Token 提前刷新秒数 | `60` |
|
|
128
|
+
|
|
95
129
|
插件默认关闭 AWiki 托管模型。用户在首次引导或“设置 → AWiki → 账户与充值”明确启用后,
|
|
96
130
|
才注册 `awiki-deepseek` 路由并把 Flash 设为默认模型;停用时会恢复启用前的默认 Provider、
|
|
97
131
|
模型和 reasoning effort。充值到账只刷新余额,不会自动启用 AWiki 或切换当前模型。
|
|
@@ -99,6 +133,9 @@ Host Service 和 Provider;浏览器客户端由 DSH 根据包元数据自动
|
|
|
99
133
|
设置页同时支持支付跳转和通企付 `ALI_QR` 二维码。支付功能关闭时会显示“开发环境暂未开放
|
|
100
134
|
充值”,但只要账户响应中的 `model_access_available` 为真,仍可启用模型。开发绕过模式会
|
|
101
135
|
展示计算费用和实际扣费的区别,实际扣费固定为 0;未激活价表时不显示臆造价格。
|
|
136
|
+
客户端充值发布门禁在当前 RC 中已打开。创建订单仍要求账户响应返回
|
|
137
|
+
`payments_available=true`;否则界面会提示充值不可用且不发送订单 RPC。该门禁继续作为
|
|
138
|
+
现有支付、轮询和取消流程的紧急回退开关。
|
|
102
139
|
正式计费时,账户摘要不会显示内部的“计费模式”项。后端返回
|
|
103
140
|
`model_access_reason=insufficient_balance` 时,界面会把充值作为当前主要操作,余额到账前
|
|
104
141
|
不显示误导性的启用按钮。Host 会在每次重新打开设置时恢复最新的待支付订单和支付入口,
|
|
@@ -121,7 +158,9 @@ DSH 会把选择写入自己的设置文件,并在下次重启 Harness 后生
|
|
|
121
158
|
|
|
122
159
|
普通“退出登录”与危险区域的永久清空相互独立。退出只写入一个 Host 私有会话标记,
|
|
123
160
|
同时阻止 Web UI 和 Agent 使用该身份;SecretVault 中的身份、密钥、令牌、会话、附件索引和图片预览缓存
|
|
124
|
-
|
|
161
|
+
全部保留。“重新进入本机身份”会移除标记并恢复同一个本机身份,不需要重新注册。退出页默认不显示恢复入口;
|
|
162
|
+
只有重新进入失败后,才提供原身份的手机号恢复。“使用其他身份”必须先勾选不可逆数据清除确认,清理成功后回到
|
|
163
|
+
统一身份入口,并由同一个 Handle 表单判断是创建新身份还是恢复已有身份。
|
|
125
164
|
|
|
126
165
|
Provider 域名和消息服务 DID 都是协议标识,不能根据 API host 猜测。生产环境 URL
|
|
127
166
|
必须使用 HTTPS。IM Core 状态目录含访问材料,应置于仓库外,限制文件权限,并为磁盘
|
|
@@ -178,15 +217,15 @@ redirect,由 Rust 自动选择当前 origin 的进程内 Bearer Token 或新 H
|
|
|
178
217
|
|
|
179
218
|
## 开发与验证
|
|
180
219
|
|
|
181
|
-
需要 Node.js 22.19+(或 24+)以及 pnpm 11.
|
|
220
|
+
需要 Node.js 22.19+(或 24+)以及 pnpm 11.22:
|
|
182
221
|
|
|
183
222
|
```bash
|
|
184
223
|
pnpm install --frozen-lockfile
|
|
185
|
-
pnpm run verify
|
|
224
|
+
pnpm run verify:workspace
|
|
186
225
|
pnpm pack --dry-run
|
|
187
226
|
```
|
|
188
227
|
|
|
189
|
-
生产 Host 加载固定版本 `@awiki/im-core-node@0.1.
|
|
228
|
+
生产 Host 加载固定版本 `@awiki/im-core-node@0.1.6`;平台原生 addon 由它的
|
|
190
229
|
optional dependencies 选择,并保持在 JavaScript bundle 外。使用者无需安装 Rust,
|
|
191
230
|
也无需检出 `awiki-cli-rs2`。来源与许可证见 `THIRD_PARTY_NOTICES.md`。
|
|
192
231
|
|
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## AWiki Rust IM Core Node SDK
|
|
4
4
|
|
|
5
|
-
`@awiki/im-core-node@0.1.
|
|
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:
|