@awiki/dsh-plugin 0.2.4 → 0.2.5
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 +80 -11
- package/README.zh.md +67 -12
- package/THIRD_PARTY_NOTICES.md +8 -1
- package/cordis.patch.yml +13 -0
- package/lib/client.js +8223 -1939
- package/lib/client.js.map +1 -1
- package/lib/index.js +1486 -59
- package/lib/model-proxy-contract.js +89 -0
- package/lib/model-proxy.js +383 -0
- package/lib/provider.js +2 -1
- package/lib/sdk-adapter-DKgkyApB.mjs +669 -0
- package/lib/typert.host.js +470 -482
- package/lib/typert.remote-client.d.ts +15 -1
- package/lib/typert.remote-client.d.ts.map +1 -1
- package/lib/typert.remote-client.js +469 -103
- package/lib/types/attachment-cache.d.ts +28 -0
- package/lib/types/attachment-cache.d.ts.map +1 -0
- package/lib/types/attachment-cache.js +194 -0
- package/lib/types/attachment-cache.js.map +1 -0
- package/lib/types/client/AwikiMail.d.ts +14 -0
- package/lib/types/client/AwikiMail.d.ts.map +1 -0
- package/lib/types/client/AwikiMail.js +260 -0
- package/lib/types/client/AwikiMail.js.map +1 -0
- package/lib/types/client/AwikiOnboarding.d.ts +22 -0
- package/lib/types/client/AwikiOnboarding.d.ts.map +1 -0
- package/lib/types/client/AwikiOnboarding.js +87 -0
- package/lib/types/client/AwikiOnboarding.js.map +1 -0
- package/lib/types/client/AwikiOverlay.d.ts +15 -0
- package/lib/types/client/AwikiOverlay.d.ts.map +1 -1
- package/lib/types/client/AwikiOverlay.js +251 -20
- package/lib/types/client/AwikiOverlay.js.map +1 -1
- package/lib/types/client/AwikiSettingsSection.d.ts +20 -4
- package/lib/types/client/AwikiSettingsSection.d.ts.map +1 -1
- package/lib/types/client/AwikiSettingsSection.js +279 -23
- package/lib/types/client/AwikiSettingsSection.js.map +1 -1
- package/lib/types/client/RechargeComingSoonDialog.d.ts +11 -0
- package/lib/types/client/RechargeComingSoonDialog.d.ts.map +1 -0
- package/lib/types/client/RechargeComingSoonDialog.js +8 -0
- package/lib/types/client/RechargeComingSoonDialog.js.map +1 -0
- package/lib/types/client/controller.d.ts +82 -4
- package/lib/types/client/controller.d.ts.map +1 -1
- package/lib/types/client/controller.js +517 -74
- package/lib/types/client/controller.js.map +1 -1
- package/lib/types/client/image-cache.d.ts +20 -0
- package/lib/types/client/image-cache.d.ts.map +1 -0
- package/lib/types/client/image-cache.js +177 -0
- package/lib/types/client/image-cache.js.map +1 -0
- package/lib/types/client/index.d.ts +2 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/index.js +84 -41
- package/lib/types/client/index.js.map +1 -1
- package/lib/types/client/model-account-settings-availability.d.ts +4 -0
- package/lib/types/client/model-account-settings-availability.d.ts.map +1 -0
- package/lib/types/client/model-account-settings-availability.js +4 -0
- package/lib/types/client/model-account-settings-availability.js.map +1 -0
- package/lib/types/client/model-availability-controller.d.ts +27 -0
- package/lib/types/client/model-availability-controller.d.ts.map +1 -0
- package/lib/types/client/model-availability-controller.js +111 -0
- package/lib/types/client/model-availability-controller.js.map +1 -0
- package/lib/types/client/model-proxy-controller.d.ts +41 -0
- package/lib/types/client/model-proxy-controller.d.ts.map +1 -0
- package/lib/types/client/model-proxy-controller.js +241 -0
- package/lib/types/client/model-proxy-controller.js.map +1 -0
- package/lib/types/client/recharge-availability.d.ts +6 -0
- package/lib/types/client/recharge-availability.d.ts.map +1 -0
- package/lib/types/client/recharge-availability.js +6 -0
- package/lib/types/client/recharge-availability.js.map +1 -0
- 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 +180 -2
- package/lib/types/client/settings-locales.js.map +1 -1
- package/lib/types/client/slots.d.ts +15 -2
- package/lib/types/client/slots.d.ts.map +1 -1
- package/lib/types/index.d.ts +56 -2
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +462 -31
- package/lib/types/index.js.map +1 -1
- package/lib/types/listener-state.d.ts +23 -0
- package/lib/types/listener-state.d.ts.map +1 -0
- package/lib/types/listener-state.js +124 -0
- package/lib/types/listener-state.js.map +1 -0
- package/lib/types/listener.d.ts +96 -0
- package/lib/types/listener.d.ts.map +1 -0
- package/lib/types/listener.js +575 -0
- package/lib/types/listener.js.map +1 -0
- package/lib/types/mail.d.ts +8 -0
- package/lib/types/mail.d.ts.map +1 -0
- package/lib/types/mail.js +75 -0
- package/lib/types/mail.js.map +1 -0
- package/lib/types/model-proxy-contract.d.ts +61 -0
- package/lib/types/model-proxy-contract.d.ts.map +1 -0
- package/lib/types/model-proxy-contract.js +129 -0
- package/lib/types/model-proxy-contract.js.map +1 -0
- package/lib/types/model-proxy.d.ts +14 -0
- package/lib/types/model-proxy.d.ts.map +1 -0
- package/lib/types/model-proxy.js +371 -0
- package/lib/types/model-proxy.js.map +1 -0
- package/lib/types/provider-api.d.ts +78 -2
- package/lib/types/provider-api.d.ts.map +1 -1
- package/lib/types/provider.d.ts.map +1 -1
- package/lib/types/provider.js +1 -0
- package/lib/types/provider.js.map +1 -1
- package/lib/types/sdk-adapter.d.ts +26 -2
- package/lib/types/sdk-adapter.d.ts.map +1 -1
- package/lib/types/sdk-adapter.js +380 -24
- package/lib/types/sdk-adapter.js.map +1 -1
- package/lib/types/tools.d.ts +10 -0
- package/lib/types/tools.d.ts.map +1 -1
- package/lib/types/tools.js +98 -0
- package/lib/types/tools.js.map +1 -1
- package/lib/types/types.d.ts +103 -1
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/package.json +30 -5
- package/lib/sdk-adapter-DK6RqV-c.mjs +0 -355
package/README.md
CHANGED
|
@@ -19,17 +19,31 @@ TypeScript SDK `identity.json`; create a new Rust-backed identity after upgradin
|
|
|
19
19
|
- Register one deployment-level AWiki identity from the Web UI.
|
|
20
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.
|
|
21
21
|
- 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
|
|
23
|
-
-
|
|
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
|
+
- 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
|
+
- 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
25
|
- A draggable circular launcher, adaptive popup placement, dark mode, and remembered active conversation.
|
|
25
26
|
- 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
27
|
- OTP registration keeps the verification form visible and disables resend with a visible server-directed cooldown countdown.
|
|
27
|
-
- An AWiki
|
|
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
31
|
- 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
|
|
32
|
+
- Five messaging Agent tools: identity status, conversations, history, approved text send, and approved attachment send.
|
|
33
|
+
- Five on-demand mail Agent tools: mailbox account, inbox, plain-text read, approved mark-read, and approved plain-text send.
|
|
34
|
+
- An opt-in realtime listener that lets exact-allowlisted Direct peers continue one DSH Agent session or use `/new`, `/status`, and `/help`.
|
|
30
35
|
|
|
31
36
|
The first release does not implement end-to-end encryption, multiple identities,
|
|
32
|
-
group administration
|
|
37
|
+
post-creation group administration or multiple attachments in one message. The Agent listener accepts only
|
|
38
|
+
plain Direct text; Groups, attachments, encrypted/payload content, and unknown slash commands never
|
|
39
|
+
reach the Agent.
|
|
40
|
+
|
|
41
|
+
Mail v1 is on demand only and has no browser mailbox or compose UI. It does not wake an Agent for
|
|
42
|
+
new mail, render or send HTML, transfer mail attachments, or implement reply, forward, and
|
|
43
|
+
threading. Mail subject, addresses, preview, body, timestamps, and attachment metadata are
|
|
44
|
+
untrusted external data, never Agent instructions. `awiki_mail_mark_read` and `awiki_mail_send`
|
|
45
|
+
require execution approval. Mail send is attempted once without automatic retry; a timeout or
|
|
46
|
+
transport loss returns `delivery-unknown`, so inspect the mailbox before approving another send.
|
|
33
47
|
|
|
34
48
|
## Install
|
|
35
49
|
|
|
@@ -63,18 +77,61 @@ The plugin works against the public `awiki.ai` tenant without environment config
|
|
|
63
77
|
| `DSH_AWIKI_USER_SERVICE_URL` | Absolute AWiki user-service URL | `https://awiki.ai` |
|
|
64
78
|
| `DSH_AWIKI_USER_SERVICE_DOMAIN` | Composition default for the Handle provider domain | `awiki.ai` |
|
|
65
79
|
| `DSH_AWIKI_MESSAGE_SERVICE_URL` | Message-service URL called by the Host | `https://awiki.ai` |
|
|
80
|
+
| `DSH_AWIKI_MAIL_SERVICE_URL` | Mail-service URL called by the Host | Resolved user-service URL |
|
|
66
81
|
| `DSH_AWIKI_MESSAGE_SERVICE_DID` | Authoritative message-service DID | `did:wba:awiki.ai` |
|
|
67
82
|
| `DSH_AWIKI_MESSAGE_SERVICE_PUBLIC_URL` | Public endpoint written to protocol records | `https://awiki.ai` |
|
|
68
83
|
| `DSH_AWIKI_ALLOWED_ATTACHMENT_ORIGINS` | JSON array of extra exact HTTPS origins | `[]` |
|
|
69
84
|
| `DSH_AWIKI_STATE_ROOT` | Private Rust IM Core state directory | `$DSH_HOME/awiki/im-core` or `~/.dsh/awiki/im-core` |
|
|
85
|
+
| `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` |
|
|
86
|
+
| `DSH_AWIKI_VAULT_WORKSPACE_ID` | Stable non-secret Vault workspace context | `dsh-awiki` |
|
|
87
|
+
| `DSH_AWIKI_VAULT_DEVICE_ID` | Stable non-secret Vault device context | `local-device` |
|
|
70
88
|
| `DSH_AWIKI_POLL_INTERVAL_MS` | Open-dialog polling interval | `5000` |
|
|
71
89
|
| `DSH_AWIKI_ATTACHMENT_MAX_BYTES` | Decoded attachment limit | `10485760` |
|
|
90
|
+
| `DSH_AWIKI_IMAGE_CACHE_MAX_BYTES` | Private verified image-preview cache budget | `67108864` |
|
|
91
|
+
| `DSH_AWIKI_LISTENER_ENABLED` | Enable the Direct-to-Agent listener | `false` |
|
|
92
|
+
| `DSH_AWIKI_LISTENER_ALLOWED_PEERS` | JSON array of exact Handles or DIDs; required when enabled | `[]` |
|
|
93
|
+
| `DSH_AWIKI_LISTENER_WORKSPACE_PATH` | Absolute shared Workspace for AWiki-originated Sessions | `$DSH_HOME/workspaces/awiki` or `~/.dsh/workspaces/awiki` |
|
|
72
94
|
| `DSH_AWIKI_SUMMARY_MAX_INPUT_BYTES` | UTF-8 cap after Host-side summary minimization | `32768` |
|
|
73
95
|
| `DSH_AWIKI_SUMMARY_TIMEOUT_MS` | One-shot model deadline | `30000` |
|
|
74
96
|
| `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
|
+
## AWiki-hosted DeepSeek account
|
|
103
|
+
|
|
104
|
+
`@awiki/dsh-plugin/model-proxy` uses `ctx.awiki.externalHttpAuth` to obtain a short-lived
|
|
105
|
+
model token inside the Host and reuses the Harness DeepSeek adapter. The Browser receives only
|
|
106
|
+
sanitized account, usage, and order state over a loopback RPC channel. DID signatures, bearer
|
|
107
|
+
tokens, and upstream platform credentials are absent from the browser bundle.
|
|
108
|
+
|
|
109
|
+
AWiki-hosted DeepSeek is disabled by default. Only an explicit choice in onboarding or Settings → AWiki →
|
|
110
|
+
Account & Recharge registers the `awiki-deepseek` route and selects Flash. Disabling restores the
|
|
111
|
+
previous provider, model, and reasoning effort. A successful recharge refreshes the balance but
|
|
112
|
+
never enables AWiki or changes the selected model automatically.
|
|
113
|
+
|
|
114
|
+
The settings UI supports both payment redirects and TongQiFu `ALI_QR` content. When payments are
|
|
115
|
+
disabled it reports the development restriction without blocking an account whose
|
|
116
|
+
`model_access_available` flag is true. Development bypass displays calculated and charged amounts
|
|
117
|
+
separately, with zero charged; it does not invent a price when no price table is active.
|
|
118
|
+
Public recharge creation also has a client release gate in
|
|
119
|
+
`src/client/recharge-availability.ts`. The gate is currently closed: recharge controls remain
|
|
120
|
+
visible, but attempting to recharge shows a localized coming-soon dialog and sends no order RPC.
|
|
121
|
+
Open that single gate only after the production collection account is ready; the existing payment,
|
|
122
|
+
polling, and cancellation flows remain intact behind it.
|
|
123
|
+
Strict billing keeps the internal billing-mode label out of the normal account summary. When the
|
|
124
|
+
backend reports `model_access_reason=insufficient_balance`, recharge becomes the primary action and
|
|
125
|
+
model enablement is withheld until credit is available. The Host restores the newest pending order
|
|
126
|
+
and its payment action whenever the settings page is reopened, polls it without creating duplicates,
|
|
127
|
+
and still requires an explicit model opt-in after payment. Recharge amounts are immutable after order
|
|
128
|
+
creation. To choose another amount, the user confirms **Cancel and change amount**; the Host first
|
|
129
|
+
closes the provider order, then restores the amount editor without creating a replacement. A close
|
|
130
|
+
failure leaves the existing payment action available, while a payment that wins the race refreshes
|
|
131
|
+
the credited account instead of being reported as cancelled.
|
|
75
132
|
|
|
76
133
|
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
|
|
134
|
+
from Settings → AWiki → Advanced; DSH persists that choice in its settings document and
|
|
78
135
|
applies it after the next Harness restart. The setting affects future identity
|
|
79
136
|
registration and completion of short Handles. It does not rewrite an already
|
|
80
137
|
registered DID or Handle.
|
|
@@ -84,15 +141,15 @@ accepts only from loopback. This keeps an independently installed `@awiki/dsh-pl
|
|
|
84
141
|
compatible with stock DSH releases without adding AWiki to a core settings
|
|
85
142
|
allowlist; non-local browser origins cannot read or mutate the Host setting.
|
|
86
143
|
|
|
87
|
-
Settings → AWiki → Danger zone clears only this installation's local AWiki
|
|
144
|
+
Settings → AWiki → Advanced → Danger zone clears only this installation's local AWiki
|
|
88
145
|
state; it does not delete the server-side account or Handle. The dialog requires
|
|
89
146
|
the displayed confirmation phrase. After success, the local DID keys, access
|
|
90
|
-
token, registration draft, conversations,
|
|
147
|
+
token, registration draft, conversations, attachment index, and cached image previews cannot be
|
|
91
148
|
recovered by the app, and this installation may lose access to the old identity.
|
|
92
149
|
|
|
93
150
|
Ordinary sign-out is separate from that destructive action. It writes only a private
|
|
94
151
|
Host-owned session marker, gates both Web and Agent operations, and retains the SDK-owned
|
|
95
|
-
SecretVault identity, keys, tokens, conversations, and
|
|
152
|
+
SecretVault identity, keys, tokens, conversations, attachment index, and cached image previews. Resuming removes
|
|
96
153
|
the marker and reloads the same local identity without registration.
|
|
97
154
|
|
|
98
155
|
The provider domain and message-service DID are protocol identifiers. Do not
|
|
@@ -100,6 +157,18 @@ infer them from an API hostname. Production service URLs must use HTTPS. The IM
|
|
|
100
157
|
keep it outside the repository, restrict filesystem access, and protect the
|
|
101
158
|
underlying disk and backups.
|
|
102
159
|
|
|
160
|
+
The Node facade owns `stateRoot/vault/root-key.b64u`; the Host does not provide, copy, or log Vault
|
|
161
|
+
key material. Preserve the complete SDK state root across ordinary restarts and upgrades.
|
|
162
|
+
|
|
163
|
+
The listener is disabled unless both `DSH_AWIKI_LISTENER_ENABLED=true` and a non-empty exact
|
|
164
|
+
allowlist are configured. On startup and every Core realtime scheduling signal it runs canonical
|
|
165
|
+
reliable sync before reading committed history. Core owns WebSocket connection and reconnect;
|
|
166
|
+
stream closure is recovered as stop, reconnect sync, then replacement realtime session. One
|
|
167
|
+
persisted route and message watermark per Direct conversation preserve the current DSH Session
|
|
168
|
+
across restarts. Every AWiki-originated Session is created in and attached to the registered shared
|
|
169
|
+
AWiki Workspace. Listener messages are untrusted user data and do not approve tools or bridge
|
|
170
|
+
approval/user-question prompts.
|
|
171
|
+
|
|
103
172
|
For the default 10 MiB decoded attachment cap, configure a reverse-proxy request
|
|
104
173
|
limit of at least 14 MiB to account for base64 and JSON overhead.
|
|
105
174
|
|
|
@@ -155,14 +224,14 @@ pnpm run verify
|
|
|
155
224
|
pnpm pack --dry-run
|
|
156
225
|
```
|
|
157
226
|
|
|
158
|
-
The production Host loads the exact `@awiki/im-core-node@0.1.
|
|
227
|
+
The production Host loads the exact `@awiki/im-core-node@0.1.5` runtime package;
|
|
159
228
|
the platform-specific native addon is selected through its optional dependencies
|
|
160
229
|
and remains external to the JavaScript bundle. Consumers do not need Rust or an
|
|
161
230
|
`awiki-cli-rs2` checkout. See `THIRD_PARTY_NOTICES.md` for provenance and
|
|
162
231
|
licensing.
|
|
163
232
|
|
|
164
233
|
The checked-in Typert Host/Remote artifacts were generated from the same Host
|
|
165
|
-
contract. `pnpm check:generated` pins their complete
|
|
234
|
+
contract. `pnpm check:generated` pins their complete eighteen-method surface until
|
|
166
235
|
the standalone Typert generator supports root-level packages.
|
|
167
236
|
|
|
168
237
|
## Security
|
package/README.zh.md
CHANGED
|
@@ -13,16 +13,28 @@ Rust 身份。
|
|
|
13
13
|
- 在 Web UI 中注册一个部署级 AWiki 身份,根 Agent 与子 Agent 共用。
|
|
14
14
|
- 点击 AWiki 面板左上角图标可打开账户菜单;普通退出只锁定本机会话,不删除加密身份或消息数据库,重新进入及重启 DSH 后仍恢复同一个 DID 和 Handle。
|
|
15
15
|
- 注册失败时保留手机号、Handle、验证码和本机待注册密钥;注册未开放、验证码状态失效和提交冲突会给出对应的安全处理提示。
|
|
16
|
-
-
|
|
17
|
-
-
|
|
16
|
+
- 私聊和已有群聊列表、未读角标、最新消息预览、时间更新与昵称持久化。Core SQLite 是持久化真相源:Host 将持久化的对端资料合并进私聊列表,浏览器再按当前身份保留最后一次可信的私聊资料和群名,稀疏轮询中的 Handle、DID 或 Group DID 占位不会覆盖真实名称。打开会话时先显示 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
21
|
- OTP 注册会保留验证码输入表单,并按服务端返回的冷却时间显示重发倒计时、禁用提前重发。
|
|
21
|
-
-
|
|
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 域名。
|
|
22
25
|
- 在设置页危险区域中,经输入确认词的二次确认后,永久清空本机 AWiki 身份、密钥、令牌、注册草稿和消息索引。
|
|
23
|
-
-
|
|
26
|
+
- 五个消息 Agent 工具:身份、会话、历史、需审批的文本发送和需审批的附件发送。
|
|
27
|
+
- 五个按需邮件 Agent 工具:邮箱账户、收件箱、纯文本读取、需审批的标记已读和需审批的纯文本发送。
|
|
28
|
+
- 可选的实时监听模式:exact allowlist 中的私聊对方可续接一个 DSH Agent 会话,或使用 `/new`、`/status`、`/help`。
|
|
24
29
|
|
|
25
|
-
|
|
30
|
+
首版不包含端到端加密、多身份、建群后的成员或群设置管理和单消息多附件。Agent listener 只接受明文私聊文本;
|
|
31
|
+
群聊、附件、加密/payload 内容和未知斜杠命令都不会进入 Agent。
|
|
32
|
+
|
|
33
|
+
邮件 v1 仅支持按需调用,不提供浏览器收件箱或写信 UI,也不会以新邮件唤醒 Agent;不渲染或
|
|
34
|
+
发送 HTML,不传输邮件附件,也不支持回复、转发和会话串联。邮件主题、地址、预览、正文、
|
|
35
|
+
时间戳和附件元数据都是不可信外部数据,不能作为 Agent 指令。`awiki_mail_mark_read` 和
|
|
36
|
+
`awiki_mail_send` 每次执行都需要审批。邮件发送只尝试一次且不自动重试;超时或传输中断返回
|
|
37
|
+
`delivery-unknown`,再次审批发送前应先检查邮箱。
|
|
26
38
|
|
|
27
39
|
## 安装
|
|
28
40
|
|
|
@@ -52,17 +64,50 @@ Host Service 和 Provider;浏览器客户端由 DSH 根据包元数据自动
|
|
|
52
64
|
| `DSH_AWIKI_USER_SERVICE_URL` | AWiki user service 绝对 URL | `https://awiki.ai` |
|
|
53
65
|
| `DSH_AWIKI_USER_SERVICE_DOMAIN` | Handle 提供方域名的部署默认值 | `awiki.ai` |
|
|
54
66
|
| `DSH_AWIKI_MESSAGE_SERVICE_URL` | Host 调用的 message service URL | `https://awiki.ai` |
|
|
67
|
+
| `DSH_AWIKI_MAIL_SERVICE_URL` | Host 调用的 mail service URL | 解析后的 user service URL |
|
|
55
68
|
| `DSH_AWIKI_MESSAGE_SERVICE_DID` | 权威消息服务 DID | `did:wba:awiki.ai` |
|
|
56
69
|
| `DSH_AWIKI_MESSAGE_SERVICE_PUBLIC_URL` | 写入协议记录的公开 endpoint | `https://awiki.ai` |
|
|
57
70
|
| `DSH_AWIKI_ALLOWED_ATTACHMENT_ORIGINS` | 额外附件 HTTPS origin 的 JSON 数组 | `[]` |
|
|
58
71
|
| `DSH_AWIKI_STATE_ROOT` | 私有 Rust IM Core 状态目录 | `$DSH_HOME/awiki/im-core` 或 `~/.dsh/awiki/im-core` |
|
|
72
|
+
| `DSH_AWIKI_VAULT_ROOT_KEY_FILE` | 含 base64/base64url 32-byte Vault root key 的既有私有文件 | `$DSH_HOME/awiki/secret-vault/root-key.b64u` |
|
|
73
|
+
| `DSH_AWIKI_VAULT_WORKSPACE_ID` | 稳定、非秘密的 Vault workspace context | `dsh-awiki` |
|
|
74
|
+
| `DSH_AWIKI_VAULT_DEVICE_ID` | 稳定、非秘密的 Vault device context | `local-device` |
|
|
59
75
|
| `DSH_AWIKI_POLL_INTERVAL_MS` | 弹窗打开时的轮询间隔 | `5000` |
|
|
60
76
|
| `DSH_AWIKI_ATTACHMENT_MAX_BYTES` | 解码后的附件上限 | `10485760` |
|
|
77
|
+
| `DSH_AWIKI_IMAGE_CACHE_MAX_BYTES` | 私有图片预览缓存的磁盘预算 | `67108864` |
|
|
78
|
+
| `DSH_AWIKI_LISTENER_ENABLED` | 开启私聊到 Agent 的 listener | `false` |
|
|
79
|
+
| `DSH_AWIKI_LISTENER_ALLOWED_PEERS` | exact Handle/DID JSON 数组;开启时必填 | `[]` |
|
|
80
|
+
| `DSH_AWIKI_LISTENER_WORKSPACE_PATH` | 所有 AWiki Session 共用的绝对 Workspace 路径 | `$DSH_HOME/workspaces/awiki` 或 `~/.dsh/workspaces/awiki` |
|
|
61
81
|
| `DSH_AWIKI_SUMMARY_MAX_INPUT_BYTES` | Host 最小化后的 UTF-8 输入上限 | `32768` |
|
|
62
82
|
| `DSH_AWIKI_SUMMARY_TIMEOUT_MS` | 单次模型调用超时 | `30000` |
|
|
63
83
|
| `DSH_AWIKI_SUMMARY_MAX_OUTPUT_TOKENS` | 结构化摘要输出上限 | `768` |
|
|
64
|
-
|
|
65
|
-
|
|
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
|
+
## AWiki 托管模型账户
|
|
90
|
+
|
|
91
|
+
`@awiki/dsh-plugin/model-proxy` 通过 `ctx.awiki.externalHttpAuth` 在 Host 内向模型代理换取
|
|
92
|
+
短期 Token,并复用 Harness 的 DeepSeek Adapter。Browser 只能通过 loopback RPC 读取经过
|
|
93
|
+
裁剪的账户、用量和订单状态;DID 签名、Bearer Token 和上游平台密钥都不会进入浏览器包。
|
|
94
|
+
|
|
95
|
+
插件默认关闭 AWiki 托管模型。用户在首次引导或“设置 → AWiki → 账户与充值”明确启用后,
|
|
96
|
+
才注册 `awiki-deepseek` 路由并把 Flash 设为默认模型;停用时会恢复启用前的默认 Provider、
|
|
97
|
+
模型和 reasoning effort。充值到账只刷新余额,不会自动启用 AWiki 或切换当前模型。
|
|
98
|
+
|
|
99
|
+
设置页同时支持支付跳转和通企付 `ALI_QR` 二维码。支付功能关闭时会显示“开发环境暂未开放
|
|
100
|
+
充值”,但只要账户响应中的 `model_access_available` 为真,仍可启用模型。开发绕过模式会
|
|
101
|
+
展示计算费用和实际扣费的区别,实际扣费固定为 0;未激活价表时不显示臆造价格。
|
|
102
|
+
正式计费时,账户摘要不会显示内部的“计费模式”项。后端返回
|
|
103
|
+
`model_access_reason=insufficient_balance` 时,界面会把充值作为当前主要操作,余额到账前
|
|
104
|
+
不显示误导性的启用按钮。Host 会在每次重新打开设置时恢复最新的待支付订单和支付入口,
|
|
105
|
+
持续查询状态并阻止重复创建;支付到账后仍必须由用户明确启用托管模型。
|
|
106
|
+
充值金额在订单创建后不可修改。需要更换金额时,用户必须确认“取消并修改金额”;Host 会先
|
|
107
|
+
关闭支付平台订单,再恢复金额输入框,并且不会自动创建替代订单。关闭失败时原支付入口继续
|
|
108
|
+
有效;若支付在关闭竞态中先完成,界面会刷新已入账账户,而不会误报订单已取消。
|
|
109
|
+
|
|
110
|
+
Handle 提供方的默认域名为 `awiki.ai`。本机用户可以在“设置 → AWiki → 高级设置”中覆盖该值;
|
|
66
111
|
DSH 会把选择写入自己的设置文件,并在下次重启 Harness 后生效。该设置影响后续
|
|
67
112
|
身份注册和短 Handle 的域名补全,不会改写已经注册的 DID 或 Handle。
|
|
68
113
|
|
|
@@ -70,18 +115,28 @@ DSH 会把选择写入自己的设置文件,并在下次重启 Harness 后生
|
|
|
70
115
|
因此独立安装的 `@awiki/dsh-plugin` 无需修改 DSH 核心设置白名单;非本机浏览器来源不能
|
|
71
116
|
读取或修改这项 Host 设置。
|
|
72
117
|
|
|
73
|
-
“设置 → AWiki → 危险区域”中的清空操作只删除此安装的本地 AWiki 状态,不删除
|
|
118
|
+
“设置 → AWiki → 高级设置 → 危险区域”中的清空操作只删除此安装的本地 AWiki 状态,不删除
|
|
74
119
|
服务端账号或 Handle。执行前必须在确认弹窗中输入指定确认词;成功后本机 DID 私钥、
|
|
75
|
-
|
|
120
|
+
访问令牌、注册草稿、会话记录、附件索引和图片预览缓存无法通过应用恢复,原身份也可能无法再由本机使用。
|
|
76
121
|
|
|
77
122
|
普通“退出登录”与危险区域的永久清空相互独立。退出只写入一个 Host 私有会话标记,
|
|
78
|
-
同时阻止 Web UI 和 Agent 使用该身份;SecretVault
|
|
123
|
+
同时阻止 Web UI 和 Agent 使用该身份;SecretVault 中的身份、密钥、令牌、会话、附件索引和图片预览缓存
|
|
79
124
|
全部保留。“重新进入”会移除标记并恢复同一个本机身份,不需要重新注册。
|
|
80
125
|
|
|
81
126
|
Provider 域名和消息服务 DID 都是协议标识,不能根据 API host 猜测。生产环境 URL
|
|
82
127
|
必须使用 HTTPS。IM Core 状态目录含访问材料,应置于仓库外,限制文件权限,并为磁盘
|
|
83
128
|
和备份提供保护。
|
|
84
129
|
|
|
130
|
+
Node facade 独占 `stateRoot/vault/root-key.b64u`;Host 不提供、不复制也不记录 Vault key
|
|
131
|
+
material。普通重启与升级期间应完整保留 SDK state root。
|
|
132
|
+
|
|
133
|
+
Listener 只有在 `DSH_AWIKI_LISTENER_ENABLED=true` 且 exact allowlist 非空时才启用。启动和每个
|
|
134
|
+
Core realtime 调度信号都会先执行 canonical reliable sync,再读取已提交 history。WebSocket
|
|
135
|
+
连接与重连由 Core 所有;stream 关闭固定按“停止旧 session、reconnect sync、启动 replacement”
|
|
136
|
+
恢复。每个私聊持久化一个当前 DSH Session route 和消息 watermark,重启后可续接;所有 AWiki
|
|
137
|
+
来源 Session 都创建并 attach 到已注册的共享 AWiki Workspace。Listener 消息始终是不可信用户
|
|
138
|
+
数据,不会自动批准工具,也不会桥接 approval 或 user-question prompt。
|
|
139
|
+
|
|
85
140
|
默认附件上限为解码后 10 MiB;反向代理请求体上限至少应为 14 MiB,以容纳
|
|
86
141
|
base64 与 JSON 封装开销。
|
|
87
142
|
|
|
@@ -131,12 +186,12 @@ pnpm run verify
|
|
|
131
186
|
pnpm pack --dry-run
|
|
132
187
|
```
|
|
133
188
|
|
|
134
|
-
生产 Host 加载固定版本 `@awiki/im-core-node@0.1.
|
|
189
|
+
生产 Host 加载固定版本 `@awiki/im-core-node@0.1.5`;平台原生 addon 由它的
|
|
135
190
|
optional dependencies 选择,并保持在 JavaScript bundle 外。使用者无需安装 Rust,
|
|
136
191
|
也无需检出 `awiki-cli-rs2`。来源与许可证见 `THIRD_PARTY_NOTICES.md`。
|
|
137
192
|
|
|
138
193
|
Typert Host/Remote 产物与当前 Host 契约一同提交;在独立 Typert 生成器支持根级
|
|
139
|
-
包之前,`pnpm check:generated` 会固定检查完整的
|
|
194
|
+
包之前,`pnpm check:generated` 会固定检查完整的 18 个 Remote 方法。
|
|
140
195
|
|
|
141
196
|
## 安全
|
|
142
197
|
|
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.5` 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,17 +8,30 @@
|
|
|
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'
|
|
21
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
|
+
|
|
22
35
|
- id: awiki-summary-provider
|
|
23
36
|
name: '@awiki/dsh-plugin/summary-provider'
|
|
24
37
|
config:
|