kingcharleslzy-ai/dsh-purge
kingcharleslzy-ai/dsh-purge独立维护的 dsh-purge 社区分支,提供宿主策略补丁、提示词与规则设置、诊断、独立的更新检查与安装控制,以及本机备份回滚。
为 DeepSeek Harness 智能体提供基于开放协议ANP的原生身份,以及基于该身份的私聊、群聊、邮件和智能体间通信能力。
AWiki account, authorization, recovery, and messaging for DeepSeek Harness. The package installs one Host service, its IM Core provider, the model tools, and a Web client with a draggable AWiki Me launcher. General DID documents and private keys are managed by the independent @agent-network-protocol/dsh-anp-identity plugin and injected through Cordis.
Identity-entry failures preserve the currently mounted form and local pending identity material. The phone and OTP never enter browser persistence, controller snapshots, or public Remote results. Closed registration, unavailable verification state, and commit conflicts each give a safe next action without exposing remote response details. The exact Node error short_handle_invite_required returns registration to the editable identity form and shows the fixed invitation notice; neither Handle length nor remote error text selects that UI.
The two plugins deliberately own different state. ANP Identity owns the multi-DID Store, DID documents, private keys, and publication transactions. AWiki IM Core owns Handle/account bindings, device and recovery workflows, authentication tokens, messages, mail, SQLite, and caches below its configured stateRoot. The Host-only provider lease is never exposed to Browser, Remote, Agent tools, or model APIs.
APPROVE / REVOKE confirmation.applied, the Host resolves the recovered Handle's original mailbox under the current DID. Inbox and sent views remount for that identity; sent history is read from the Mail Service with mail.list(direction=outbound), never from the removed Host-local sent store. The optional Model Proxy package independently authenticates that current DID and sends only strict {} to the Model endpoint; it never requests or carries a User Service recovery credential, DID path, proof, assurance, or ledger owner. It consumes only the actual outcome-only Model response (restored, already_current, or not_applicable); transition assurance remains a Model server-side operation/audit/DB oracle and is not inferred by DSH.0600 file handshake with separately operated Model/Mail producers; DSH verifies producer, target, source candidate, measurement window, receipt path, and shared operation fingerprints but never launches those external producers. The current Mail send API is text-only, so outbound attachment-preservation evidence remains blocked until DSH/Core expose an independently reviewed attachment-send seam.@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.awiki-deepseek with deepseek-v4-flash and deepseek-v4-pro; Flash is recommended and credentials never enter the Browser./new, /status, and /help.Browser-selected attachments use Host-authenticated HTTP (mail.send / mail.getAttachment on /mail/rpc), with no new IM Core attachment API. Up to 10 files can be selected. The current signing API accepts at most 4 MiB per request: the effective decoded upload limit is 2.625 MiB per file and in total (or a lower configured limit), reserving room for Base64 and JSON metadata. Downloads support up to 10 MiB per file. The UI obtains these limits from Host. Send confirmation lists filenames and sizes; attachment sends are never automatically replayed, including authentication retries.
Download responses are bounded before JSON parsing and validated against attachment index, safe filename, MIME type, canonical Base64 and decoded size; Browser also verifies the Host SHA-256 against the selected metadata. Inbox and sent downloads use the authoritative service message ID. Pending operations are fenced on identity or tenant changes. File selections remain only in owner/tenant-scoped process memory across drawer remounts, never in persistent browser storage. Agent tools remain plain-text-only.
Host options mailAttachmentMaxCount, mailAttachmentMaxBytes and mailAttachmentTotalMaxBytes may lower the service limits; the effective upload budget is additionally clamped to the signing transport limit. mailAttachmentMaxBytes also bounds downloads.
The first release does not implement end-to-end encryption, multiple identities, post-creation group administration or multiple attachments in one message. The Agent listener accepts only plain Direct text; Groups, attachments, encrypted/payload content, and unknown slash commands never reach the Agent.
Mail v1 provides an on-demand browser mailbox/compose UI and five on-demand Agent tools. Inbox uses the existing Core inbound query; sent uses a fixed Host-only, current-identity-authenticated mail.list(direction=outbound) query. The identity-scoped browser cache may keep the last visible page during an explicit refresh error, but it is never sent-history authority. A successful send is attempted once and triggers one server-backed sent refresh in the browser. Mail does not wake an Agent for new mail, render or send HTML, or implement reply, forward, and threading. Mail subject, addresses, preview, body, timestamps, and attachment metadata are untrusted external data, never Agent instructions. awiki_mail_mark_read and awiki_mail_send require execution approval. Mail send is attempted once without automatic retry; a timeout or transport loss returns delivery-unknown, so inspect the mailbox before approving another send.
Identity recovery does not add server-side private-chat restoration. A fresh local state does not reconstruct historical Direct conversations; only ordinary data already retained by the Rust SDK continues to follow Core's existing local migration rules. Mailbox and hosted-model reconciliation are independent of that private-chat boundary.
Version checks, manual upgrade commands, and tenant isolation are documented in Updates.
Install the independent identity plugin first, then AWiki:
dsh plugin --profile web add @agent-network-protocol/dsh-anp-identity@latest
dsh plugin --profile web add @awiki/dsh-plugin@latestThe main package no longer installs the AWiki-hosted model provider. Add the independently versioned Model Proxy package only when that capability is wanted:
dsh plugin --profile web add @awiki/dsh-model-proxy@latestThe profile installer both adds the package and activates its bundle layer. A plain npm i @awiki/dsh-plugin in a DSH project only installs the package; it does not activate the bundle, so the profile command remains the recommended installation path. This release line targets the 0.1.5-rc.1 package family and pins every direct Host peer exactly, preventing npm from mixing prerelease families in a DSH root dependency tree.
@awiki/dsh-plugin is the canonical package identity starting with 0.2.0-rc.4. The former @awiki/dsh registry entry was unpublished and is not an installation source for this release line.
Apply the packages after the normal DSH base and Web app bundles. The standalone ANP Identity package owns the Identity Service and native Provider layer. This package's cordis.patch.yml adds only the AWiki Host Service, IM Core Provider, and summary Provider; DSH discovers and injects the browser client through package metadata. Teardown closes IM Core before revoking its identity lease, and the identity Store Provider closes last. The patch does not insert Model Proxy. The optional package has its own patch, inserts exactly one awiki-model-proxy row after AWiki, and declares an explicit dependency on the loaded awiki service.
Full keys, sources, purposes, and defaults: docs/configuration.md.
Fresh installations contain exactly the package's two built-in tenant slots and start on its configured default slot. The repository default is AWiki China followed by AWiki Global. Existing official state is promoted in place when its endpoint still matches, without moving its identity, messages, attachments, Vault, or state directory. A non-empty state root created before the tenant registry keeps the immutable awiki.info endpoint snapshot shipped by that release line. Operators who have positive deployment evidence that the old root belongs to a current official slot may classify it once with DSH_AWIKI_LEGACY_TENANT_SLOT. Settings → AWiki → Tenant switches the Host-owned runtime transactionally; the two official tenants are immutable, while custom tenants use independent storage scopes. Build with pnpm run build -- --tenant-config /absolute/path/tenants.json to replace the complete two-slot catalog; partial merging and hidden official fallbacks are not supported. Set deployment variables only for legacy private/development migration inputs:
Variable · Purpose · Default DSH_AWIKI_USER_SERVICE_URL · Legacy absolute AWiki user-service URL · Package default tenant Origin DSH_AWIKI_USER_SERVICE_DOMAIN · Legacy Handle provider domain · Package default tenant DID host DSH_AWIKI_LEGACY_TENANT_SLOT · Evidence-based one-time official-slot override for pre-registry state · Unset; preserve the historical awiki.info snapshot DSH_AWIKI_MESSAGE_SERVICE_URL · Legacy Message-service URL · Package default tenant Origin DSH_AWIKI_MAIL_SERVICE_URL · Mail-service URL called by the Host · Resolved user-service URL DSH_AWIKI_MESSAGE_SERVICE_DID · Legacy authoritative message-service DID · Package default tenant DID DSH_AWIKI_MESSAGE_SERVICE_PUBLIC_URL · Legacy public protocol endpoint · Package default tenant Origin DSH_AWIKI_ALLOWED_ATTACHMENT_ORIGINS · JSON array of extra exact HTTPS origins · [] DSH_AWIKI_STATE_ROOT · Private Rust IM Core state directory · $DSH_HOME/awiki/im-core or ~/.dsh/awiki/im-core DSH_ANP_IDENTITY_STATE_ROOT · Independent multi-DID ANP Identity Store · $DSH_HOME/anp-identity DSH_ANP_IDENTITY_ROOT_KEY_PROVIDER · Store Root Key provider (keyring, local-file, env, or programmatic injected) · keyring DSH_ANP_IDENTITY_ROOT_KEY_PROVIDER_ID · Keyring account, environment variable, or injected-provider identifier · anp-identity/dsh 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 DSH_AWIKI_VAULT_WORKSPACE_ID · Stable non-secret Vault workspace context · dsh-awiki DSH_AWIKI_VAULT_DEVICE_ID · Stable non-secret Vault device context · local-device DSH_AWIKI_POLL_INTERVAL_MS · Open-dialog polling interval · 5000 DSH_AWIKI_ATTACHMENT_MAX_BYTES · Decoded attachment limit · 10485760 DSH_AWIKI_IMAGE_CACHE_MAX_BYTES · Private verified image-preview cache budget · 67108864 DSH_AWIKI_REALTIME_ENABLED · Enable the identity-level Direct/Group/System Notification WSS · true DSH_AWIKI_LISTENER_ENABLED · Enable the Direct-to-Agent listener · false DSH_AWIKI_LISTENER_ALLOWED_PEERS · JSON array of exact Handles or DIDs; required when enabled · [] DSH_AWIKI_LISTENER_WORKSPACE_PATH · Absolute shared Workspace for AWiki-originated Sessions · $DSH_HOME/workspaces/awiki or ~/.dsh/workspaces/awiki DSH_AWIKI_SUMMARY_MAX_INPUT_BYTES · UTF-8 cap after Host-side summary minimization · 32768 DSH_AWIKI_SUMMARY_TIMEOUT_MS · One-shot model deadline · 30000 DSH_AWIKI_SUMMARY_MAX_OUTPUT_TOKENS · Structured summary output cap · 768
This capability now requires the separate @awiki/dsh-model-proxy package. It uses ctx.awiki.externalHttpAuth to obtain a short-lived model token inside the Host and reuses the Harness DeepSeek adapter. The Browser receives only sanitized account, usage, and order state over a loopback RPC channel. DID signatures, bearer tokens, and upstream platform credentials are absent from the browser bundle.
The former runtime import @awiki/dsh-plugin/model-proxy has been removed. Use @awiki/dsh-model-proxy; the shared browser-safe contract intentionally remains @awiki/dsh-plugin/model-proxy-contract. Installing only the main package keeps model onboarding, account/recharge, and usage entry points hidden while leaving AWiki Advanced settings functional.
The split-package line was introduced by @awiki/dsh-plugin@0.3.0 and @awiki/dsh-model-proxy@0.1.0. The current candidate manifests are 0.3.9 and 0.1.4, and Model Proxy requires main ^0.3.9. This keeps the shared awikiClient Browser bridge and tenant-capability contract on the same reviewed line.
The optional package owns these configuration variables:
Variable · Purpose · Default DSH_AWIKI_MODEL_CONTEXT_WINDOW · AWiki-hosted DeepSeek context window · 1000000 DSH_AWIKI_MODEL_MAX_TOKENS · Maximum AWiki-hosted DeepSeek output · 8192 DSH_AWIKI_MODEL_TOKEN_REFRESH_SKEW_SECONDS · Early short-token refresh interval · 60
AWiki-hosted DeepSeek is disabled by default. Its opt-in and fallback selection are persisted per tenant. Only an explicit choice in onboarding or Settings → Quick Recharge → Account & Recharge registers the awiki-deepseek route and selects Flash. Disabling restores the previous provider, model, and reasoning effort. A successful recharge refreshes the balance but never enables AWiki or changes the selected model automatically.
The settings UI supports both payment redirects and TongQiFu ALI_QR content. When payments are disabled it reports the development restriction without blocking an account whose model_access_available flag is true. Development bypass displays calculated and charged amounts separately, with zero charged; it does not invent a price when no price table is active. Public recharge creation also has a client release gate in packages/dsh-model-proxy/src/client/recharge-availability.ts. The current stable line ships that gate open. Order creation still requires the account response to report payments_available=true; otherwise the UI reports that payments are unavailable and sends no order RPC. The gate remains a single emergency rollback for the existing payment, polling, and cancellation flows. Strict billing keeps the internal billing-mode label out of the normal account summary. When the backend reports model_access_reason=insufficient_balance, recharge becomes the primary action and model enablement is withheld until credit is available. The Host restores the newest pending order and its payment action whenever the settings page is reopened, polls it without creating duplicates, and still requires an explicit model opt-in after payment. Recharge amounts are immutable after order creation. To choose another amount, the user confirms Cancel and change amount; the Host first closes the provider order, then restores the amount editor without creating a replacement. A close failure leaves the existing payment action available, while a payment that wins the race refreshes the credited account instead of being reported as cancelled.
Settings → AWiki is split into Tenant, Devices, Local data, and Guest integration. Tenant changes are available before registration, while recovering, while signed out, and while signed in. A successful switch opens the target scope before committing the active tenant; a failure reconstructs the previous runtime. The legacy awiki.domain setting is migration input only and continues to reference its existing state path.
The settings page talks to a plugin-owned Connection channel that the Host accepts only from loopback. This keeps an independently installed @awiki/dsh-plugin compatible with stock DSH releases without adding AWiki to a core settings allowlist; non-local browser origins cannot read or mutate the Host setting.
Settings → AWiki → Danger zone clears only this installation's local AWiki state; it does not delete the server-side account or Handle. The dialog requires the displayed confirmation phrase. After success, the local DID keys, access token, registration draft, conversations, attachment index, and cached image previews cannot be recovered by the app, and this installation may lose access to the old identity.
Ordinary sign-out is separate from that destructive action. It writes only a private Host-owned session marker, gates both Web and Agent operations, and retains the SDK-owned SecretVault identity, keys, tokens, conversations, attachment index, and cached image previews. Resume local identity removes the marker and reloads that identity without registration. The signed-out screen does not show a competing recovery path by default; phone recovery appears only after resume fails. **