Skip to content

feat(zcode-context-insight): add full featured orginal context insight plugin - #112

Open
bowenliang123 wants to merge 1 commit into
zai-org:mainfrom
bowenliang123:feat/zcode-context-insight
Open

bowenliang123 wants to merge 1 commit into
zai-org:mainfrom
bowenliang123:feat/zcode-context-insight

Conversation

@bowenliang123

@bowenliang123 bowenliang123 commented Oct 19, 2026 •

Copy link
Copy Markdown

Source repository: bowenliang123/zcode-context-insight — the implementation submitted in this PR.

Provenance, authorship and licensing (please read first)

This PR is not another context-insight project. I am the author of dsh-context, the original context insight and management plugin (Apache-2.0; 2,360 stars, 73 forks, and 164,775 npm package downloads in the 30 days ending 2026-10-18). This PR is my ZCode adaptation of that work.

I am submitting it because the marketplace already lists a separate zcode-context plugin by Kevinzzz6 (repository). That project claims to be a copycat “reimplementation” of dsh-context, but its own public documentation is a feature-by-feature map of what it took from dsh-context and what it still intended to take; it then ships the result under its own name and a more permissive license. In plain terms, this is not inspiration—it is appropriation of the original product's core experience:

  • Its README states: “界面与交互设计参考了 dsh-context,并针对 ZCode 重新实现” (“UI and interaction design draws on dsh-context and is reimplemented for ZCode”).
  • Its docs/dsh-comparison.md is a feature-by-feature gap analysis against dsh-context 0.69.1. It lists dsh's views and capabilities as the target, includes a section named “还没有借鉴的功能” (“features not yet borrowed”), and states that most gaps were implemented in 0.3.x. That is more than a passing reference to interaction flow.

I am not asking this PR to remove or replace zcode-context; this PR only adds a separate plugin. I am asking the maintainers to review the existing entry's provenance and licensing:

  • The existing plugin has no right to substitute a more permissive license below Apache-2.0. Its README acknowledges dsh-context as its design source, and its comparison document tracks dsh's views and features as the target. If that extends to Apache-2.0 code or derived material, Kevinzzz6 cannot relicense it under MIT: MIT drops Apache-2.0's attribution, NOTICE and patent terms, and cannot wash the upstream license off copied code. I consider this license substitution unreasonable and legally invalid for any Apache-2.0-derived material. The marketplace should treat it as a compliance violation unless the author can demonstrate a clean-room implementation.
  • dsh-context is licensed under Apache-2.0.
  • The existing zcode-context package is distributed as MIT and contains only an MIT LICENSE; it does not include the Apache-2.0 license or a NOTICE for dsh-context.
  • At a minimum, the original project's authorship and naming should be respected, and the marketplace should require accurate provenance and license notices.

On user value, the existing 0.3.10 entry is functionally incomplete and does not represent the complete product vision: it exposes only 2 app-only tools and 4 views, and omits the full request browser, file activity, fleet, cross-session insights, preferences and the model-visible /context report. It gives ZCode users a fragment of the intended experience, not the full product. This submission is the fuller implementation: it includes the context dashboard and metrics strip, composition and current-context detail with donut charts, trend/DNA, request browser, events, file activity, fleet and cross-session insights, preferences, the /context command and a skill. It exposes 14 tools (13 app-only, plus the model-visible get_context_report).

Scope: this PR adds zcode-context-insight 0.1.0 only. It does not modify the existing zcode-context entry. The new plugin is Apache-2.0, with a NOTICE crediting dsh-context, ZCode, models.dev and the DeepSeek image-token calculator.

Plugin type (required) / 插件类型(必填)

  • UI Plugin / 是 UI 插件 — provides MCP Apps interactive pages / 提供 MCP Apps 交互页面
  • Standard plugin / 普通插件(非 UI) — does not provide MCP Apps interactive pages / 不提供 MCP Apps 交互页面
  • Not applicable / 不适用 — repository-only changes; no plugin content changed / 仅仓库级改动,不涉及插件内容

Affected plugin name(s) / 涉及的插件名称:zcode-context-insight

What / 改动内容

Adds zcode-context-insight 0.1.0, a read-only, offline context insight panel for ZCode: per-request composition, trend/DNA, request browser, injections/compactions, file activity, agent fleet, cross-session insights and preferences, plus a /context command and a skill.

