packages/core

August 31, 2026 · View on GitHub

English | 中文

Summary

The core group provides the product API spine of the DeepSeek Harness: an append-only session log, system-prompt assembly, a tool registry, the Agent handle, and the concrete loop that drives them. Every composition boots these packages, and plugins and consumers build against their stable contracts. A turn flows through all of them — the loop claims a prompt, opens a turn on the session log, assembles the request through system-prompt, streams the model response, dispatches tool calls through the registry, and appends every model-visible fact back to the log. Choose this group when you build an agent or extend one; the default product composition is dsh-base.

Table of Contents


Packages

PackageRolectx key
scope/Scoped registration and event routing that isolate one agent's contributionslibrary — no ctx key
session/The append-only session event log every agent's history derives fromctx.sessions
system-prompt/System-prompt assembly from ordered sections, tool schemas, and variablesctx.systemPrompt
tools/The tool registry and guarded execution pipeline the loop dispatches throughctx.tools
agent-tool-presentation/Per-agent tool-presentation selector for presetsno ctx key
agent/The Agent handle plugins program against, plus its live registry and eventsctx.agents
agent-default-model/The deployment default model selection entry points apply to fresh agentsctx.agentDefaultModel
agent-loop/The default agent driver: creates agents and runs the turn and step lifecyclectx.agentLoop

scope supplies the shared scoping primitive; agent owns the public Agent contract, while agent-loop is its default implementation, so extension plugins depend on agent and the driver stays swappable. agent-default-model owns the deployment selection an entry point applies when a session has none of its own. Runnable compositions live under packages/bundle; this group owns only the swappable spine pieces.



Dev Note

Working context for maintainers — click to expand

None.