2nd dokployH
Find a file
kingwl 7ef21239ca feat(session): opt-in packed chunk rows in the JSONL log
Providers stream token-sized deltas, so a session log stores hundreds of
near-identical assistant/chunk lines whose JSON envelopes dwarf their
payloads (~56x measured on a real DeepSeek session, 73% of file bytes).

Add a lossless storage codec to dsh-session: packChunkRuns() folds each
run of >=3 consecutive same-block delta chunks into one storage row --
text-chunks / reasoning-chunks / tool-call-chunks, bare slash-less tags
like the header line's 'session' so rows cannot be confused with session
events -- and decodeStorageRecord() expands rows back to the exact
original events (seq0/time0 + dt gap array reconstruct every member's
seq/time; tool-call rows carry the run-constant id/name). The encoder
whitelists exact shapes and stores anything unrecognized verbatim; the
decoder validates row-tagged values and fails loud on malformation.

The JSONL backend gains a packChunks config (default false). Writing
packs only when enabled -- default-off output stays byte-identical to
the previous layout, so snapshot goldens are untouched. Reading is
layout-blind: scanLog always decodes rows and now checks seq contiguity
with a cursor instead of the line index, so packed, unpacked, and mixed
files all load identically. Fixture readers (llm-replay parseSessionLog,
acp-snapshot normalizeSessionLog) share the codec; the normalizer zeroes
a row's time0/dt exactly like an event's time. The two demo bundles
plumb packChunks from cordis.yml to the backend.

Measured on a real coding session: 105 KB -> 42 KB (-60%), 475 lines ->
74, with reasoning/tool-call heavy sessions saving the most. Covered by
example + fast-check round-trip codec tests, backend packed/mixed/torn-
tail specs, and an end-to-end demo run loading a packed log through a
default-config backend.
2026-07-15 21:26:36 +08:00
.agents/skills Merge remote-tracking branch 'origin/master' into HEAD 2026-07-15 16:56:19 +08:00
.claude docs: accuracy sweep, architecture restructure, two ADRs, review skill 2026-06-13 22:05:34 +08:00
.github/workflows ci(windows): defer coverage lane 2026-07-15 19:58:34 +08:00
docs feat(session): opt-in packed chunk rows in the JSONL log 2026-07-15 21:26:36 +08:00
examples refactor: relocate demo app bundles to packages/examples/*-demo 2026-07-15 16:46:05 +08:00
packages feat(session): opt-in packed chunk rows in the JSONL log 2026-07-15 21:26:36 +08:00
python fix: point node-mode launcher at the renamed dsh-jsonrpc-demo package 2026-07-15 16:46:05 +08:00
scripts fix(i18n): refine Chinese prose and prompt validation 2026-07-15 20:39:24 +08:00
vendor pkg: update vendor dep 2026-07-15 11:28:45 +08:00
.editorconfig Declare LF and final-newline conventions in .editorconfig 2026-07-15 16:09:12 +08:00
.gitattributes Pin LF working trees via .gitattributes 2026-07-15 16:09:12 +08:00
.gitignore single-exe: closure manifest, build pipeline, and CI workflow 2026-07-13 15:50:09 +08:00
.gitlab-ci.yml python: derive release version from repository 2026-07-13 17:49:01 +08:00
.jscpd.json chore: tighten TypeScript duplication lint 2026-07-14 00:24:04 +08:00
AGENTS.md fix: satisfy doc gates after the examples/ relocation 2026-07-15 16:46:05 +08:00
CLAUDE.md Initialize repo with README, AGENTS.md, and CLAUDE.md symlink 2026-06-10 22:58:56 +08:00
eslint.config.mjs fix(i18n): make translation contracts executable 2026-07-14 23:09:01 +08:00
knip.json refactor: relocate demo app bundles to packages/examples/*-demo 2026-07-15 16:46:05 +08:00
lefthook.yml Merge parallel pre-push gates into CI scheduler 2026-07-06 01:47:13 +08:00
LICENSE Initialize repo with README, AGENTS.md, and CLAUDE.md symlink 2026-06-10 22:58:56 +08:00
package.json Merge remote-tracking branch 'origin/master' into HEAD 2026-07-15 16:56:19 +08:00
pnpm-lock.yaml Merge remote-tracking branch 'origin/master' into HEAD 2026-07-15 16:56:19 +08:00
pnpm-workspace.yaml pkg: update vendor dep 2026-07-15 11:28:45 +08:00
pytest.ini Merge remote-tracking branch 'origin/master' into codex/trim-ai-prose 2026-07-14 00:40:36 +08:00
README.i18n.yaml fix(i18n): resolve pairing workflow review findings 2026-07-14 22:38:17 +08:00
README.md docs: revise graph docs from review 2026-07-05 01:25:58 +08:00
README.zh.md fix(i18n): resolve pairing workflow review findings 2026-07-14 22:38:17 +08:00
tsconfig.base.json fix: register the examples/ group in the tsconfig paths map 2026-07-15 16:46:05 +08:00
tsconfig.build.json refactor: relocate demo app bundles to packages/examples/*-demo 2026-07-15 16:46:05 +08:00
tsconfig.json refactor: relocate demo app bundles to packages/examples/*-demo 2026-07-15 16:46:05 +08:00
tsdown.config.ts docs: align prose with runtime contracts 2026-07-14 16:21:41 +08:00
vitest.config.ts fix(i18n): make translation contracts executable 2026-07-14 23:09:01 +08:00
vitest.e2e.config.ts docs: rebalance prose cleanup and add trimming skill 2026-07-13 23:27:00 +08:00
vitest.snapshot.config.ts docs: rebalance prose cleanup and add trimming skill 2026-07-13 23:27:00 +08:00

DeepSeek Harness

English | 中文

The DeepSeek Harness SDK is a plugin-based SDK for building agent harnesses.

Development

This monorepo is built on the Cordis framework (vendored as source under vendor/), microkernel-style: everything is a plugin.

pnpm install
pnpm run test          # vitest
pnpm run demo:repl     # REPL agent demo (needs DEEPSEEK_API_KEY)
pnpm run demo:acp      # ACP server agent demo (needs DEEPSEEK_API_KEY)

For humans, start with the development guide for local setup, hooks, environment variables, and quality gates, then read the architecture design and documentation graph index before package work. Local context lives in packages/ and vendor/.

For agents, follow AGENTS.md.