This is a separate plugin from the existing zcode-context; it does not modify or replace it. The plugin is installed as a session-scoped ui.surfaces panel (ui://zcode-context-insight/context.html).

Screenshots

Current implementation, captured from the built panel with live local data.

Context panel Request browser
Context panel Request browser
File activity Fleet
File activity Fleet
Insights Preferences
Insights Preferences
More screenshots: trend overview and DNA fingerprints
Context trend DNA fingerprints
Context trend overview DNA fingerprints

Read-only and side effects / 只读与副作用

  • SQLite is opened read-only with PRAGMA query_only; no migrations, session writes or locks.
  • The only write is the plugin's own preferences.json under ZCODE_PLUGIN_DATA.
  • No network, telemetry or model calls; the UI resource declares an empty CSP allowlist.
  • Session identity comes only from _meta["com.zcode/request-context"].
  • 13 tools are app-only; get_context_report is visible to the model for /context.
  • Reads ~/.zcode/cli (db/, rollout/, debug/, log/) and the provider/retention configuration; dataRoot, dbPath, contextWindow and priceFile are configurable.

Version, packaging and licensing / 版本、打包与许可

  • 0.1.0 in both plugin.json and marketplace.json; source ./external_plugins/zcode-context-insight; category developer-tools.
  • EN/CN READMEs, description_i18n for en and zh-CN, 512×512 PNG icon at assets/zcode-context-insight/icon.png.
  • Apache-2.0; NOTICE credits dsh-context, ZCode, models.dev and the DeepSeek image-token calculator; the build emits THIRD_PARTY_NOTICES.txt for bundled dependencies.
  • No dist/, secrets, machine-specific paths or private dependencies are committed; the release pipeline builds the artifact.

Verification / 验证

  • python3 scripts/validate.py → OK: 47 plugins.
  • python3 -m unittest tests.test_icon_assets → 3/3.
  • python3 -m unittest tests.test_generated_outputs → 3/3.
  • pnpm install --filter zcode-context-insight --frozen-lockfile → lockfile up to date.
  • pnpm --filter zcode-context-insight run build → server/worker/HTML built.
  • pnpm --filter zcode-context-insight test → 11/11.
  • node scripts/test-mcp-app-artifacts.mjs → PASS isolated artifact zcode-context-insight@0.1.0.
  • build_dist.build_zip → 3.04 MB artifact.
  • Real ZCode Desktop 3.15.3 verification is recorded in the source repository's docs/verification.md; screenshots are in the plugin README.

Self-check / 自查清单

  • UI Plugin selected; affected name zcode-context-insight listed.
  • Plugin name is unique kebab-case; new external plugin directory is external_plugins/zcode-context-insight/.
  • Usage category is developer-tools.
  • version is set in both plugin.json and marketplace.json.
  • README.md and README_CN.md are equivalent.
  • description_i18n has both en and zh-CN.
  • No secrets, machine-specific paths or private dependencies.
  • Model/API/network dependencies documented; no network requests.
  • python3 scripts/validate.py passes; the plugin artifact zip passes build_dist.build_zip (the full build_dist.py runs in CI).

@bowenliang123 bowenliang123 changed the title feat(zcode-context-insight): add context insight panel plugin feat(zcode-context-insight): add complete and better context insight plugin Oct 19, 2026
@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

@bowenliang123 bowenliang123 changed the title feat(zcode-context-insight): add complete and better context insight plugin feat(zcode-context-insight): add full featured originated context insight plugin Oct 19, 2026
@bowenliang123 bowenliang123 changed the title feat(zcode-context-insight): add full featured originated context insight plugin feat(zcode-context-insight): add full featured orginal context insight plugin Oct 19, 2026
@bowenliang123

Copy link
Copy Markdown
Author

补充一个请求:如果维护者认为合适,我希望用本仓库的实现直接替换市场里现有的 zcode-context 插件,而不是长期并存。主要理由是 license 合规(现有条目以 MIT 分发,但其公开文档承认源自 Apache-2.0 的 dsh-context),以及本实现在视图、工具和整体体验上更完整。若需要分阶段处理(先并存,再迁移或下架旧条目),我也愿意配合。谢谢。

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants