Introduction¶
When developing across multiple Windows machines or different DSH Home directories, plugin versions, themes, model options, and home/profile patches often drift apart: one machine may have a specific pinned commit installed, while another remains on an older manifest. Mixing credentials and NAS paths into the repository also introduces security risks. Manually copying node_modules or entire directories is difficult to verify for running versions and cannot keep other computers consistent when plugins are added or removed.
Below is an introduction to the community plugin dsh-environment-sync (maintainer vb2250158, classified under “Memory” on SkillHub): it stores plugin manifests, portable settings, and encrypted credentials through private or public Git repositories, and performs pinned-commit installation and recovery across both Web and Desktop hosts. Chat, attachments, run logs, and local data libraries are not uploaded.
What Is This¶
dsh-environment-sync is an open-source DSH environment synchronization and personal plugin management component (repository vb2250158/dsh-environment-sync). It provides an “Environment Sync” capability in the management panel: it brings the entire DSH plugin set and shared configurations into a Git workflow, allowing other computers to pull and apply them using the same sync key.
The documentation states that this release requires DSH 0.2.1-alpha.1 or a compatible 0.2 distribution; more detailed compatibility notes are available in docs/dsh-0.2-compatibility.md within the repository. The current version in package.json is 0.7.18.
Core Features¶
Sync Scope and Boundaries¶
- Synchronize the entire DSH plugin set and shared configurations through Git; both public and private plugins use pinned commits (full 40-character commit hashes) in the manifest.
- The private environment repository stores manifests, configurations, and encrypted credentials; chat, attachments, run logs, and local data libraries are not uploaded.
- Web and Desktop share the plugin version manifest, themes, model settings, and other portable configurations; the
profileflag in the manifest indicates the export source but does not prevent cross-import between the two hosts. Actual installation writes to the explicitly specified target profile without copyingnode_modules. - Device-specific settings such as network addresses, NAS paths, and data library locations do not enter shared configurations; machine-specific fields can be registered in the local
private-sync.local.yaml.
Manifest and Configuration Formats¶
environment.jsonformat 2 stores the sync scope; legacy format 1 is read-only for migration.config/plugins.jsonstores exact versions and sources; original author and fork information is preserved with the records.- Since 0.7.0,
.agent-presets/<id>/under the Home directory can be uploaded and restored alongside the shared environment (includingagent.cordis.yml, optionalpreset.yml, skills, and binary assets, etc.);environment.json.agentPresetsrecords files, execution permissions, and explicit deletions. - Since 0.7.1,
.dsh-agent-presets-sync-baseline.jsondistinguishes managed files from remote files not yet restored; this baseline remains local only.
Credentials and Plugin Metadata¶
.credentials.yamlandplugins/subscriptions/auth.jsonare jointly encrypted intocredentials.enc.jsonusing AES-256-GCM and scrypt.- The sync key is stored locally in
private-sync.keyand does not enter the repository; it cannot be regenerated on a new computer to replace the original key—it must be transferred through a secure channel from a machine capable of decrypting the current snapshot. - The plugin display name, scope, and description in the management page come from each plugin’s own
catalog.json(fields includename,scope:session/global,description, etc.), maintained separately from the version and source information inconfig/plugins.json.
Web and Desktop Behavior Notes¶
- The environment sync client reads the full state on first opening of the management panel and does not pre-warm the plugin catalog at startup; state updates after refresh/operations and concurrent state request merging remain available.
- Web uses two-phase installation: after the frozen lockfile installation completes, only packages newly added in this round and declaring
dsh.bundleare enabled; existing bundles retain their enable/disable status and order; enable failures revert to the original profile. - Desktop installation and recovery go through the official
pluginManager, without writing sourcelink:overrides or launching the Web Host; new packages are not pre-enabled after installation, and bundle selection is synced after the environment is applied, taking effect only after a complete exit and reopen.
Management Panel Daily Operations (Documentation Summary)¶
| Operation | Effect |
|---|---|
| Check for updates | Only fetches remote references |
| Upload changes | Records plugin additions/removals, versions, and shared configurations; saves local modifications first, then merges remote and uploads |
| Pull and apply / Retry | Saves local modifications, merges Git updates, pre-checks pinned commits and keys, installs/upgrades/removes plugins, and applies configurations |
| Install / Update plugin | Enters a GitHub repository address and automatically resolves the pinned commit |
| Conflict resolution | Selects to keep local or remote complete version per file |
| Restart and load | Uses the managed Windows restart entry when needed; installation completion does not mean the old process has loaded new code |
| Restore last environment | Restores configurations and plugins; on network failure, preserves recovery points for retry |
Plugins in subdirectories can use specifiers such as github:owner/repository#<40-char commit>&path:packages/plugin or git+https://...; before installation, the package.json in the commit’s subdirectory is read to verify the package name and version.
Installation and Activation¶
The first installation described in the documentation targets a built Windows DSH source environment and requires setting DSH_SOURCE_ROOT. Compatibility checks use the DSH 0.1.3-alpha.1 source interface (upstream commit d347e703908d0406b7a7ef80e3a0e594d86b2215); this plugin does not update or overwrite the DSH source code.
The steps are as follows:
- Clone the
v0.6.1release tag of this plugin and record its full commit (as required by the documentation; this coexists withpackage.jsonversion 0.7.18, with the README’s first-installation section taking precedence). - Git must already have read access to the private environment repository.
- Run the bootstrap in PowerShell (replace
<owner>and<private-environment>with your repository):
./scripts/bootstrap-environment.ps1 -SourceRoot <DSH源码目录> -Repository https://github.com/<owner>/<private-environment>.git
- On first entry to “Plugins → Environment Sync → Configuration”, enter the same sync key as the original computer and click “Pull and Apply”. The key is stored only in the local
private-sync.key. - Keep the recovery runtime in the installation directory; the local
Recover DSH.vbscan open the recovery window without depending on the DSH page.
Daily startup: After restarting the computer, double-click Start DSH.vbs in the DSH Home to start the service, then open the local DSH page.
Note: The captured documentation does not provide a SkillHub one-click dsh plugin add ... installation command; please refer to the README’s bootstrap and the in-panel environment sync workflow.
Typical Usage and Maintenance¶
Switching Machines or Integrating a New Directory¶
After bootstrap and key configuration, execute “Pull and Apply” on the new machine to install plugins at pinned commit versions according to the shared manifest and apply portable configurations; local items such as NAS, Web Server, etc. retain the target computer’s original values.
Daily Collaborative Sync¶
After modifying plugins or shared settings locally, use “Upload Changes”; other computers then “Check for Updates” and “Pull and Apply”. The documentation suggests: repeated synchronization should produce no new commits, which serves as a simple signal of whether synchronization is healthy.
Stale Unfinished Transactions (Maintenance Window)¶
If the profile contains stale transactions such as applying or restore-failed, the documentation requires not to directly click retry, pull and apply, or upload; instead, read-only inspect the profile, manifest, lock file, and processes first, then run the takeover script during a maintenance window (the backup directory must be under the backups folder of that DSH Home):
node scripts/takeover-stale-transactions.mjs `
--dsh-home <绝对 DSH Home> `
--profile <profile> `
--repository <绝对私库克隆> `
--backup-directory <DSH Home/backups/本轮目录> `
--confirm-preserve-current `
--acknowledge-unverified-installation `
--confirm-exclusive-maintenance
This entry only backs up and moves out the stale journal—it does not restore snapshots, install, upload, or restart; after completion, you need to separately run the official installation entry according to the current manifest and verify the running version.
Applicable Scenarios and Notes¶
For whom: DSH users who need consistent plugin manifests, themes/models, and encrypted credentials across multiple Windows computers or different DSH Home directories, while wanting to use Git for version and conflict management; teams or individuals using private environment repositories to store config/plugins.json and encrypted snapshots.
Important notes:
- Plugins run under DSH process privileges; before installation, you should read the repository source code and LICENSE to confirm the source and license.
- Pinned commits must already be pushed to the remote and stably accessible; commits that are only local or not reachable from a branch head will fail during package retrieval and may dirty the local repository, blocking the next sync. Use the full commit hash when verifying.
- Keys, decrypted credentials, data libraries, and session data must not be committed or appear in logs or shared content.
- Browser companion extensions need to be manually “loaded as unpacked extension” in the browser’s extension management page—this is separate from the plugin manifest; extension updates require reloading the extension and refreshing already-open pages.
- First-time integration does not uninstall existing plugins outside the manifest; correct disk versions do not mean the page has taken effect—you need to restart and verify the running version.
- Uncommitted external changes in the repository will be preserved and block overwriting; conflicts are resolved by selecting the complete local or remote version per file—do not arbitrarily
reset / clean.
Conclusion¶
dsh-environment-sync brings DSH’s plugins and portable environment into Git-collaborable manifests and encrypted credentials, distinguishing local-specific paths and session data, and performing pinned-commit installation and recovery across Web/Desktop. Directory page and source code: