DSH HUB
HomePlugin StorePlugin PacksCommunityRankingsResourcesPublish Guide
Plugin source
Back to catalog

MrFeng-rancheng /

MrFeng-rancheng/dsh-ctxfold

Verified

Guarded context assembly for long coding sessions: doctor / ask / status tools that cut input tokens, with the CLI bundled.

★ 0 Stars0 Forks0 IssuesN/A Community rating0 Confirmed installs
View on GitHubProject homepage
READMESource: main@af4b39ad

dsh-ctxfold

把 ctxfold 注册为 DeepSeek Harness 的原生工具——装好即自动生效, 不需要让模型自己想起来敲命令。

提供三个工具

工具 作用 只读
ctxfold_doctor 采用前体检:仓库规模、依赖密度、模拟节省、严格可见率损失、建议预算与是否 --strict 是
ctxfold_ask 为某个问题装配一轮上下文(不调用模型):返回将要发送的 prompt、`### #path::symbol file:start-end` 出处头、卡片/占位符、token 与免算状态
ctxfold_status 记忆条数(fresh/stale)、账本事件计数、预算与 guard 级别 是

依赖

不需要单独安装工具。 插件自带 endor/ctxfold-tool.zip,首次调用任一工具时会自动解包到用户 site-packages(纯文件复制,不需要网络、不需要 pip、不受中文路径影响)。想额外得到 ctxfold 命令别名,再 pip install 一次即可,属可选。

依赖(可选)

本机需已安装 ctxfold 命令:

# 工具本体在本包的 03-插件-ctxfold工具 目录(等价于安装该目录)
python -m pip install "<本包路径>/03-插件-ctxfold工具"
ctxfold --help          # 确认可用

安装

Windows 直接双击投稿包根目录的 一键安装.cmd(macOS 一键安装.command,Linux ./一键安装.sh)。 它会自动找 DSH profile、装插件、装工具本体并自检。等价的命令行写法:

cd <本包路径>/04-插件-DSH集成
python install.py --with-tool "<本包路径>/03-插件-ctxfold工具"

它补齐 DSH 认插件需要的四处登记(node_modules 文件、dependencies、dsh.profile.bundles、cordis.patch.yml 的 insert 行), 改前自动备份,已存在的跳过。先看要改什么加 --dry-run;profile 不是 desktop 加 --profile <名字>。

装完完全退出并重开 DSH(刷新页面不算)。

找不到 ctxfold 命令时

插件按三级回退找工具:环境变量 CTXFOLD_BIN → PATH 里的 ctxfold → python -m ctxfold.cli。 都不行才报错,并在报错里列出尝试过的命令。可用环境变量指定:

变量 例子 用途
CTXFOLD_BIN C:/Python312/Scripts/ctxfold.exe 直接指向可执行文件
CTXFOLD_PYTHON C:/Python312/python.exe 指向解释器,插件自动改用 python -m ctxfold.cli

排障与常见问题见 安装说明.md。

配置(cordis.patch.yml)

- insert:
    - id: dsh-ctxfold
      name: dsh-ctxfold
      config:
        enabled: true
        corpus: ''        # 默认仓库根;留空则用会话工作目录
        budget: 1600      # 单轮证据 token 预算
        strict: false     # true = 可见性优先(成本约 +45%,严格可见率 +31pt)
        timeoutMs: 90000

说明

  • 纯只读 + 本地子进程调用,不联网、不读密钥。
  • 参数以数组传给 execFile,不做字符串拼接,避免命令注入。
  • 若 ctxfold 未安装,工具会返回一条明确的安装提示,而不是报错崩溃。
  • token 数为估算值(代码文本上偏高约 30%),当上界看;省了多少百分比 这类比值不受影响。
  • 关闭插件:把 config.enabled 设为 false。
—/ 5

No ratings yet

Verified DSH bundle

Commit af4b39adb957

Community comments

No comments yet. Be the first to write one.

DSH HUB

A community index for DSH plugins. Not an official GitHub or DeepSeek AI product.

CommunityResourcesAPIAbout