fenglangyj/dsh-account-hub

dsh-account-hub

Native DeepSeek Harness account workspace with isolated persistent Camoufox browser profiles

未分類browser-profilescamoufoxdeepseek-harness

DSH Account Hub

A native DeepSeek Harness (dsh) plugin for managing your own accounts in isolated, persistent browser profiles.

Each account gets its own Camoufox profile directory, a cross-process lock, and an owner-bound browser lease. Accounts created in one dsh session cannot be opened or closed by another session, and login data survives closing the browser. The plugin registers native dsh tools and an /accounts command, so the existing dsh Agent, approval prompts, background jobs, and storage are used directly — there is no separate UI, model client, API server, or scheduler.

Scope. This is an account workspace, not a bulk signup tool. Automated registration is limited to systems you own or are explicitly authorized to test, and is configured only by trusted dsh configuration. Third-party sites use manual sign-in and human verification. No CAPTCHA solving, SMS pools, proxy rotation, or bot-detection evasion is included.

Features

  • Native dsh plugin — Cordis bundle with 13 tools plus /accounts; tools are available to the Agent and PTC automatically.
  • One profile per account — stable UUID to profile-directory mapping, with separate cookies, storage, and sessions.
  • Cross-process safety — proper-lockfile lease per profile and a per-session open-browser limit.
  • Owner isolation — browser leases are bound to the calling dsh session, never to a tool argument.
  • Persistent login — closing the browser keeps the profile; reopening restores that account's session.
  • Account workspace — create, list, filter, update, summarize, import and export metadata; expiry reminders.
  • Approval before side effects — opening a browser and starting an authorized registration require dsh approval.
  • Native jobs — registration runs as a dsh background job with progress, cancellation, and durable history.
  • Exact-origin workflows — owned-system automation may only navigate and submit to configured origins.
  • Local first — no analytics, telemetry, cloud service, or hosted browser.

Requirements

Component · Version / notes dsh · 0.2.1-rc.3 (developer preview; interfaces can change) Node.js · >= 24.9 pnpm · Needed by dsh plugin to install into a profile Camoufox · Downloaded by its launcher on first use; the current build is about 1.3 GB

Camoufox supports Windows x64, macOS, and Linux. The real-browser integration test in this repository has only been run on Windows x64; report platform findings if you run it elsewhere.

Installation

The package is not published to npm yet. Install from a local checkout:

git clone https://github.com/fenglangyj/dsh-account-hub.git dsh-account-hub
cd dsh-account-hub
npm ci --ignore-scripts
dsh plugin --profile web add "/absolute/path/to/dsh-account-hub" --ignore-scripts
dsh --profile web

Replace the path with the absolute path of your checkout (dsh forwards it to pnpm inside the profile directory, so a relative path is not interpreted as this directory). On Windows PowerShell, pass the checkout path directly, for example:

dsh plugin --profile web add "E:\src\dsh-account-hub" --ignore-scripts

--ignore-scripts is deliberate: this package ships plain ESM and needs no install-time build. The add command links the checkout and appends the bundle to the profile. Confirm the layer is present:

dsh --profile web --dump-config

Look for the # == dsh-account-hub section. Then start dsh normally and ask the Agent to use the account tools, or use /accounts help in a session.

To remove it:

dsh plugin --profile web remove dsh-account-hub

For a portable tarball, run npm pack in the checkout and dsh plugin --profile web add ./dsh-account-hub-0.1.0-alpha.1.tgz; the archive contains source, the bundle patch, and license notices, never browser binaries or profiles.

First use

/accounts help
/accounts list

Typical Agent-assisted flow:

  1. Add a platform workspace. account_platform_add can only create manual workspaces; automated workflows must come from trusted plugin configuration.
  2. Create an account with account_create. Metadata only — never pass a password or cookie.
  3. Use account_browser_open. Approve the dsh prompt, then sign in yourself in the Camoufox window that opens. Complete any CAPTCHA or SMS step manually.
  4. Close with account_browser_close when done. The profile stays on disk; reopening the account restores it.
  5. For an owned test system, configure a workflow (below), store a credential with /accounts credential , then call account_register. It asks for approval and runs as a native dsh job.

/accounts credential uses recordInput: false, so the command text is not recorded in the session history. The value is still written to the dsh credential provider; the default local provider is plaintext, not an encrypted OS vault. Use it only on a machine you trust.

Configuration

The plugin row accepts this configuration. Existing rows can be overridden by id in $DSH_HOME/profiles//cordis.patch.yml; a patch replaces the whole config object.

- id: account-hub
  config:
    maxOpenBrowsers: 2      # 1..10, default 3
    logRetention: 1000      # 100..10000 records per history table
    platforms: []

Managed platforms

platforms is written by the person administering the dsh installation:

- id: account-hub
  config:
    platforms:
      - id: owned-stage
        name: Owned staging app
        mode: owned
        loginUrl: http://127.0.0.1:4317/login
        signupUrl: http://127.0.0.1:4317/signup
        origins: ['http://127.0.0.1:4317']
        successSelector: '#welcome'
        steps:
          - { action: fill, selector: '#email', field: email }
          - { action: fill, selector: '#password', field: credential }
          - { action: click, selector: '#submit' }
  • mode: manual is for third-party sites: the browser opens at loginUrl, and you do the sign-in.
  • mode: owned enables account_register for a system you own or are explicitly authorized to test.
  • steps and successSelector are required for owned; steps are limited to fill, click, and wait against configured selectors.
  • origins must be exact origins. HTTPS is required except for loopback (localhost, 127.0.0.1, [::1]) test systems. Workflow navigation outside them is rejected.
  • healthSelector is optional; account_browser_state reports whether it is visible without returning page text or URL query strings.

A complete example lives in examples/owned-system.patch.yml.

Tools

Tool · Purpose account_platforms · List configured platform workspaces account_platform_add · Add a manual-login workspace account_create · Create metadata and a unique profile identity account_list · List and filter account metadata account_update · Change label, email, tags, status, or expiry account_summary · Totals, status counts, and expiry reminders account_import · Import version 1 metadata; new IDs are assigned account_export · Export metadata only account_browser_open · Approval-gated browser open for the calling session account_browser_close · Close the browser, keep the profile account_browser_state · Report origin and an optional trusted health marker account_register · Approval-gated owned-system workflow as a native job account_history · Durable job outcomes and safe step events for this session

Profiles and credentials are never returned by tools, written to job output, or included in exports.

Architecture

src/index.js      Cordis plugin: config, tools, /accounts command, lifecycle
src/hub.js        Session ownership, approval, native jobs, workflow orchestration
src/browser.js    Profile paths, leases, locks, capacity, close/cancel semantics
src/camoufox.js   Camoufox persistent-context launcher
src/store.js      Native storage-domain tables and retention
src/domain.js     Input validation, origin policy, metadata model
src/workflow.js   Owned-system workflow with exact-origin network guard
  • Account metadata and history live in the account_hub storage domain.
  • Credentials use the dsh credentials service.
  • Browser leases are keyed by dsh session ID supplied by the host, never by model input.
  • Profiles are stored under $DSH_HOME/account-hub/profiles/.
  • The plugin does not export cookies or profile archives.

Testing

npm run check          # JSDoc type check over src
npm test               # unit + native dsh service integration tests
npm run test:browser   # real Camoufox: isolation and persistence

npm test covers origin policy, metadata, retention, locks, cancellation, approval denial, job lifecycle, and credential redaction using real Cordis/storage/credentials/jobs services where practical. npm run test:browser starts a local fixture site and verifies that two accounts keep separate logins after closing and reopening. It downloads Camoufox on first run, so it is not part of CI.

Known limitations

  • dsh is in developer preview; this plugin pins dsh 0.2.1-rc.3 and may need updates as host APIs change.
  • Accounts are archived with status: disabled, not deleted. Profile directories are not removed by the plugin.
  • Metadata is cached per dsh process. Run one dsh process per home when multiple sessions edit accounts; browser profiles themselves are protected across processes.
  • The owner workflow permits same-origin 301/302/303 redirects (converted to GET) and rejects 307/308 and cross-origin redirects. It is not a general network sandbox; use it only for systems you control.
  • No quota/subscription APIs, token refresh, scheduled health checks, SMS providers, CAPTCHA solvers, proxy rotation, or bulk registration.
  • The default dsh credential provider is plaintext. Profile isolation protects against account data mixing, not against a malicious local process or a compromised OS account.
  • Camoufox brings its own dependency licenses. In particular, the current dependency tree includes ua-parser-js 2.x, offered upstream under AGPL-3.0-or-later or a commercial license. Review THIRD_PARTY_NOTICES before redistribution or hosted use.

Contributing

See CONTRIBUTING.md. Security reports: SECURITY.md.

License

MIT for this plugin's original source, except where noted. Third-party components remain under their own licenses; see THIRD_PARTY_NOTICES. This is an independent community plugin, not an official DeepSeek project.