Hilbert-beinghappy/dsh-plugin-auxiliary-runtime0

dsh-plugin-auxiliary-runtime

可取消的辅助模型运行期插件:提供独立于官方 Token 计费的辅助调用账本

AI 分析

核心用途是为辅助模型调用提供可取消的运行期环境,并在官方 Token 统计之外记录独立的账本。适合需要精细化审计辅助模型消耗、进行多模型协同任务的用户。需要特定版本的 DSH 宿主。

包名
dsh-plugin-auxiliary-runtime
版本
0.1.1
许可证
MIT
最近更新
2026年8月22日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Hilbert-beinghappy/dsh-plugin-auxiliary-runtime

Three sourced usage views

ViewSource and meaning
OfficialThe official Host tokenUsage projection, owned by the Agent loop.
AuxiliaryThis plugin's auxiliary_runtime ledger, aggregated from authoritative call rows.
CombinedA read-time, bucket-by-bucket sum of Official and Auxiliary values.

The four disjoint buckets are uncachedInputTokens, outputTokens, cacheReadTokens, and cacheWriteTokens. Combined values are derived for consumers and stay outside the official projection.

Main Session transcript

Auxiliary calls use the existing Session as an identity and routing fence. The main transcript receives formal messages through the normal Session flow, after the user submits an accepted Draft. Clarify questions, answers, and Draft previews remain in Clarify's temporary Host state.

Durable auxiliary ledger

Durable rows contain identifiers, purpose, status, the four token buckets, usageRecorded, normalized failure { category, code }, and timestamps. Prompts, messages, system text, model output, custom answers, credentials, environment values, and filesystem paths remain outside storage. Failure records contain only the normalized { category, code }; the official LlmFailure.message stays outside storage.

Admission, usage, and replay

run writes a durable running row before llm.prepareCall and prepared.stream. Prepared requests complete token-limit admission after provider metadata has been materialized and before streaming begins. The latest provider usage chunk replaces the four buckets on the authoritative row; usageRecorded distinguishes an observed all-zero report from a missing report. Recorded usage survives a later error or aborted finish.

Successful live calls return model text ephemerally to the same-process caller, joined in stream order and bounded to 65,536 UTF-16 code units. Terminal replay returns the durable status and usage with replayed: true and output: null; a caller that needs new text uses a new callId. Active-id reuse, cross-Session reuse, and purpose changes are reported as conflicts.