`dsh` shipped two config trees that were 43 rows the same: apps/cli/cordis.yml composed web as 74 flat rows, while the TUI booted examples/tui-agent/cordis.yml whose single `@deepseek-ai/dsh-tui-demo` row mounted twelve plugins behind a twenty-key pass-through Config. Neither file was what its location claimed — apps/cli hardcoded the "example" as the product default and the "demo" bundle was the application — and every capability change had to be made twice. - apps/cli/base.cordis.yml holds the 43 shared rows; tui.cordis.yml and web.cordis.yml are patch lists stating only what differs per surface - overlays apply as SIBLING patch lists at one include level, because include patches never cross an include boundary. Precedence: base < surface < (--config | personal ~/.dsh/config.yaml) < launcher flag/profile patches - `--config` now applies an overlay INSTEAD OF the personal one, so a demo or test tree never inherits the user's route; new `--config-replace` boots a file as the entire tree (the old `--config` behaviour). Both survive /resume - vendor/include: index each `insert`ed row as it is added so a later patch can configure or disable it. Upstream built the id index once before the patch loop, leaving every surface-only row — the whole TUI front door — silently unpatchable from user config. Logged as local modification 8 - session identity moves to dsh-agent-loop's CONFIGURED_AGENT_IDENTITIES_KEY; dsh-tui's MAIN_SESSION_ID_KEY is deleted (only the bundle read it) - delete examples/tui-agent, examples/cordis-agent, packages/examples/tui-demo; TUI tests → apps/cli/tests, cordis e2e → packages/cordis/tool-cordis/tests, examples/code-mode survives as an overlay leaf - `dsh web` gains --config, threaded into AppCLIEntry as an extra overlay Three latent defects surfaced and are fixed here: the TUI captured the optional sessionQuery service once at construction and could permanently disable /resume when it won the mount race; the session-store root silently reverted to a project-local ./.sessions; --config-replace was dropped by the resume handoff. Verified by booting each tree through the real Loader (TUI 55 entries, web 75, zero unsettled) rather than reading YAML. All eight terminal snapshots replay byte-identically; 14/14 PTY smoke, 112/112 snapshots, 25/25 doc-sync, hygiene and lint clean.
9.2 KiB
Vendored Packages
This directory contains source-vendored copies of the Cordis framework and its foundation libraries. They are copied into this monorepo instead of being depended on via npm, so that the harness fully owns its framework layer (auditable, patchable, pinned).
All vendored packages keep their original npm names (they are resolved through pnpm workspaces) and are marked private: true — they are never published from this repo. Upstream MIT LICENSE files are preserved in each package directory.
This file covers the manifest, the local-modification log, and the procedure for updating an existing vendored package. To add a new one, see the cookbook guide: docs/cookbook/adding-a-vendored-package.md.
Manifest
Upstream workspace: cordis-workspace (local checkout: ~/repos/cordis-workspace).
| Directory | npm name | Version | Upstream repo | Commit |
|---|---|---|---|---|
cosmokit/ |
cosmokit |
1.8.1 | https://github.com/deepseek-harness/cosmokit | 16f6fc058ade66e8ac5da0033d35a8d0f279f544 |
schemastery/ |
schemastery |
3.18.0 | https://github.com/deepseek-harness/schemastery (packages/core) |
e67cee00ad725bd1534aee930a979ea3eec6f698 |
cordis/ |
cordis |
4.0.0-rc.7 | https://github.com/cordiverse/cordis (packages/core) |
56b3d4f725681cf4556c1a8695a709cc3b6eed74 |
loader/ |
@cordisjs/plugin-loader |
1.0.0-rc.5 | https://github.com/cordiverse/cordis (packages/loader) |
56b3d4f725681cf4556c1a8695a709cc3b6eed74 |
include/ |
@cordisjs/plugin-include |
1.0.4 | https://github.com/deepseek-harness/cordis (packages/include) |
abb0a307cb1d3b0947f455d590cf5ba922d4caa4 |
group/ |
@cordisjs/plugin-group |
1.0.0 | https://github.com/deepseek-harness/cordis (packages/group) |
abb0a307cb1d3b0947f455d590cf5ba922d4caa4 |
timer/ |
@cordisjs/plugin-timer |
1.1.2 | https://github.com/deepseek-harness/cordis (packages/timer) |
abb0a307cb1d3b0947f455d590cf5ba922d4caa4 |
hmr/ |
@cordisjs/plugin-hmr |
1.0.15 | https://github.com/deepseek-harness/cordis (packages/hmr) |
abb0a307cb1d3b0947f455d590cf5ba922d4caa4 |
logger-console/ |
@cordisjs/plugin-logger-console |
1.0.0 | https://github.com/deepseek-harness/cordis (packages/logger-console) |
abb0a307cb1d3b0947f455d590cf5ba922d4caa4 |
Third-party dependencies of the vendored packages stay on npm: @standard-schema/spec, js-yaml, chokidar, picomatch, @babel/code-frame, supports-color, node-addon-require-builtin.
Intentionally not vendored (verified unused by this set): reggol, @cordisjs/utils, @cordisjs/element, @cordisjs/unyaml (dev-time YAML import hook only).
Local modifications
Keep this log exhaustive — every divergence from upstream must be listed.
hmr/src/index.ts: removed the./locales/en-US.yml/./locales/zh-CN.ymlimports, the.i18n({...})call on theConfigschema, and thesrc/locales/directory. Rationale: those imports require a runtime YAML loader hook (@cordisjs/unyaml) that we do not vendor; the i18n texts only localize config descriptions.- All
package.jsonfiles: regenerated — addedprivate: true, added precisefilesentries for bundled runtime files andlib/types/**/*.d.ts/.d.ts.map, preservedsrcinfilesonly for packages whose previous file list already shipped it, added a./src/*export where missing, pointed declaration metadata atlib/types, and removed upstreamdevDependencies/scripts/repositoryfields. Dependency and peer-dependency ranges preserved, excepthmrdeclaresesbuildas a direct dev dependency because its source imports theBuildFailuretype and pnpm's strict workspace resolution requires the owner package to name that dependency. - All
tsconfig.jsonfiles: regenerated to extend the repo-roottsconfig.base.json, emit TypeScript intermediates tolib/types, and declare project references. - Vendored TypeScript source internal specifiers: changed local relative imports/exports from upstream's specifier shape to explicit
.tsspecifiers so TypeScript rewrites emitted JS to.jswhile declarations keep explicit, NodeNext-safe.tsspecifiers. This includesloader/src/config/isolate.tsusingdeclare module './entry.ts'. schemastery/tsdown.config.tsandlogger-console/tsdown.config.ts: ours, not upstream files — per-package build-shape overrides (dual ESM+CJS output; separate node/browser entries) for the repo-root tsdown build. They read the JS emitted underlib/typesand then write the publish runtime entries underlib/. Like the regenerated tsconfigs, they are not part of the upstream sync surface.cordis/src/fiber.tslifecycle hardening: locally closes three reentrant disposal gaps. An effect's owner-list wrapper is registered before its setup body runs, so an unload begun from inside setup awaits setup and every collected cleanup; synchronous setup failure removes the wrapper and rolls back collected cleanup. Async cleanup stays owner-visible until quiescence, and Cordis's internal effect composition joins an already-running cleanup while repeated public disposer calls retain their upstream single-shot result. Effect creation is rejected while the owner isUNLOADING(whilePENDINGandLOADINGremain legal), preventing cleanup-time registrations from escaping the unload snapshot. Child fibers register and receive their parent-owned disposer beforeinternal/pluginpublication, resolve dependency declarations added by that notification before activation, drain effects attached while pending, skip plugin execution when reentrant disposal invalidates the load epoch before its first checkpoint, and contain teardown-notification failures per observer so one callback cannot starve peers or interrupt ownership cleanup.cordis/src/*.tsJSDoc enrichment: added@param/@returnstags and contract documentation (disposal semantics, waterfall veto, bail conditions, error cases) across the public plugin-author surface —Context(class, statics, and theContextinterface properties incl.root),EventsService,Fiber,RegistryService,ReflectService,Service,LoggerServiceand theirdeclare module './context.ts'overloads. Comment-only; no code changes. Motivation: the website API-reference generator renders these docs and hard-errors on undocumented members. Retire this entry when the enrichment is upstreamed to the fork.include/src/index.tshot-reload hardening:refresh()awaits the full read-and-update and catches failures (logging a warning and keeping the last good entry tree) instead of rethrowing — upstream's throw escaped@cordisjs/plugin-hmr's async watcher callback as an unhandled rejection, so one badcordis.ymledit killed a live app.read()rejects a non-array parse result (an empty or mid-write truncated file parses toundefined, which upstream later crashed on) and commitscontent/dataonly on success, so reverting an edit to the exact last good content reads as "unchanged".refresh()and theinternal/updatelistener re-applyconfig.patchesbeforeroot.update(), matching initial load; upstream applied patches only in[Service.init], so any config hot-reload silently reverted overlay-patched entries and removed inserted ones.applyPatchesdeep-copies viastructuredCloneinstead of mutating the cached parse (repeated application converges; removing a patch reverts), and the veto-styleinternal/updatelistener persists the incoming config itself (Fiber.updateonly assigns behindnext()), so later re-reads use the new patches.[Service.init]falls back toinitialonly onENOENT; an existing-but-invalid file fails loud with its real parse error instead of "config file not found" (or a silent overwrite).applyPatchesalso indexes eachinserted entry as it is added, so a later patch in the same list can configure or disable a row an earlier patch inserted; upstream built the id index once before the patch loop, leaving inserted rows silently unpatchable. That matters becausedshcomposes one shared base (apps/cli/base.cordis.yml) with a surface overlay, an optional--configoverlay, and the personal~/.dsh/config.yamlas sibling patch lists at one include level — patches never cross an include boundary, so surface-only rows would otherwise be unreachable from user config. Covered bypackages/ui/app-boot/tests/config-reload.spec.ts.- Vendored Node-compatible TypeScript: marked erased imports explicitly across
cordis,loader,include,hmr, andschemasteryso Node's native TypeScript transform does not request types as runtime exports. Schemastery's source uses an ESM default export and its package declarestype: module; its built ESM/CJS entries retain explicit.mjs/.cjsextensions.
Sync procedure
To update a vendored package from upstream:
- In the upstream workspace, note
git rev-parse HEADof the relevant submodule. - Copy the package's
src/(andbin.js,README.md,LICENSEif changed) over the vendored directory. - Re-apply the local modifications listed above (or drop them if upstream made them unnecessary — update the log either way).
- Update the version and commit hash in the manifest table.
- Run
pnpm install && pnpm run test && pnpm run buildat the repo root.