jiale-li-orion/dsh-meshfin--packages-client-ui-context ↗★ 1

@deepseek-ai/dsh-client-ui-context

查看当前模型上下文,并在同一会话内改写上下文而不改动聊天记录。 适合需检查上下文构成或调整上下文的用户;提供上下文标签页与计量入口。

套件
@deepseek-ai/dsh-client-ui-context
相容性
待驗證
Harness 依賴範圍
workspace:^
Cordis 依賴範圍
workspace:^
版本
0.1.0-rc.7
授權
MIT
最近更新
2026年9月15日

安裝

此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗

@deepseek-ai/dsh-client-ui-context

English | 中文

Browser plugin for inspecting and changing the current model Context without changing the append-origin Chat transcript. It contributes the Context conversation tab, the context-meter action, a Chat rewrite marker, and per-Session controller and viewing state.

User workflow

Context appears between Chat and Trajectory. The header shows the current Context version, routed provider/model, unit count, and token estimates for conversation messages, system prompt, tool schemas, and the estimated total.

The unit list is virtualized and initially reads a bounded tail page. Each row shows role, non-default kind, durable seq span, estimated tokens, and a bounded preview. “Load earlier context” prepends a page only while it still joins the same generation; otherwise the controller refreshes the current tail.

Each row starts with a visible selection check. Click the check or row to choose one unit, Shift-click another row to extend the contiguous range, or use “Select from here to end” to extend the first selected unit through the current Context tail. The selection bar reports unit and token totals. A range containing an unfinished tool exchange cannot be compacted.

Edit and continue

Every editable user prompt has a direct edit action. It opens a dialog populated from a point read. “Save and continue” replaces that row through the current tail and starts a model turn from the corrected Context. “Save without continuing” commits the same replacement without starting a turn. Assistant messages, background injections, checkpoints, and tool exchanges remain read-only.

“Patch this item only” retains later replies. The dialog requires an explicit acknowledgement that those replies were produced from the old value. Images remain Host-authorized; clearing all prose is allowed only when an image remains.

Chat keeps every original row and adds a durable “Model context updated” marker linking back to Context. Files, processes, network effects, approvals, jobs, goals, and other external state are not rolled back.

Compact a selected range

“Compact selection” opens one recoverable dialog that remains the home for admission, generation progress, failure, summary editing, regeneration, and commit. It shows the selected range, summarization model, direct or map/reduce strategy, context and input budgets, output cap, attempted and completed calls, chunks, summary origin, and editable Markdown.

Closing the dialog preserves the durable preparation and local summary draft; a header action reopens it without moving the user to the start of a long Context list. The user can save an edit, regenerate, discard, or commit. Commit is enabled only for a non-blank summary and succeeds only if the Host revalidates the selected range. A concurrent mutation leaves the preparation visible with an actionable error rather than applying it to different content.

Recall checkpoint originals

A checkpoint detail drawer shows the framed summary and offers recursive original-message paging plus literal search. Original messages and search results have separate sections. Reads and searches can continue through opaque cursors without loading the complete provenance at once.

Architecture

SessionContextController is the React-free object layer for Remote calls, cancellation, deduplication, stale-page repair, and immutable output. It subscribes to the resident client Session only while the Context view is mounted. Ordinary reads refresh only when surfaceRevision changes; an active preparation operation also refreshes on log-only Session notifications so its durable plan and call progress appear before the provider call settles.

The slot registration owns a per-session persisted viewing store for selection, detail, editor, preparation, and summary-draft state. Business components receive framework hooks, store actions, and narrowed callbacks through the standard four-share slot contract; they receive no Cordis context or Remote service object.

The plugin registers all contributions through the owning fiber. Unloading it removes the Context tab, meter action, Chat renderer, Conversation Definition, dictionaries, controllers, and stores without changing Host Session data.

Model Experience

Context inspection UI

What the model sees

The model sees nothing from opening, paging, selecting, or expanding the Context view because these actions perform Host reads only and add no Session event or request content.

Token effect

Zero direct tokens. Displayed counts are estimates of content already owned by Session, system-prompt, and tool-schema producers.

KV Cache effect

Read-only UI actions do not change the request or its reusable prefix.

Human rewrite and compaction actions

What the model sees

A successful rewrite or compaction changes the Host-owned current Session surface through ctx.sessionContext. Edit-and-continue starts the next request from the committed replacement; preparation and review alone change nothing.

Token effect

Rewrite substitutes the selected current content, while committed compaction requires a smaller checkpoint. The UI itself adds no model-visible framing beyond the Host operation it invokes.

KV Cache effect

The invoked Host replacement preserves reuse before the changed surface position and invalidates it from that position. UI drafts and failed or discarded preparations have no cache effect.

Known Limitations and Deferred Work

  • Current generation only — Chat and Trajectory retain prior evidence, but the Context tab does not yet switch between historical generations or restore one as current.
  • Loaded-range selection — a range can include only units currently loaded in the virtual list; the user must load earlier pages before selecting them.
  • No semantic recall UI — checkpoint search is literal and in-session, matching the Host capability.
  • No execution-world undo — the warnings disclose that context changes cannot revert external effects.