diff --git a/cordis.patch.yml b/cordis.patch.yml new file mode 100644 index 0000000..6cd78d8 --- /dev/null +++ b/cordis.patch.yml @@ -0,0 +1,29 @@ +# Ship-ready overlay that swaps the harness loop for `dsh-memory/loop`. +# +# This is the ONLY artefact that proves the replacement loop is mounted: without +# it `lib/loop.js` is a subclass nobody instantiates (its unit tests exercise the +# pure `promoteSnapshotSections` function and nothing else). +# +# Apply it to a profile (a `--patch` overlay, or copied into the profile's own +# `cordis.patch.yml`); `dsh` composes it over `@deepseek-ai/dsh-base`, where the +# `agent-loop` row already exists: +# +# dsh --profile headless --patch "" +# +# ★ The disable is not optional, and it is by ID, not by name. `AgentLoop`'s +# constructor ends with `ctx.effect(() => ctx.agents.setFactory(this))` +# (dsh-agent-loop/lib/index.js:1590), and `dsh-agent`'s `setFactory` throws when a +# factory is already registered (dsh-agent/lib/index.js:429-437). Leaving the base +# row enabled makes startup fail with "an agent factory is already registered"; +# `HologramAgentLoop` inherits that constructor, so it registers exactly once — +# but only if the base row is gone. +- id: agent-loop + disabled: true + +# The replacement. No `config` block on purpose: `HologramAgentLoop` defines no +# `static Config`, so it inherits the parent schema (`maxParallelToolCalls`, +# `agents`) and the profile's own `agent-loop` config rows keep working through +# the inherited constructor. +- insert: + - id: hologram-agent-loop + name: dsh-memory/loop diff --git a/package.json b/package.json index 89d2541..47659da 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,12 @@ "type": "module", "main": "lib/index.js", "exports": { - ".": "./lib/index.js" + ".": "./lib/index.js", + "./loop": "./lib/loop.js" }, "files": [ "lib/*.js", + "lib/loop.js", "lib/types/*.d.ts" ], "engines": {