- Startseite
- Plugins
- Sitzungen & Nachrichten
- dsh-maestro
dsh-maestro
paroca72/dsh-maestro
Per-session extra working directories and a relay between the sessions of one workspace: the person grants directories and designates the hub, the model hands a task to a sibling session and its answer comes back, and the hub relays only on a plan the person approves in the relay panel. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Installation
dsh plugin --profile web add github:paroca72/dsh-maestroREADME
Maestro — session working directories and cross-session relay
A DeepSeek Harness bundle with two capabilities: extra working directories for one session, and a relay that lets the sessions of one workspace hand work to each other.
A session starts in the directory its workspace gave it: its immutable
Session.header.cwd stays the project root, and this plugin widens only the
writable set around it. It lets the person add further directories to that
session:
- the Host half registers each one with
ctx.sandboxPolicy.registerWritableRoot, so under Workspace write the Harness file tools may write there; - a dynamic prompt context tells the model which directories the session may write in, and is absent while the list is empty;
- the Client half renders the control and the panel.
Install
From GitHub — JavaScript only, no build step and no build scripts:
dsh plugin --profile <profile> add github:Paroca72/dsh-maestro
The package name is dsh-maestro: that is what a profile lists under
dsh.profile.bundles, and what a market index that reads the
awesome-dsh-plugin
catalog installs. After installing, reload the page; a bundle the profile has just
added may need the app restarted once.
The plugin declares engines.dsh (>=0.2.2-rc.1 <0.3.0-0), which the market reads
to tell you whether it fits the host you are running.
Use
- Open a session whose permission mode is Workspace write.
- Press the Directories control in the composer tool row.
- Choose Add directory…: the host's system chooser opens. It takes no start directory, but it reaches every drive, and the directory you pick is added at once. When the host offers no chooser, or the chooser itself fails, the panel falls back to a field for an absolute path instead of leaving you with nothing to do.
- Remove a directory with Remove; the model notice disappears with the last entry.
- Work here makes one listed directory the session's working directory, so relative paths resolve there from then on; that row is then marked working directory. Permissions do not change: the write boundary stays the session's original project.
A relative path always resolves against the working directory, never against
an additional directory: to read a file inside one of them, use its absolute path.
The model is told both facts, and must say which directory it read and ask which
was meant when one name (for example docs) exists in more than one of them.
A session that is not running yet can still be configured: the list is applied when the session starts. A forked session inherits the list it was forked from; a subagent does not inherit it, because widening a child's write boundary is the host's decision, not a side effect of delegation.
Relay between sessions
A workspace can hold several sessions that are parts of one project (a bot, its API, a web app). This plugin lets the model in one of them hand a task to another and get the answer back, without the person leaving the session they are working in. The Host half gives every session of a workspace six tools:
| Tool | What it does |
|---|---|
workspace_peers | Lists the other sessions of the workspace by title and whether they are open. Reads only. |
tell_session | Hands a task to a sibling by name, wakes it, and returns at once. Its closing message arrives later as a new message. One call per sibling in the same step delivers them in parallel. |
ask_session | The same delivery, waiting for the answer within a timeout; on expiry it degrades to a pending answer instead of failing. |
ask_sessions | Fans out in one call: several siblings, each with its own task, delivered in parallel, and one result carrying every answer. A session still working when the timeout expires is reported as pending and answers later as a message. |
peer_changes | Reads the changed files recorded for another session's last completed turns, without waking it. |
relay_decision | Records a decision the work needs: a light one the hub takes itself — shown to the person at the end — or a structural one, which the person is asked about before anything depends on it. |
relay_plan | Files the plan the workspace will follow — the person's request quoted, then one step per session to ask, and the person is asked to approve it with a review card in the conversation — reads the one in force, records an authorization given in words, or closes a plan. Until they authorize it, nothing the hub sends is delivered. |
- A relay is delivered to a session that is not open by starting it first: the
Harness session controller resolves or resumes the target, and the answer reports
woken: true. A target that the controller refuses is named in the error, and a subagent session is never addressable. peer_changesnever starts anything: it reads only a session that is already open, and says so instead of loading it.- The message carries the Harness's own
agent-message/relayattribution, so the recipient's chat shows which session asked, not the person's own words. - The answer is the recipient's closing text of the turn that read the request — identified by the id of the delivered message, which the Harness queue preserves — delivered back as another relay: the recipient needs no extra tool to answer. A request that waits in the target's inbox while it is busy is therefore answered by the turn that picks it up, not by the one that happened to be running.
- Every session is also told the catalogue in its prompt context, and told to ask the person when a name is unknown or ambiguous.
- One session of the workspace acts as the hub: it is told to coordinate the others, and they are told to go through it. The person can pin the hub in the panel; with nothing pinned, the hub is the first session created in the workspace, so the relay coordinates itself with no configuration.
- A forked session is a sibling like any other; a subagent session is never addressable.
- Work is routed through the hub. A relay must touch the hub at one end: the hub
addresses any session, a session addresses the hub, and a relay between two sessions
that are neither is refused, with a hint telling the model to ask the hub to pass
the request on. The switch is per workspace, in the relay panel ("Route every relay
through the hub"), and it is closed by default — that default is the row config's
relayHubOnly— because a model left to itself creates peer-to-peer traffic the person never asked for. Clearing the switch in the panel returns the workspace to the deployment default. The answer leg is not a delivery, so replies keep flowing both ways, and a refusal is recorded in the ledger asrefused: a bypass attempt shows up in the panel and interrupts nobody's chat. - Light decisions are taken, structural ones are asked.
relay_decisionrecords a decision the work needs. A light one — a switch, a default, a flag that can be flipped later without changing the shape of the project — the hub takes itself with the recommended option and records: nobody is interrupted, and every one of them is shown to the person when the plan is closed, or onrelay_decisionactionreview, where they confirm them or say what to change. A structural one — which database, which protocol, a new dependency, a public interface — is asked of the person straight away, with the recommendation and the alternatives, and their answer is what gets recorded. The relay panel lists them all, and one the person has not seen yet is marked. - The cards the plugin writes speak the person's language. Everything a review card carries
from the hub — the quoted request, the steps, the questions — is passed through untouched;
the frame around it is the plugin's own, and it follows the conversation.
relay_planandrelay_decisiontake an optionallanguagetag (ISO 639-1), and with none the plugin reads the language from the request the plan quotes.enanditship; anything else falls back to English instead of guessing. - The relay window is four sections, not one scroll. Plan is the card you decide on — the state, the budget, the request folded to three lines, and one row per step that opens when you want to read what it asks — followed by the decisions taken without asking, folded while there is nothing to review. Sessions holds the hub choice, Relays the ledger, Settings the two switches (and Save is what writes them). A dot marks the section that wants you.
- Independent work runs in parallel. Every relay tool is declared safe to run
beside a sibling call, so when one session addresses several siblings in the same
step the driver dispatches those calls together instead of one relay per step.
ask_sessionsis the one-call form of the same fan-out. Which shape to use is the caller's choice: gather every answer before writing one report (ask_sessions, orask_sessiononce per sibling), or report each answer as it arrives (tell_session, once per sibling). - Work needs a plan the person approved. The hub files it with
relay_plan, quoted from the person's own request, with one step per session it means to ask, and asks them in the conversation. The person authorizes it either way: by telling the hub to go ahead — the hub records that withrelay_planactionapprove, and the plugin accepts it only when a message from the person really arrived after the plan was filed, which a relay never can — or by clicking Approve in the relay panel, which also refuses and closes. Filing a plan asks the person through the platform's own review card — the same surfaceask_user_questionuses — with Approve and Refuse in the conversation, and the hub's turn waits on the answer: approving starts the work in that same turn, a reply in the person's own words reaches the hub as their answer, and a dismissed card leaves the plan filed and nothing running. Until then every relay the hub sends is refused, and the refusal says so instead of interrupting anyone. Once approved, each relay names the step it serves (step: <n>), a step is worth two relays, and the plan as many as its steps allow; a relay outside the plan, or a step already spent, is refused and recorded. The budget is shared with the members' own relays, so a spent plan stops the whole workspace and the coordinator has to come back to the person. The approval is not revoked by the next thing the person says — the plan is bounded by its own steps, the person can close it, and a hub whose work has changed files a new plan, which needs a fresh authorization. The switch is per workspace, in the panel ("The team leader must have your approval before it asks anything"), on by default, andrelayPlanGate: falsein the row config turns it off for a deployment. The model's tool can file a plan, read it, record an authorization the person gave it in words, and close one; it can never refuse a plan on the person's behalf — that stays on the panel route. - A sibling takes no initiative of its own, unless the person says so. The Settings
tab carries the level, per workspace: Only what the hub asks (the default), They ask the
hub, and decide the small things, They decide for themselves. At the first, a session
that is not the hub may not start a relay (
obey-hub), file a plan or record a decision (obey-hub-plan): its closing message is the answer, and the relay already delivers that to the hub, so a doubt, a blocker or a choice still arrives — it just does not become work of the sibling's own. The level is also what the session's prompt says, which is where a model decides what to do before it does it; the tools enforce the two ends of it, andrelayObediencesets the deployment default.
Limits of the relay
- Delivery is text only: no attachments or images travel with a relay.
- A chain is bounded by hops (default 3) and by relays in flight per workspace (default 4), and it may not revisit a session it already crossed.
- A relay grants nothing: the recipient keeps its own permissions and sandbox.
- Starting a target that was not open spends a turn in that session: that is the delegation the sender asked for, not a side effect. The read-only tools never do it.
- Relays never cross workspaces.
- The routing rule governs the relay only. Two sessions of one project can still exchange information through a shared file or a shell, and no plugin sits on that path.
- A fan-out is bounded: one
ask_sessionscall addresses at most 8 sessions, and every request in it takes its own in-flight slot, so a fan-out wider thanrelayMaxInFlight(default 4) needs that limit raised from the panel first. The slot is taken when the relay is recorded, before the target is handed the message, so two deliveries dispatched in the same step cannot overrun the limit. - After a restart, a relay whose turn already closed is answered from the durable
log; one whose session is gone is recorded as
expired.
Limits
- An extra root only matters under Workspace write. Under Read only it grants nothing, and under Full access everything is already writable, so the panel says so instead of pretending otherwise.
- On Windows, only the Harness file tools honour an extra directory. Shells and
other confined processes keep their own permissions —
registerWritableRootdoes not change process confinement there. - The plugin grants write access; reads are not confined by the sandbox in the first place.
- Grants are runtime-only in the Harness, so they are installed again on every
agent/created(startup, resume, clear, compact). Unloading the plugin removes them and leaves every saved list untouched.
Data
The durable list is one JSON file, written atomically (temporary file plus rename):
- default:
$DSH_HOME/maestro/session-directories.json - shape:
{ "version": 1, "sessions": { "<sessionId>": { "dirs": [...], "updatedAt": "..." } } }
The relay keeps a second, separate file, because a broken ledger must not make the directory list unreadable:
- default:
$DSH_HOME/maestro/workspace-relay.json - shape:
{ "version": 1, "workspaces": { "<workspaceId>": { "hub": null, "settings": {}, "relays": [] } } } - a workspace's session names are its own session titles, so the file stores no name
layer; a
labelsmap left by an older version is ignored on read and dropped on the next write."hub": nullmeans no choice is pinned, and the workspace's first session acts as hub. - at most 200 relays per workspace are retained; older ones are dropped on write.
- a relay the routing rule refused is recorded with state
refusedand the reasonnot-through-hub: it delivered nothing and has no answer, it is there for the panel. A relay a member started at the strict level is recorded the same way, with the reasonobey-hub.
A file that is not valid JSON, carries another version, or has a structurally
wrong sessions value makes the list read-only and reports the reason in the
panel, rather than being overwritten. A single malformed session record is
dropped and logged.
Configuration
Row config, overridable in the profile's cordis.patch.yml:
| Field | Default | Meaning |
|---|---|---|
maxDirectories | 16 | Upper bound of extra directories per session (1–64). |
announceToModel | true | Whether the model is told about the session's directories. |
storePath | null | Absolute path of the JSON store. |
relayMaxHops | 3 | Relay chains may take at most this many hops (1–8). |
relayMaxInFlight | 4 | Most relays in flight per workspace (1–16). |
relayAskTimeoutMs | 120000 | Default wait of ask_session, in milliseconds (5000–600000). |
announcePeersToModel | true | Whether the model is told which sessions share this one's workspace. |
relayHubOnly | true | Deployment default for the per-workspace routing switch: with it closed, a relay between two sessions that are neither is refused. The relay panel overrides it for one workspace. |
relayPlanGate | true | Deployment default for the per-workspace planning switch: on, the hub files a plan with relay_plan and nothing is relayed until the person authorizes it — in the conversation, or from the panel. The panel overrides the switch for one workspace. |
relayObedience | strict | Deployment default for the per-workspace level of initiative: strict — a member answers and reports, and its own relays, plans and decisions are refused; balanced — it may address the hub and take the light decisions of its own work; free — it may start work of its own. The panel overrides the level for one workspace. |
relayStorePath | null | Absolute path of the relay ledger. |
- id: maestro-session-directories
name: 'dsh-maestro'
config:
maxDirectories: 8
relayMaxHops: 2
HTTP surface
The Client half talks to the Host half over one route, served by the Harness web server to the authenticated page:
-
GET /maestro/session-directories?sessionId=<id>→ the session's list, its current access mode, whether that mode makes the entries effective, andprojectRoot(the session's working directory, which the panel marks in the list and offers as Work here). -
GET /maestro/session-directories/list?path=<absolute>→ one directory level: the resolved path, its parent, and up to 200 directory entries (a symlink resolving to a directory counts), withtruncatedwhen the level holds more. An absentpathlists the home directory. The panel no longer reads this route — it hands the choice to the system chooser — so it stays as a documented listing primitive for a caller that needs a start directory, which the native chooser cannot take. -
PUT /maestro/session-directorieswith{ "sessionId": "...", "dirs": [...] }→ the complete new list. Paths must be absolute directories; they are canonicalized throughrealpath(symlinks resolved, because the enforcement layer rejects symlinked roots), de-duplicated, and bounded bymaxDirectories. -
POST /maestro/session-directories/working-directorywith{ "sessionId": "...", "path": "<absolute>" }→ makes that directory the session's working directory throughctx.workingDirectory.set; the session must be running. It changes no permission: the sandbox's write boundary stays the session's immutableSession.header.cwd. -
GET /maestro/relay/peers?sessionId=<id>→ the session's workspace, its siblings with their titles and liveness, the designated hub, the effective limits, andstoreProblemwhen the ledger is unusable. -
GET /maestro/relay/config?sessionId=<id>→ the hub that applies (the pinned one, otherwise the workspace's first session) and the limits, next to the deployment defaults. -
PUT /maestro/relay/configwith{ "sessionId": "...", "hub": "<id>|null", "settings": { ... } }→ the new configuration. An unknown key, an out-of-range limit and a hub that is not a session id are refused with400; a retired key such aslabelsis refused too. This route is the only writer of the person's configuration, and no relay can reach it.settingsis a patch of that workspace: it touches only the keys it names, so switching the routing cannot drop a limit set earlier."hubOnly": falseopens that workspace's routing,truecloses it, andnullclears the workspace's own value so the deployment default applies again."planGate"works the same way for the planning gate, and"obedience"for the level of initiative — one ofstrict,balancedorfree, ornullto use the deployment default. A level the plugin does not know is refused with400instead of being stored. -
GET /maestro/relay/plan?sessionId=<id>→ the plan in force in that workspace, with its state, the request it answers, its steps and how much of the budget each has spent, next to the workspace'splanGateand the per-step allowance. -
POST /maestro/relay/planwith{ "sessionId": "...", "action": "approve"|"reject"|"close", "planId": <n> }→ the person's decision. A decision about a plan that is no longer in force is refused with409instead of being applied to whatever replaced it, and the hub is told the outcome as a message, so it never has to poll. Like the configuration route, this is a panel route: no relay can reach it. The tool the model holds can file and read a plan, record an authorization the person gave it in the conversation, and close a plan; it can never refuse one on the person's behalf, and the panel's own decision is whatdecidedBy: "panel"records. -
GET /maestro/relay/ledger?sessionId=<id>&limit=<n>→ the workspace's recorded relays, oldest first (at most 200, default 50), each with its state, the sessions involved, the turn and the answer text — or, for a refused one, its reason.
These routes add no authentication of their own: the Harness listener binds a local interface only, so any local process can read or replace a session's list or a workspace's relay configuration. They grant nothing by themselves — a list matters only for a session running under Workspace write, and a relay configuration only decides the designated hub and the limits — but treat them as a local trust boundary.
Layout
| File | Role |
|---|---|
index.js | Host half entry: the bundle's exports, the shared row config, and the composition of both features. |
lib/shared.js | Host helpers both features use: request errors, logging, the bounded JSON body, the durable JSON file. |
lib/directories.js | Host half: the working-directory store, its three routes, the per-agent grants and the model notice. |
lib/peers.js | Host half: workspace membership, session titles, the peer catalogue and name resolution. |
lib/relay.js | Host half: the five relay tools and the batch fan-out, the routing gate, chain guards, the return leg, the peer notice and the panel routes. |
lib/relay-store.js | Host half: the durable per-workspace record (hub, limits, ledger). |
client.js | Client half: composer control plus the shell.overlay panel. |
test/ | The bundle harness: structural checks and the isolated Host tests. Not shipped. |
CHANGELOG.md | Release history. Its newest section matches package.json; npm test fails when the two drift. |
AGENTS.md | The working agreement for this repository: versioning policy, release checklist, development loop. Not shipped. |
cordis.patch.yml | The bundle's one plugin row. |
locale/en.json | Plugin Manager title and description. |
docs/DETAIL.md, docs/preview.svg | Detail page image. |
icon.svg | Bundle icon. |
Ähnliche Plugins
billion-context
ranxianglei/billion-context
dsh-web-ui (dsh-chat-recovery)
zhu1090093659/dsh-web-ui
dsh-synapse
liangmianya/dsh-synapse
EduWork (dsh-message-edit)
ecnu/eduwork