dsh-loopx-plugin
loopx-project/loopxLoopX——面向长周期 Agent 的提供商中立、本地优先状态内核与控制平面:在 DeepSeek Harness 执行层之上持久化 Goal、Todo、门禁、证据、配额、恢复与交接状态;插件负责引导安装 CLI 与技能、准入有界的同会话续跑,并为精确绑定的工作循环提供本地 GoalBar。
Gitee/GitHub AI 员工:在 issue 里 @ 机器人并指定目标分支(如"需要修改 release-v1.2 分支"),它自动克隆仓库开发、向指定分支提交 PR,可自动合并并自动关闭 issue。v1.2 新增代码安全扫描:配置扫描仓库后按内置/自定义提示词审计代码,去重后把新发现提交 issue。
An issue-driven AI developer for DeepSeek Harness, working against Gitee (码云) and GitHub.
Mention your bot in an issue, and the plugin clones the repository, dispatches an AI worker agent to implement the change, pushes a branch, opens a Pull Request to the branch you ask for, and can auto-merge and auto-close the issue. You can watch Gitee and GitHub repositories at the same time.
中文说明见 README.zh.md。
@botName). Dual platform: each watch row can be prefixed
gitee: or github: (unprefixed rows use defaultPlatform, default gitee), so you can
watch both platforms at once.curl on Windows), explores it, implements the issue, runs checks, and
commits on a ai-fix/issue-<number> branch.需要修改 release-v1.2 分支 / 修改 X 分支 / 改 X 分支基于 X 分支 / 在 X 分支上 / 以 X 分支为基础合并到 X / 合到 X / 目标分支 X / base: X
The requested branch is validated against the remote with git ls-remote; if it does not
exist, the plugin falls back to the repository default branch and says so in a comment.autoMerge), and optionally closes the issue on success (autoCloseIssue).scanRepos) and the plugin
drives a scan worker (reusing the DSH model) through built-in/custom security prompts to
statically audit the cloned code. Findings are deduplicated — the same spot
(file:line + vulnerability type) is only reported once (dedup state persists at
workRoot/scan-state.json) — and new findings are submitted as issues automatically.
Supports scheduled scanning (scanEnabled + scanIntervalMs) and manual triggering
(the "立即扫描" button in the settings card or POST /gitee-ai/scan).git and the Gitee API through
PowerShell + C:\Windows\System32\curl.exe), a Gitee account with a personal access token.$DSH_HOME/.agent-presets/gitee-worker (gitee-scanner likewise) on first load — no manual setup.dsh plugin --profile <your-profile> add gitee-ai-employee
(or if you prefer installing straight from GitHub: dsh plugin --profile <p> add github:wangbobo-coder/gitee-ai-employee)
Restart dsh, then open Settings → Plugins → Plugin configuration, find the Gitee AI 员工 card and configure:
| Setting | Meaning |
|---|---|
giteeToken | Gitee personal access token (kept secret; never returned by the status API) |
githubToken | GitHub personal access token, optional (kept secret; only needed for github: repos) |
defaultPlatform | Platform for unprefixed watchRepos rows: gitee (default) or github |
botName | The account/issues mention that triggers the bot, e.g. gitee-ai. ASCII is recommended. |
workRoot | Where repositories are cloned; empty = $DSH_HOME/gitee-workers |
watchRepos | Repos to poll, one per line: owner/repo (uses defaultPlatform) or gitee:owner/repo / github:owner/repo |
pollEnabled / pollIntervalMs | Poll on/off and interval (milliseconds) |
autoMerge | Auto-merge the created PR |
autoCloseIssue | Close the issue once the task succeeds |
workerPreset | Agent preset id used for the worker (default gitee-worker) |
scanEnabled | Enable scheduled security scanning of scanRepos |
scanRepos | Repos to scan, one per line: owner/repo with optional gitee:/github: prefix |
scanMinSeverity | Minimum severity to report: critical/high/medium/low/none (default medium) |
scanOneIssuePerRun | true = one consolidated issue per run (default); false = one issue per finding |
scanPrompts | Custom/override prompts {id:{name,prompt}} (same id overrides a built-in) |
scanIntervalMs | Scheduled scan interval (default 21600000 = 6 h) |
scanConcurrency | Max repos scanned in parallel (1–8, default 3); a long scanRepos list queues up and keeps scanning until every repo is done |
pollEnabled is on (or use the manual trigger URL shown in the status API).@gitee-ai
需要修改 release-v1.2 分支
参会人员选择增加学生选项,注意回显处理。
autoCloseIssue on, the issue
is closed on success.For GitHub repos the same flow applies — just configure githubToken and add the repo as
github:owner/repo in watchRepos (or set defaultPlatform to github). For one-off runs
you can also trigger directly:
http://<dsh-host>:<port>/gitee-ai/go?platform=github&owner=octo&repo=hello&number=5
The bot name match uses a lookahead (
(?![A-Za-z0-9_])) so both ASCII and CJK bot names trigger correctly.
/gitee-ai/settings), fill 扫描仓库 with one
[gitee:|github:]owner/repo per line, enable 启用定时扫描, or click 立即扫描全部仓库.
Click 一键获取我的仓库 to auto-fill every repo you can access (own + org memberships)
so you can keep/remove entries before saving (equivalent API: GET /gitee-ai/my-repos).<repo>/.gitee-scan/result.json → findings are diffed against
scan-state.json → new findings are submitted as an issue.Built-in prompt ids: general / sqli / xss / command-injection / path-traversal /
ssrf / hardcoded-secret / insecure-deserialization / authz / dos / dependency.
scanPrompts; add custom ids for new checks.file:line:vulnType; already-reported signatures are skipped.POST /gitee-ai/scan accepts dryRun=true (preview, no issue) and force=true (re-report).GET /gitee-ai/scan returns the prompt catalog, scan jobs and dedup stats.[安全扫描] prefix.cordis.patch.yml contains only an empty default and never a token.tokenConfigured boolean).danger-full-access inside the cloned workspace only.dsh/index.js — host plugin (Cordis object plugin with dsh.bundle manifest).dsh/client.js — web client half (settings card hover/status).preset/gitee-worker/ — the bundled worker agent preset, auto-copied to
$DSH_HOME/.agent-presets/gitee-worker on load if missing (refreshed when the
bundled copy differs from the one already on disk).preset/gitee-scanner/ — the bundled security-scan agent preset (v1.2).v1.3.1 fixes "plugin loads fine but every worker/scan fails" on DSH 0.2.x. All three are follow-ups to host API changes:
shell.run(); use
shell.execute(shell.resolve(req)).result(). The old code threw
shell.run is not a function.agentPresets only honours an explicit
register(definition) and no longer scans $DSH_HOME/.agent-presets; the old code threw
Unknown agent preset: gitee-scanner. The plugin now both registers in code and writes
the preset directory (compatibility with older builds).@deepseek-ai/dsh-persona takes its body as prefix
(required), not text; text threw $.prefix missing required value.After upgrading, restart the DSH process. The plugin is installed as an npm package and a running process never re-imports new code from disk — toggling the plugin on/off is not enough.
Before v1.3.2, saving the settings page serialized the whole config — tokens included —
into cordis.patch.yml inside the installed package. That put a plaintext Gitee token in a
file that is copied around with the package and can end up in a repository.
From v1.3.2 the secret fields (giteeToken, githubToken, webhookSecret) are handled by
the host credentials service instead:
$DSH_HOME/.credentials.yaml (owner-only, written by
DSH), under the refs GITEE_TOKEN, GITHUB_TOKEN, GITEE_WEBHOOK_SECRET.If the credentials service is unavailable (a minimal host without it), the plugin still works but keeps secrets in memory only — they must be re-entered after a restart, and it logs a warning saying so.
Existing installs: after upgrading, re-enter the token once in the settings page (or set
GITEE_TOKEN in the environment). The old plaintext value in the patch is blanked on the
next save; if you want it gone immediately, edit the patch and set the field to "".
Also part of v1.3.2:
summarizeAgent reads events through session.snapshotEvents(fromSeq) — 0.2.x sessions
no longer expose an iterable events array, which made every scan report
agent.session.events is not iterable.{{cwd}}. Only {{provider}} and {{model}} are
registered prompt variables in 0.2.x; anything else throws
unknown prompt variable "{{cwd}}".ensurePreset overwrites a stale on-disk preset instead of treating its presence as
"already up to date".MIT