dsh-bili-scroll
c1overzz
DSH 插件:每天替你刷一轮 B站,读字幕挑出值得的、写一份日报,值得的 @ 你
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:CNSeniorious000/dsh-py-codeact
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A CodeAct agent loop for the DeepSeek Harness: the model's action space is a persistent IPython session, and harness tools are bridged into it as awaitables.
# one cell
from __dsh__.tools import read, glob
import pandas as pd, io
paths = await glob(pattern="data/*.csv")
frames = [pd.read_csv(io.StringIO(await read(file_path=p))) for p in paths]
df = pd.concat(frames)
# a later cell — `df` is still bound, and so are `read`, `_`, `Out[1]`, everything
df.groupby("region").revenue.sum().nlargest(3)
python is the only tool the model can call directly. Everything else lives in __dsh__.tools, so the action space really is one tool — the CodeAct shape.
By default, cells run through InteractiveShell.run_cell_async, so magics, transform_cell, top-level await, execution history, and IPython's traceback formatter all come for free. The shell setup and the LLM-specific touches below follow CNSeniorious000/temporary-mcp-servers:ipython-mcp.py.
Both offer programmatic tool calling. This plugin keeps IPython as the model’s action space.
Code Mode (run_code) |
this plugin (python) |
|
|---|---|---|
| Language | TypeScript (or Python via a backend) | Python, in IPython |
| State between calls | runtime-dependent; persistent execution is supported | persists for the session |
| Layer | a PtcRuntime seam provider |
an ordinary tool plugin |
| Tool surface | a generated tools global |
the __dsh__.tools module |
| Exclusivity | tools.mode: code, enforced by the registry |
mode: code, via prompt assembly + a guard |
| Result | program logs + return value | tagged stdout / return / traceback / note |
DSH 0.2.1 supports persistent PTC execution (persistent-in-memory). This plugin remains an ordinary tool because it provides an IPython-specific interaction model, including magics, history and introspection; persistence alone no longer requires a separate tool.
That tradeoff is real and inherited: the interpreter's live state cannot be reconstructed from a session replay. What IS in the log is every cell's source and every bridged tool call, which is enough to audit what happened.
__dsh__ — the seam__dsh__ is a real package in sys.modules, so every import form resolves:
from __dsh__.tools import glob, grep # the usual one
import __dsh__.tools as T # T.read(...)
from __dsh__ import tools # tools.read(...)
A dunder-named package reads as harness-owned, survives %reset, and leaves the obvious name tools free for the model's own variables.
Each tool is a real async def. dsh's description becomes its __doc__ and its parameters become a keyword-only signature, so the REPL's own introspection does the explaining:
In [1]: read?
Signature: read(*, file_path: 'str', offset: 'int' = ..., limit: 'int' = ...) -> 'ReadOutput'
Docstring:
Read a file from the workspace. Results include line numbers…
Parameters:
file_path: Path to read, resolved by the filesystem backend.
offset: 1-based first line to return. Defaults to 1.
limit: Maximum number of lines to return. Defaults to 2000.
The block renders the same picture: one parameter per line, its description as a trailing comment, the tool's own as a docstring — so what a model reads in the prompt and what it gets from ? are the same text, from the same source. Annotations are rendered host-side by dsh's own exported renderers, so there is no second JSON-Schema mapper to drift.
The return type comes from the tool's own output schema, by way of ctx.tools.sdkSchemas(scope) — the projection that carries it. It is the one annotation the model cannot recover by reading harder: a wrong argument fails loudly at the call, while an unknown return shape is only discoverable by calling once and printing the result, which costs a whole turn per tool. A tool that declares no output schema still renders Any; claiming a type nobody declared would be worse than admitting ignorance.
Every object in that schema is declared as a named TypedDict above the signatures, and an output that is a choice of shapes becomes a union of named branches. For a bridged MCP tool the schema described here is the payload, not the transport wrapper — see below; dict[str, Any] would say a dict arrives without saying which keys, which is the one thing a return annotation exists to say.
class BashOutput1(TypedDict):
kind: Literal["background"]
jobId: str
class BashOutput2Stdout(TypedDict):
text: str
truncated: bool
class BashOutput2(TypedDict):
kind: Literal["foreground"]
exitCode: int | None
stdout: BashOutput2Stdout
async def bash(*, command: str, run_in_background: bool = ...) -> BashOutput1 | BashOutput2: ...
jsonSchemaToPy cannot do this and says so — it is context-free, and naming a TypedDict needs the render context renderToolsSdkPy supplies. With nowhere to hang a declaration it degrades every object to dict[str, Any], which on a stock catalogue is the return type of every tool but one. renderType, the context-carrying core, is not exported, so the context is borrowed instead: renderToolsSdkPy is called with the parameters stripped — the one input it renders without allocating a class, which makes every class it emits an output class — and the block it returns is read back for the declarations and each tool's return text. The Literals, the nested classes, the collision suffixes and the Unicode identifier rules are then dsh's own rather than a second mapper drifting alongside them. The binding set is resent with every cell, because restrictions and mid-conversation tool changes can move a tool in or out between calls.
dsh's MCP client resolves a call to { content, structuredContent? } — the protocol's block array plus the server's own payload — and declares exactly that as the tool's output. That wrapper is transport, not API: content's text duplicates the payload, and an image inside it is re-attached to the conversation separately, so a cell can do nothing with it. Handed the wrapper, a model writes r["structuredContent"]["result"] — and spends a call discovering it has to.
So the bridge unwraps, and the signature describes what the cell actually receives:
mcp.review.search(*, q: str) -> McpReviewSearchOutput # the payload, not the wrapper
mcp.email.ping() -> str # no declared payload: the text blocks, joined
A server that declares no output schema is the common case in the wild, and its result really is just text — one text block, in every one of the 4142 MCP results measured across six trials, which is why this is a str and not a list[str] that would cost an r[0] at every call site to preserve a boundary that never appears. A result carrying no text block at all resolves to the empty string: an image there is re-attached to the conversation and read on the next step, so there was never anything for the cell to receive. One divergence is possible and belongs to the server: a tool that declares an output schema but omits structuredContent on some call resolves to that call's text, where the signature promised the payload type.
Unwrapping keys off the tool's declared output schema, not off the value that comes back: a tool whose own payload happens to be {content: [...]} is not wrapping anything, and replacing its value with joined text would change what that tool returns with nothing to say so. This deliberately differs from Code Mode, which hands the whole envelope to tools.name(args).
MCP servers register into the same ctx.tools registry as everything else, so they arrive in __dsh__.tools like any other binding and dispatch through the same pipeline. They are presented grouped, under one mcp:
from __dsh__.tools import mcp
data = await mcp.gh.github_graphql(query="{ viewer { login } }")
dsh names them mcp__<server>__<rawName>, and with a hundred mounted that import line was most of the prompt block while every call site respelled its server. The flat names stay bound — mcp is how they are shown, not what they are — so a cell written before this still runs, import * still binds them, and only the listings drop them. A name the grouping cannot serve is still shown: dsh hashes a public name that needed normalising and the cut can land before the second __, and a raw name that is a true dunder is refused by __getattr__; either way the flat name is the only one that works. They are kept out of dir(__dsh__.tools) for the same reason the block stopped printing them; a name the grouping cannot reach (dsh hashes a public name that needed normalising, and the cut can land before the second __) stays listed, because mcp is not another way to say it. The block lists them one module per section — # __dsh__.tools, then # __dsh__.tools.mcp.<server> — because that is what they are. It used to declare Protocol stubs with self-taking methods, copied from dsh's own SDK renderer; that renderer describes a singleton object (tools: Tools), while this grouping is a real package, so the stub claimed a binding that never happens. mcp.exa.web_search? answers (*, query: str) -> str, and the block now says the same thing.
It is a real package, so a server can be imported as a module — which reads better than mcp. at every call site when a cell leans on one server:
from __dsh__.tools.mcp.calendar import list_events, create_event
from __dsh__.tools.mcp import calendar # or the server itself
The deep form is why each server gets a sys.modules entry of its own: __getattr__ can serve from __dsh__.tools.mcp import calendar, but not from __dsh__.tools.mcp.calendar import list_events — the import machinery looks that one up as a module. No meta path finder is needed; registration is enough.
mcp and its server modules are live views of the catalogue, not snapshots of the cell they were imported in: a restriction or a reconnecting server moves tools in and out between calls, and unlike a single tool the model has no reason to ever import the namespace twice. (A name pulled OUT with from ... import is a snapshot, as it is for any Python import.) The name is reserved — a native tool called mcp is not bound, nor is one called ToolCallError, nor any whose name starts with _. The prompt block mirrors all three, because a block that imports a name the kernel never binds is an ImportError on the first line the model copies.
dsh's MCP client is explicitly aware of this route — its canonical value "retains the complete JSON MCP blocks and optional structured content for programmatic and Code Mode callers" — and the sub-call logs a SUBTOOL row like any other.
Worth contrasting: Anthropic's server-side programmatic tool calling is not compatible with MCP tools. Owning the bridge host-side is what buys this.
A raw MCP name is a routine place to find a hyphen — dsh normalises over [A-Za-z0-9_-], so - survives, and - is legal in no Python identifier. Such a tool is bound under BOTH spellings: its own, and the -→_ fold that the listings show and the block spells. mcp.notion.API_patch_block_children(...) dispatches to mcp__notion__API-patch-block-children, and an existing getattr(mcp.notion, "API-patch-block-children") keeps working. The fold never displaces a real tool: a server exposing both a-b and a_b keeps a_b meaning a_b, and both stay listed.
Measured before adding it: on a 20-task benchmark run, 676 of 17030 dispatches (4.0%) went to twelve hyphenated tools, all from one server, and API-patch-block-children was the single most-dispatched tool of the whole catalogue — each call site paying for a getattr, with no signature in the block to go with it, because an unspellable name was excluded from the listing entirely. Across the 208 distinct tool names those runs dispatched, no fold collided with another fold or shadowed an existing name.
(Folding fixes only what a substitution can reach. A keyword (class) or a digit-leading name (123tool) is unspellable for reasons no rewrite fixes, and those keep the getattr route — getattr(__dsh__.tools, "class") — which the block still points at when there is one.)
mode: code (the default) makes python the only directly callable tool:
system-prompt/assemble waterfall listener filters assembly.tools down to python, so the other schemas never enter the request;ctx.tools.guard() denies a model-direct call to anything else and names the route back (from __dsh__.tools import <name>) — presentation alone is not enforcement, and a bare rejection reads as a broken deployment. Sub-dispatches carry a parent token and are exempt.ctx.tools.restrict() cannot do the first job: it masks global tools only, and in a preset composition the tools are scope-local — "scoped registrations remain visible". The assemble waterfall is the layer that owns the model-facing list.
The rule ships as its own prompt section at order 99, ahead of the 100–199 tool-guidance band, for the reason Code Mode orders its own code-only rule there: the model should read which tools it may call before it reads what each one is for. (Measured: moving it out of the band took it from character 4129 to 170.)
Set mode: both to keep the native schemas alongside — useful while debugging a composition, not the CodeAct shape.
CodeAct cardThe browser half registers tool.call.toolview under key: 'python', giving the call its own card:
CodeAct · count the markdown files at the root
┌ python copy ┐
│ from __dsh__.tools import glob │
│ print(len(await glob(pattern="*.md"))) │
└───────────────────────────────────────────────┘
Glob · *.md ← native SUBTOOL row, untouched
The code body is the shipped CodeBlock primitive with lang: "python", so the highlighting, the language label, and the copy button are dsh's own.
A client half is required, because nothing host-side can affect this row. toolRowModel ignores the presentCall view entirely and derives everything from the tool NAME plus raw args:
title = TOOL_TITLES[toolName] ?? VARIANT_TITLES[classifyTool(toolName)] // unknown → "Tool call"
summary = variant === 'others' ? `${toolName} · ${base}` : base
body = deriveBody(variant, argsRaw) // unknown → raw args JSON
and classifyTool reads a hardcoded map in which run_code: 'code' is the only entry that reaches the syntax-highlighted branch (with lang: "typescript" also hardcoded). run_code is a reserved name a plugin may not take. Upstream fix proposed in discussion #4724: let the call view carry kind: 'execute' plus a language.
SUBTOOL nesting survives by construction. ToolCallBranch renders block.subCalls as siblings of the slot occupant:
children: [renderSlot('tool.call.toolview', owner, { entryKey: toolName, fallback }), children]
so a registered toolview replaces the card body only. The slot contract says the same: "registering is additive for your own tool".
The card is hand-written in the client module system's factory form (a classic script registering a CJS factory) rather than bundled — this package has no build step, and the card needs only React plus one shipped primitive.
The key is the literal name python; a custom toolName falls back to the generic row.
Python subcalls dispatch immediately by default, so independent calls submitted with asyncio.gather() can overlap and return as they finish.
Enable Follow tool concurrency policy in DSH Web's Plugins → dsh-py-codeact settings to follow official PTC scheduling. On DSH 0.2.2+, only tools whose isConcurrencySafe returns true can overlap, up to 10 per cell; omitted declarations are exclusive. Pre-execute and post-execute policy stays ordered, and results commit in submission order. Earlier hosts expose only whole-invocation execution, so this option serializes all Python subcalls. Queue time is excluded from each call's execution timeout.
This option is off by default and applies from the next cell without resetting the Python namespace. Set respectToolConcurrency: true or false on the preset's plugin row to override the profile preference.
Each bridged call appends the same two session events Code Mode uses:
session.append('tool/code-dispatch-start', { rootCallId, parentCallId, subCallId, name, arguments })
session.append('tool/code-dispatch', { ...same, isError, content })
They pair by subCallId (<parent>:py:<n>), and the settle event carries tool/result's own vocabulary (content + isError). The client uses the native tool tree to render them as SUBTOOL rows under the python call.
Both events have to land inside one open turn: the v3/v4 read path rejects a tool/ptc-dispatch found outside one and refuses to load the session at all. So nothing is left in flight when a cell ends. The cell owns an AbortController — the signal every sub-call of it runs under — and execute aborts that and then waits for whatever is still outstanding before it releases the shell's slot. A call parked on an approval is answered cancelled rather than performed hours later inside no turn, and its settle is still logged, in the same turn as its -start. Code Mode's run_code holds its run open the same way, which is what makes this contract hold there too.
Both types are in KNOWN_SESSION_EVENT_TYPES, so reusing them is supported. Note that an out-of-repo plugin cannot invent a new event type: the persistence read path refuses a log containing a type outside that set unless the event is marked ignorable, and a registration surface for downstream events is explicitly deferred upstream.
Sub-dispatches carry the outer execution's parent token, so they re-enter the complete pre-execute → guards → execute → post-execute → result pipeline. The sandbox and approval stack still gate every tool call made from inside a cell. Settled sub-calls also use the public tools/ptc-dispatch-log waterfall and preserve result metadata and structured errors.
%whos to recall what it has bound, %timeit, %run script.py, %%writefile, obj? / obj??, %cd. Cheap self-orientation in a session it has partly forgotten.store_history=True, so _, __, _i3, Out[n] all work.import rebinds a name to the object it already held, the result carries `json` is already imported in this session — no need to re-import it. A model driving a persistent REPL re-imports constantly; telling it is cheaper than letting it burn a line every cell. (Implemented with a dict subclass that watches top-level STORE_NAME and checks the preceding opcode was IMPORT_NAME/IMPORT_FROM, so x = x does not trip it.)objprint + IPython's pretty for objects whose own __repr__ is object.__repr__ — an agent reading values needs structure, not <Foo object at 0x…>.<stdout>, <stderr>, <return>, <traceback>, <note> — with four things possibly present at once, the model needs to know which is which. A plain successful value stays bare.read? for one tool's full description, dir(__dsh__.tools) for the list — mcp rather than the hundred flat names under it, matching what the block printed — then dir(mcp) and dir(mcp.<server>) for those, and %whos for its own bindings. __all__ is left alone: it is what import * binds, not what the model is shown — so it carries every flat name the listings drop, and ToolCallError, which no listing shows because it is not a tool but which except ToolCallError needs after an import *. What it introspects matches what the block showed it: the listing carries mcp rather than the hundred flat names under it, and an optional parameter renders = ... there as it does here — inspect.signature uses repr, and repr(...) is Ellipsis, which is what read? used to say.In DSH Web's Plugins page, open dsh-py-codeact and enable Streaming execution to execute stable Python statements while the model generates its tool arguments. Both modes use the same CodeAct preset and python tool. The switch applies from the next model step without restarting the Python namespace; an active cell keeps its execution mode. Streaming requires DSH 0.2.2 or later, mode: code, and session persistence. It is off by default.
Leave streaming unset on the preset's plugin row to follow this profile preference. An explicit true or false overrides it for that preset:
- name: dsh-py-codeact
config:
streaming: true
The live preference belongs to the profile's py-codeact-settings entry, installed by the bundle patch. The execution row retains ordinary configuration lifecycle rules; editing its explicit override can remount the plugin and discard interpreter state.
The plugin reads the same agent/assistant-stream events as the WebUI. partial-python executes each stable statement once in the existing namespace; the final tool invocation joins that execution. Streaming execution uses the host's public plugin APIs. Source admission passes through the normal tool policy pipeline and is persisted before execution; bridged tools retain the step's tool set, sandbox policy, and approval checks. Streaming admission authorizes code that is still arriving, so retain whole-cell mode when approval must inspect the complete program.
Streaming and whole-cell execution share the CodeAct · description card and native child tools. The browser client projects children that arrive before the final parent call into Chat and Trajectory, including restored history. It uses official DSH extension points; no host fork or session migration is required, and opening history never replays code.
On DSH 0.2.2-rc.1, keep the client extension enabled when opening streaming history; the host's built-in projection cannot handle children recorded before their parent call.
Early admission uses the internal <toolName>_stream capability (python_stream by default). Tool-name policies, including output policies, must cover this capability as well as the final python call. Recovery records store the accepted python_stream result; a later policy on python cannot retroactively change that record or undo earlier effects. The records live in the session log outside conversation messages, so a restart can report effects even when no complete assistant tool call was committed.
Streaming uses raw Python with top-level await. Use print(...) for output and help(...) for introspection; IPython magics, shell escapes, history updates, and automatic final-expression echo are unavailable. Stable statements inside if, with, and async with may run before the block closes. Loops, try, function definitions, and other unsupported compound kinds wait for their complete statement. Open contexts span source generation: time spent waiting for tokens counts toward asyncio.timeout(), and locks or transactions may stay open longer.
Truncation, malformed arguments, disconnects, and cancellation abort pending source and unwind open contexts before the step settles. Earlier effects remain; the plugin never reruns the source to recover or automatically retries a model attempt after execution starts. CPU-bound code still uses the kernel's interrupt escalation. A restored admission with no conclusive result is reported to the model as an unknown outcome, not as proof that nothing ran; interpreter memory is not restored.
One streamed Python call is supported per response. Other direct tools remain unavailable in exclusive CodeAct mode. The generated tool description and SDK instructions explain these rules to the model. A configured python or command interpreter must supply partial-python~=0.1.0 as well as IPython and objprint; the default uv setup installs them from the worker's PEP 723 metadata.
An aborted turn sends an in-band interrupt frame, cancelling the running cell at an await point. Streaming and whole-cell execution preserve captured stdout and stderr alongside an InterruptedError message, including output produced during cleanup. Output policies still apply. Earlier effects and bindings remain; cancellation does not roll them back. If source generation stops before a complete tool call exists, the streaming recovery record preserves the output.
A pure CPU loop (while True: pass) never reaches an await point. After hardInterruptMs (default 5s) the interpreter is SIGKILLed, losing its bindings and buffered output. The next call respawns it; that observation is prefixed with [the interpreter was restarted; every earlier binding is gone] so the model does not keep referring to variables that no longer exist.
Native writes are not captured. stdout/stderr are captured at the Python level, so print is captured but a subprocess writing to fd 1 is not. Use subprocess.run(..., capture_output=True), or %run. (Anything that does reach fd 1/2 — including IPython's own colored traceback, deliberately routed there — is retained only for the crash message.)
Scope is not optional. The visible tool set comes from ctx.tools.sdkSchemas(scope) — the scope being the agent. Omitting it yields the global view, which in a preset composition holds only host-registered tools; the preset's own read/bash/edit live in the agent scope and vanish. The prompt section reads assembly.scope, and the kernel's name list is resent with every cell (restrictions and mid-conversation tool changes can move a tool in or out between calls).
Pick a toolName nothing else answers to. With an MCP IPython server also mounted, a model told to "use the python tool" reaches for mcp__py__ipython_execute_code — which has no tools binding — and then reports that your tool does not exist.
A shape Python cannot name stays vague. A field whose key is not a valid identifier degrades its own class back to dict[str, Any] rather than emitting a body that will not parse — the tool stays callable and only that one annotation goes quiet. A parameter named self is now just a parameter: every tool renders as a module-level function, so no enclosing signature has spent that name. A tool name Python refuses gets a class under one it accepts (123tool → Tool123toolOutput), rather than the class 123toolOutput that would be a SyntaxError taking the whole block with it; that tool has no async def line, but it is still bound, and 123tool? names the same class. A schema with no declared properties still renders Any; claiming a type nobody declared would be worse.
Cold start. The PEP 723 environment is resolved on first use (uv python find --script). Warm afterwards; pass python to skip it.
The interpreter is then spawned directly, never behind uv run --script. A wrapper stays in the process tree as the interpreter's parent: when it exits first, the interpreter is reparented to init, the handle the host holds reports an exit, and a perfectly live kernel looks dead — so the next cell respawns and the session's state vanishes with an [the interpreter was restarted] notice nothing actually caused. alive is likewise tracked from the exit event rather than read off proc.killed, which Node sets on any kill() call, including a signal the process survived.
Containment, not a security boundary. A separate process with a curated environment, but model code can import os. Treat a session on this preset as shell access.
One interpreter per session. Parent and child sessions have separate processes in every sandbox mode. A blocking cell, hard interrupt, or session disposal cannot stop another session's interpreter. State persists across cells and turns within the same session; its process closes when that session is disposed.
Cross-session objects are not shared. __dsh__.shared is local to one session. Pass data through tool arguments, results, or files when delegating work.
By default the kernel gets an allowlist — PATH, HOME, TMPDIR, LANG, LC_ALL, TERM — not the empty environment the worker-thread runtime uses. CPython running IPython needs a profile dir and a PATH for shell escapes; the point is excluding ambient credentials, which an allowlist does just as well. inheritEnv: true passes the whole harness environment.
Execution requires DSH 0.2.1-rc.2 or later with sandboxPolicy and subprocess services. The Python interpreter runs through the host’s managed subprocess provider, including descendant termination, and resolves the session’s sandboxPolicy and uses ctx.sandbox.confine in read-only and workspace-write modes. Only an explicit danger-full-access policy skips confinement. A missing policy/provider fails closed. Interpreter provisioning is host setup; model cells run inside the confined process. The initial cwd comes from the working-directory service when available; the immutable session cwd still defines the sandbox boundary.
Changing a session’s sandbox mode or effective working directory retires its existing kernel, so variables and open handles are lost. Pending bridged calls are cancelled and drained before a replacement starts. Other sessions keep their interpreters.
COLUMNS/LINES are pinned inside the kernel: with no TTY, get_terminal_size() falls back to 80×24 and wraps tracebacks and pretty output far narrower than the harness renders at.
dsh plugin --profile <name> add dsh-py-codeact
On DSH 0.2.2 and other hosts with the split tool-executor API, the Python SDK renderer is required. Install it alongside the plugin, using the exact version of your DSH host (for example, 0.2.2-rc.1):
dsh plugin --profile <name> add dsh-py-codeact @deepseek-ai/dsh-tool-executor-ptc@<dsh-version>
The renderer peer is optional in package metadata only to preserve legacy hosts, which export the renderer from dsh-tools and cannot satisfy the new executor's host peers. Split-API hosts must provide it; a missing renderer produces an explicit installation error. Other import failures retain their original diagnostic.
On DSH 0.2.2, add the row from example/agent.cordis.yml to an owned @deepseek-ai/dsh-agent-preset declaration's config.plugins through a profile bundle patch. Inspect the existing composition first and retain its realms, tools, sandbox, and approval providers. The registry accepts declarative plugin rows; it does not scan preset directories or provide copy().
Headless is preset-free. Insert the row directly into its profile overlay and disable the existing tool-executor-native row; each scope allows one executor. Keep the normal headless services. Streaming additionally needs sessions, sessionProjections, and llm; the plugin follows those services' lifecycle and waits for persistence before executing source.
The kernel provisions its own Python from the PEP 723 header in py/kernel.py, so uv is the only prerequisite beyond dsh itself; the first cell pays for that resolve and later ones are warm.
For the card, also list the package in the profile's dsh.profile.bundles (~/.dsh/profiles/<name>/package.json). The browser bundle is served only for packages named by an enabled Loader entry. This package's cordis.patch.yml inserts a profile-level row with uiOnly: true to load the card without registering an executor globally. Keep execution in the selected preset's composition; only preset-free hosts such as headless should mount the executor at profile level.
Against Macaron V1 Venti on a real dsh session. Given a plain task — "read this CSV and tell me which region earned most", with no mention of Python or the module — the model imported from __dsh__.tools, ran the cell, and answered with a table. The request carried exactly one tool schema (python); all 33 others were reachable only from inside the cell, and the bridged read appears as a SUBTOOL row under the python call in the trajectory tab. A headless run completes and exits in ~11s.
Streaming was verified with a live provider on DSH 0.2.2-rc.1 headless: bridged effects occurred before provider completion, each ran once, a second call reused the namespace, and the persisted session restored its recovery notice. The same task in whole-cell mode produced effects only after generation finished.
bun run test covers the installed host, including its registry API. CI tests the pinned development host and the exact 0.2.1-rc.2, 0.2.2-rc.1, and 0.2.2-rc.2 host sets on Ubuntu, macOS, and Windows. Each 0.2.2 host also runs streaming and browser tests on all three platforms. bun run test:streaming requires the matching DSH 0.2.2 host set and exercises real AgentLoop lifecycle events, tool policies, persistence, and a Python worker with controlled model streams.
bun run test:web installs official DSH and a packed plugin in a temporary directory, then tests streaming, whole-cell execution, Stop, Inspect, approvals, and cold history restoration in Chromium. It requires Bun, pnpm, and uv; all test servers use automatically assigned ports.
node test/smoke.js
Drives the kernel and wire protocol directly, with no harness: state persistence, store_history, magics, redundant-import hints, top-level await, the tool bridge, ToolCallError, asyncio.gather, traceback recovery (and that ANSI never leaks into the captured stderr), in-band interrupt, and the SIGKILL escalation.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: 无有效分类标签。