nuwa-skill
alchaincyf
你想蒸馏的下一个员工,何必是同事。蒸馏任何人的思维方式——心智模型、决策启发式、表达DNA。Distill how anyone thinks.
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:shantanugoel/dsh-agent-browser
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
Native DSH browser tools built on agent-browser — snapshot+ref automation, batched actions, and a baked-in live viewport panel. See PLAN.md for the design document this implementation follows.
Name note:
dsh-browseranddsh-browser-controlon npm are UNRELATED packages by other authors (Playwright/Puppeteer-era browser tools). This project ships asdsh-agent-browser,dsh-agent-browser-coreanddsh-agent-browser-pi.
*CRITICAL — never declare `@deepseek-ai/
as regular dependencies.** DSH guarantees one module instance per host package across the whole process via its$DSH_HOME/profiles/node_modulesfallback links (seehealProfilesModuleFallbackindsh-app-boot). Bundling a copy inside the plugin creates a second instance, and module-scoped symbols (e.g.TOOL_RUNTIME_SCHEDULERindsh-tools) stop matching across the boundary — every tool dispatch then dies withCannot read properties of undefined (reading 'prepare'). Host packages are declared as **optional peerDependencies** here and as devDependencies for local builds only; at runtime they resolve through the harness's shared links. This bit us on 2026-08-25: the 0.1.1 install materialized private copies of@deepseek-ai/dsh-tools+@deepseek-ai/schemastery` into the live profile and killed all tool calls on freshly booted instances.pnpm 11 build-script gate:
agent-browserships apostinstallthat materializes the host-platform native binary. Since 0.43 that binary lives in a per-platform@agent-browser/cli-*optional dependency rather than the main tarball. pnpm ≥ 10 blocks dependency lifecycle scripts unless your project allows them, anddsh plugin addsurfaces that as a hard error (ERR_PNPM_IGNORED_BUILDS). One-time fix, per dsh profile:printf '\nallowBuilds:\n agent-browser: true\n' >> ~/.dsh/profiles/<profile>/pnpm-workspace.yamlthen run the
dsh plugin addcommand below again. (Interactive alternative:cd ~/.dsh/profiles/<profile> && pnpm approve-builds.) The script is an optimization: 0.43's launcher self-heals by linking the platform binary on first run, and we verified the CLI works with scripts ignored as long as optional dependencies stay enabled. The allowance still keeps the install clean under default policy and avoids the first-run setup work.
# in any DSH profile (web GUI, TUI, headless):
dsh plugin --profile web add npm:dsh-agent-browser
# pi sessions:
pi install npm:dsh-agent-browser-pi
Then just ask the agent to use the browser ("open example.com and read the heading"). The panel appears automatically when a session is live, in any of three display modes (remembered per browser):
× to close,
+ to open). Humans can also pop the view out to its own window or hold
takeover to drive the page themselves.browser_eval stays approval-gated unless the operator sets allowEval: true.
Installing into the running ~/.dsh/profiles/web was deliberately not done
from this session (it needs a write outside the workspace plus your consent, and
activation requires a GUI restart anyway). When you're ready:
# Option A — dev link to this checkout (auto-picks rebuilds here):
dsh plugin --profile web add $HOME/dev/dsh-browser-control/packages/dsh-agent-browser
# Option B — published version once on npm:
dsh plugin --profile web add dsh-agent-browser
Then restart the DSH web profile; ask the agent to open a page and the panel
appears. Removing it later is dsh plugin --profile web remove dsh-agent-browser
(reconciler drops the bundle; tracked daemons are stopped on next boot).
Tarball consumption was validated end-to-end (not just source-dir installs):
packed all three packages, installed the adapter tgz into a fresh throwaway
profile (core resolved via a workspace override standing in for the registry),
and confirmed reconcile → composed config layer → 9 tools load from the
installed artifact → require.resolve("dsh-agent-browser/client") hits
client/dist/client.js. Tarball contents audited: no intermediates, types +
LICENSE + patch manifest present.
DSH session (model) Human in the web GUI
│ │
browser_* tools (9) shell.overlay panel
│ │
│ dsh-agent-browser bundle │
├── CLI/JSON subprocess ──┐ │
│ (agent-browser bin) │ │
│ ▼ ▼
│ daemon per session same-origin HTTP/WS
│ (Chrome + CDP) /browser/sessions · /browser/stream
│ │ │
└── registry tracks handles ◄────────────┘ │
(labels, idle reaper, events) ▼
JPEG frames + console feed
(input only while takeover held)
Model traffic never touches raw ports; humans see pixels through one origin-gated
WebSocket. Subagents pass distinct session names for isolation.
| Package | Status | Role |
|---|---|---|
packages/dsh-agent-browser-core |
implemented, tested | Host-agnostic driver: module-relative binary resolution, JSON envelope parsing, batch-over-stdin, session registry, live WS stream client with ack pacing, daemon health/recovery helpers. Zero host dependencies; declares agent-browser@0.43.0 pinned. |
packages/dsh-agent-browser |
server half live-verified, client built | DSH bundle (dsh.bundle.patch): 9 model tools, prompt ladder, cookies redaction, eval gate, WS stream proxy + inventory + pop-out viewer routes. Client half contributes the overlay panel via shell.overlay; bundle format verified against the module-loader contract. Proxy proven end-to-end against a real Chrome daemon (JPEG frames flow). |
packages/dsh-agent-browser-pi |
implemented, typechecked | pi extension (extensions/browser.ts): same tool surface over the shared core; dashboard-URL hint for viewing. |
{success,data,error} envelopes, batch stdin
array-of-arrays, snapshot -i --json refs map, screenshot-to-path,
per-session stream sidecar (<session>.stream holds the port), WS frame
protocol (frame/status/tabs/url/console, base64 JPEG, ack pacing).tab_gone, stale refs),
timeouts/kills, batch bail semantics, lifecycle stripping, session facade,
registry events, binary resolution, stream port discovery.dsh.bundle.patch
reconciliation into dsh.profile.bundles, loader patch rows
(insert: [{id, name, config}]), defineTool + ctx.tools.register,
ctx.systemPrompt.section, ctx.effect disposal, webserver
register/registerUpgrade routes, and the shell.overlay +
conversation.session.header.utilities additive slots for the future panel UI.pnpm install # workspace bootstrap (approve esbuild + agent-browser builds)
pnpm build # tsc across packages
pnpm test # vitest (core package)
Chrome's own process sandbox cannot initialize under seatbelt-style file sandboxes ("sandbox initialization failed"). When running inside such an environment, pass launch args through the bundle config:
- id: browser
config:
launchArgs: --no-sandbox,--disable-crashpad
dsh plugin --profile web add dsh-agent-browser # GUI surface
dsh plugin --profile headless add dsh-agent-browser # headless runs
The plugin command forwards to pnpm, then auto-reconciles the bundle layer:
any dependency whose manifest declares dsh.bundle joins the profile stack,
no manual config edits. Config afterwards is optional via
~/.dsh/profiles/<name>/cordis.patch.yml.
scripts/live-panel-check.mjs): HTTP inventory lists the tracked
session with its discovered stream port; WS client received a real 15 KB JPEG frame
relayed from the Chrome daemon through /browser/stream.{name:"shell.overlay", id:"browser-panel"}
via ctx.slots.inject → ctx.slots.register; component is a plain React function.stripLifecycle (and two inline
spreads in the CLI client) silently converted EVERY array payload (cookies,
console lines, tabs, batch step results) into integer-keyed objects.
Fixed recursively; regression tests added; cookie redaction now proven
end-to-end ([redacted] by default, raw values only with
cookiesRedacted: false).SessionRegistry (options arg; hosts pass
idleTimeoutMs) — closes handles untouched beyond the timeout, emits
closed, unref'd timer, dispose() for teardown; covered by tests.scripts/live-all-tools.mjs) — open, snapshot, find, act (+ mini-snapshot),
get, eval (allowEval), screenshot, tabs, session.{cookies:[...]}, so the old bare-array check skipped
redaction on real daemons and raw values would have reached the model.
New dual-shape helper (src/cookies.ts) + tests cover both shapes.input=1 → input_mouse mousePressed/mouseReleased
(device px) → real DOM click → page state change observed via browser_get.
The daemon's exact contract (camelCase eventTypes, clickCount-on-press,
modifiers bitfield, wheel deltas, keyDown/keyUp shape) was recovered from
agent-browser's own dashboard source and implemented in the panel — snake_case
guesses are silently ignored by the daemon.console.log in the page reached the
WS client through the proxy (proxy-console-marker-42).closed event within ~3s of a 1.2s idle timeout; other sessions untouched.browser_open routes through
the host's approval seam (allowed-once grants the domain for the session,
merged into the daemon allowlist on next spawn); fail-closed without an answerer.metrics in
/browser/sessions; feeds the Code-Mode revisit trigger with data.ctx.webServer existed and silently
skipped mounting. Fixed with the patch DSL's own ordering key
(inject: [webServer] on the insert row) plus a loud fallback error.
A real isolated web instance on port 3092 then served
/browser/sessions correctly on first boot.ArrayBuffer, but the daemon sends every message as TEXT JSON
(base64 JPEG inside) — so the canvas stayed dark while status showed
"live". Node-side tests never caught it because they parse strings
regardless of type. Fixed in panel + pop-out; server-side frame flow was
proven healthy via an independent WS probe against a running instance.client/index.d.ts); intermediate raw.cjs no longer ships.SessionStream hardened: reconnect attempts that ERROR (dead port) now count
against the failure budget — previously a stream pointed at a vanished port
would retry forever. 7 new hermetic tests (decode/ack, backoff, budget,
user-close, sidecar port resolution)..scratch/live-frame.jpg (SOI/EOI verified); browser_find verified live on
example.com incl. its CHANGED link copy ("Learn more") — text, anchored-regex,
and correct zero-matches for stale assumptions.allowed-once grants pass, allowEval bypasses, cookies redact by default.browser_act changed-region mini-snapshot verified LIVE through the registered tool:
open(example.com) → snapshot finds e2 → act(click @e2) returns step outcome plus the
compact post-action tree (page). Stale-ref attempts fail cleanly
(failedCount: 1, no snapshot) exactly as designed.GET/POST /browser/tabs routes (list/switch/close/new over
the session facade — never model-callable; the model keeps its own
browser_tabs). Tab lists also refresh live from the daemon's stream tabs
messages; the pop-out viewer page gained the same strip. Auto-open now fires
at most once per page load so an explicit close sticks. Sidebar reflow: the
panel pads the AppFrame's right edge so the conversation column resizes
instead of being covered. Frame lookup climbs from the panel root to the
overlay layer's data-shell-overlay attribute and steps out one level — the
naive parentElement chain stops at the slot renderer's display:contents
anchor / the out-of-flow layer itself, whose padding cannot reflow anything
(found live). Degrades to plain overlay behavior if the structure moves.
Click-through fix: the collapsed chip keeps
pointer-events:none on its root (so it never blocks the app), but the pill,
action buttons, tab strips, and resize handle now opt back in explicitly —
previously the inherited none made the launcher pill dead once the once-only
auto-open stopped re-forcing the panel open every poll. 6 route/viewer tests
added (19 adapter + 45 core green).browser_eval fails closed unless allowEval: true; otherwise it routes
through the host's interactive approval seam (ctx.approval.request) and permits
only an explicit allowed-once. Human takeover is config-gated
(allowTakeover), toggled per session by a HUMAN via the panel button
(POST /browser/takeover), never model-callable; WS input forwarding requires
input=1 AND the per-session held flag. The panel viewer shows a live activity
feed (console/url lines) under the canvas.defaultTimeoutMs is now REAL (was accepted-but-ignored): scales every
per-op budget (nav 1.5×, snapshot/shot 1×, act 3×, read 0.75×, eval 0.5×)
and flows into the driver as its default call timeout. Dead headless
patch key removed (headed is the actual toggle)./browser/tabs + /browser/takeover POSTs now reject
cross-site Origins (browsers attach Origin even no-cors; bodies parse as
JSON regardless of content-type). Missing Origin (curl) still passes.ctx.tools.register is no longer monkey-patched for call counting — our
own definitions are wrapped before registration instead.closed (stop tool / reaper).close --all no longer runs on
plugin dispose; GET /browser/tabs never boots a daemon; AppFrame padding
mutation removed; daemons scoped under $DSH_HOME/agent-browser; domain
allowlist actually gates browser_open / browser_tabs new; abort signals
forwarded; inject: [webServer] dropped so headless still gets the tools.@deepseek-ai/dsh-tools@0.2.2-rc.1, @deepseek-ai/schemastery@3.19.0, and
@deepseek-ai/cordis@4.1.0; declared engines.dsh: ^0.2.2-rc.1 (so install
compatibility no longer falls back to the old DSH peer ranges),
dsh.manifestVersion: 1, and client manifest inject package names (instead
of the old service name). Verified against the 0.2.2-rc.1 desktop runtime:
bundle composes, the client row loads from /plugins, and the panel mounts
in headless Chrome with no console errors.agent-browser@0.42.0
(from 0.34.0). Adapts to 0.42's protocol changes: cookies now returns a
{cookies:[...]} wrapper (normalized back to an array), session list
returns names instead of objects, and stream/daemon sidecars moved from the
state dir into the socket dir. Since 0.42 ignores AGENT_BROWSER_STATE_DIR,
hosts now isolate through AGENT_BROWSER_NAMESPACE plus a short
AGENT_BROWSER_SOCKET_DIR derived from DSH_HOME; this also avoids the
104-byte Unix socket path limit. Verified live against Chrome: all 9 tools
pass and the ack-paced frame stream delivers JPEG frames.agent-browser@0.43.0
(from 0.42.0). No driver changes were needed: the {success,data,error}
envelope, batch-over-stdin, session list names, {cookies:[...]}, the
socket-dir sidecars (<session>.stream), and the ack-paced WS frame
protocol are unchanged. 0.43 ships the native binary as per-platform
@agent-browser/cli-* optional packages and resolves them through the
pinned package's launcher, so module-relative binary resolution is
unchanged; snapshots gain hint="…" annotations after unnamed/shared-name
refs, which reach the model verbatim (ref parsing is unaffected). Verified
live against Chrome: the driver paths behind all 9 tools, batch act,
cookies/tabs/screenshot, session list, and an ack-paced JPEG frame.bin/ (musl-aware on Linux, ARM64-aware
on Windows) and only falls back to the JS launcher when none exists —
measured ~126ms less per CLI call on macOS. Socket-dir discovery now
composes AGENT_BROWSER_SOCKET_DIR with AGENT_BROWSER_NAMESPACE
(<socket-dir>/namespaces/<ns>/run), so stream connects read the sidecar
instead of spawning stream status. Failure classification maps 0.43's
fast closed-tab error (Target closed: CDP session <id> detached; 0.42:
Session with given id not found) to tab_gone, and Unknown ref: eN to
ref_not_found. Verified live against 0.43 + Chrome: native binary path,
composed sidecar discovery with no fallback spawn, and per-call latency.Using a throwaway home (DSH_HOME=.scratch/dsh-home) so nothing touches a live profile:
dsh plugin --profile browser-test add <pkg> → pnpm install + auto-reconcile:
dsh-agent-browser appended to dsh.profile.bundles.dsh --profile browser-test --dump-config → composed tree contains the
# == dsh-agent-browser layer with the browser row and its config defaults.require("dsh-agent-browser") inside the profile dir) and registers all 9 tools;
the client bundle ships at client/dist/client.js behind exports["./client"].dsh plugin … remove dsh-agent-browser → reconciler drops it from bundles.A full headless chat boot needs a model key, which this environment does not expose; that final smoke is listed below under operator actions.
~/.dsh/profiles/web requires writing outside the
session workspace (and a GUI reload). Command when ready:
dsh plugin --profile web add ./packages/dsh-agent-browser (or a packed tarball path).dsh --profile browser-test "…") once a DEEPSEEK_API_KEY
is present in the launching environment.CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: agent。