responsive.sk

Article

DeepSeek Harness ... 50 packages, one agent operating system

Article cover illustration: Architecture, dsh-series, deepseek, architecture

What is DeepSeek Harness

DeepSeek Harness (dsh) isn't another LLM API wrapper. It's an agent operating system ... an environment where agents run, and every capability is a separate package.

Look at packages/ and you'll find 50 modules. Each has its own role, its own contract, and its own provider. None is "the important one."

# Simplified view of the structure
packages/
  core/          # API spine ... session, tools, agent loop
  llm/           # LLM capability ... abstract service + provider adapters
  sandbox/       # Process confinement ... bwrap/Landlock/Seatbelt
  fs/            # Filesystem ... seam, local impl, file tools
  shell/         # Bash ... executor seam, local impl
  terminal/      # Persistent PTY ... owner-scoped sessions
  code-runtime/  # Code execution ... worker-thread provider
  skill/         # Skills ... provider registry, catalog/loader
  subagent/      # Subagents ... provider-registry, delegation tool
  workflow/      # Workflows ... worker-thread engine
  extensions/    # Self-modification ... live plugin inspection
  session/       # Durable sessions ... JSONL/SQLite backends
  credentials/   # Auth ... env-over-.env provider
  web/           # Web access ... search/fetch providers
  interaction/   # Human collaboration ... approval seams
  # ... and 35 more packages

Capability Seams ... the key pattern

Every capability in DSH has three roles:

Service Definition (contract)
    ↓
Service Provider (implementation)
    ↓
Consumer (user)

Example for filesystem:

RolePackageWhat it does
Definitionfs/seamDefines API: read, write, list, watch
Providerfs/localLocal filesystem implementation
Consumerfs/toolsModel-facing tools (read_file, write_file)

Why does this matter? Because extension plugins depend on Service Definitions, never on concrete providers. You can swap the local filesystem for S3, SFTP, or FUSE without changing a single line in the consumer package.

Traditionally: [App] → [Concrete FS] → [Disk]
DSH:           [App] → [FS Seam] → [Local FS]  ← replaceable
                         ↓
                      [S3 FS]     ← alternative provider

Vendor layer ... DeepSeek owns the framework

DeepSeek didn't just use Cordis ... they vendored the entire framework layer into their own @deepseek-ai/* scope:

PackageUpstreamWhat it does
@deepseek-ai/cordiscordiverse/cordis 4.0.0-rc.7Core plugin framework
@deepseek-ai/cosmokitdeepseek-harness forkUtility library
@deepseek-ai/schemasterydeepseek-harness forkSchema validation
@deepseek-ai/cordis-plugin-loader@cordisjs/plugin-loaderRuntime plugin loading
@deepseek-ai/cordis-plugin-hmr@cordisjs/plugin-hmrHot module replacement
@deepseek-ai/cordis-plugin-timer@cordisjs/plugin-timerDisposal-aware timers

Why? Because they publish Cordis as part of Harness, not as a dependency. Every harness package declares cordis as a peer dependency ... and when you publish the harness, you publish the framework layer too.

Core group ... the API spine

core/ is the product backbone:

Packagectx keyRole
scope,Scoped-context registration primitive
sessionctx.sessionsEvent-sourced session log
system-promptctx.systemPromptPrompt and tool-schema assembly
toolsctx.toolsScoped tool registry
agentctx.agentsAgent interface and event vocabulary
agent-default-modelctx.agentDefaultModelDefault model selection
agent-loopctx.agentLoopDefault concrete agent driver

Key insight: agent-loop is a plugin, not a hard core. You can replace it with your own implementation without breaking the rest of the system.

Other groups

LLM capability

llm/ separates the abstract service from providers. You can use DeepSeek, OpenAI, Anthropic, or a local model ... the consumer doesn't even know which provider is running.

Sandbox

sandbox/ confines processes. Three backends:

  • bwrap (Bubblewrap) ... Linux, filesystem isolation
  • Landlock ... Linux kernel sandboxing
  • Seatbelt ... macOS sandboxing

The agent doesn't have access to the entire disk. Only the workspace and temporary files.

Sessions

session/ is event-sourced ... an append-only log, not state-based. Backends: JSONL (file) or SQLite (database). Compaction shrinks the log without losing history.

Self-modification

extensions/ allows the agent to modify itself at runtime. It's not theoretical ... they have live plugin inspection and model-written plugin mount/unmount for this.

How it differs from traditional frameworks

AspectTraditional frameworkDeepSeek Harness
CoreHardNone (everything is a plugin)
Agent loopFixedReplaceable plugin
FilesystemDirect callsCapability seam
Sandboxexec()bwrap/Landlock/Seatbelt
SessionsState-basedEvent-sourced
ExtensionsPlugin managerSelf-modification

→ DeepSeek Harness and Cordis: the plugin framework for tomorrow → The fridge as a P2P server: hardware for P2P nodes → Outbox pattern ... when cache isn't enough: async distribution

Sources

Comments (0)

No comments yet — be the first to react.

Reader questions (0)

No questions yet — be the first to ask.

Stuck on something in this article? Ask below. Your name is shown publicly; your email is never stored. A question appears here once a moderator approves it.