|
|
2 mesi fa | |
|---|---|---|
| .. | ||
| src | 2 mesi fa | |
| tests | 2 mesi fa | |
| README.md | 2 mesi fa | |
| package.json | 2 mesi fa | |
| tsconfig.json | 2 mesi fa | |
Stdio JSON-RPC plugin for out-of-process SDK clients such as Python deepseek_harness. HarnessSdkServer handles initialize → session/prompt → shutdown plus session and subagent notifications over JsonRpcLineTransport. This package owns the protocol; jsonrpc-agent boots the external cordis.yml that chooses the surrounding runtime. See the single-executable RFC for the distribution design.
inject: ['agents']. The server gets or creates one agent per sessionId on session/prompt and demuxes subagent/end through the registry. If initialize.model lacks a registered adapter, it mounts dsh-llm-deepseek using $DEEPSEEK_API_KEY and $DEEPSEEK_BASE_URL; a config-registered adapter wins. Persistence, tools, and other adapters come from the surrounding cordis.yml.
No cordis.yml keys. JsonRpcConfig.input, output, and exit are test-only runtime seams; production uses process stdio and process.exit.
stdout carries only JSON-RPC frames. The loading config must omit stdout loggers; diagnostics go to stderr.
A shutdown request flushes its response, disposes the plugin fiber, then exits 0. Disposal idempotently shuts down every SDK-created agent to quiescence, detaches subscriptions, and closes the transport. Bare fiber disposal only stops serving; it does not exit. The app bin owns root disposal for stdin EOF (0), SIGTERM (0), and SIGINT (130).
initialize.serverInfo.name is the wire-stable deepseek-harness-sdk-runtime. Each session permits one in-flight prompt; overlap fails immediately, other sessions remain independent, and the session is reusable after settlement. Persistence roots and deployment persona remain in cordis.yml.
What the model sees: For each accepted session/prompt, the conversation model receives the caller-supplied contentBlocks verbatim as one user message in that SDK session. This package adds no system-prompt prose or tool schema; those come from the plugins in the surrounding cordis.yml.
Token effect: Data-dependent user-message tokens enter retained session history and are resent on later turns until another package compacts them. The JSON-RPC frames, session notifications, and server bookkeeping add zero model-context tokens.
initialize can reuse any pre-registered model adapter, but its only fallback mounts dsh-llm-deepseek.