Lockdrift

io.github.CloudCorpRecords由 GitHub 账号 CloudCorpRecords 发布v0.1.0更新于 Nov 6, 2026

Lockfile versus package.json drift auditor for a repo or monorepo.

已验证STDIO仅桌面开发者工具

概览

AI 生成的概览

Lockdrift 将 package.json 与 package-lock.json 对比并报告依赖漂移,让助手审计仓库或 monorepo 的锁文件一致性。

可以做什么
  • 对比 package.json 文档与其 package-lock.json,返回 IN-SYNC 或 DRIFT 结论及逐项依赖清单。
  • 报告已声明但锁文件中缺失的依赖、锁定版本不满足声明范围的依赖,以及锁文件中存在但已不再声明的包。
  • 识别缺失或无法解析的锁文件,并同时支持 v2/v3 与 v1 锁文件格式。
适用场景
适合在检查 JavaScript 或 TypeScript 仓库的锁文件是否过期时使用,例如有人改了 package.json 却没有重新安装,或在构建、发布前核对 monorepo 中的各个包。
运行要求
以本地进程通过 stdio 运行,可用 npx 运行 npm 包,或用 Docker 镜像运行。无需账号、API 密钥、环境变量或网络访问,比较完全在本地完成。
安装前请注意
它只比较记录的范围,不解析 semver,也不访问软件源,因此结论反映的是文本层面的范围漂移,而非可安装的版本。该工具以字符串形式接收两个文件的完整内容,这些文档会传给助手。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Lockdrift,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

lockdrift

Has the lockfile drifted from the manifest? lockdrift compares the dependency ranges a package.json declares against the ranges recorded in package-lock.json and reports every difference, sorted by name:

  • missing_from_lockfile — declared in the manifest, absent from the lockfile (someone edited package.json and never reinstalled)
  • version_mismatch — present in both, but the recorded ranges disagree
  • extra_in_lockfile — recorded in the lockfile but no longer declared

Lockfile v2/v3 (the root packages[""] entry) and v1 (the top-level dependencies map) are both supported. The comparison is of the recorded ranges — lockdrift reports recorded drift; it does not resolve semver or talk to a registry. Pure local computation: no network, no configuration.

CLI

bash
npx @reneturcios/lockdrift check package.json package-lock.jsonnpx @reneturcios/lockdrift --version

Output is the report as JSON, e.g. {"in_sync": false, "drift_count": 1, "drift": [{"name": "zod", "kind": "version_mismatch", "declared_in": "dependencies", "package_json_range": "^3", "lockfile_range": "^2"}]}.

Exit codes: 0 on success (drift is a result, not an error), 1 on a runtime error (unreadable or invalid file), 2 on a usage error.

MCP server

bash
npx -y @reneturcios/lockdrift mcp

MCP client config:

json
{  "mcpServers": {    "lockdrift": {      "command": "npx",      "args": ["-y", "@reneturcios/lockdrift", "mcp"]    }  }}

Tools

  • check_lockfile_drift — Compare a package.json against its package-lock.json and report drift.
    • package_json (string, required) — the package.json document, as a JSON string
    • lockfile_json (string, required) — the package-lock.json document, as a JSON string

Docker

bash
docker run -i ghcr.io/cloudcorprecords/lockdriftdocker run --rm -v "$PWD:/w" ghcr.io/cloudcorprecords/lockdrift check /w/package.json /w/package-lock.json

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # tsx --test test/*.test.ts (pure local, no network)npm run dev     # run the CLI from source

License

MIT — Copyright (c) 2026 Rene Turcios

来源:README.md,提交 f18fa1e

工具

1

check_lockfile

Check a package.json against its package-lock.json: dependencies with no lock entry, locked versions that do not satisfy the declared range (exact, caret, tilde, and >= ranges), packages locked but not declared, and a missing or unparsable lockfile. Verdict IN-SYNC or DRIFT with per-dependency evidence.

输入参数path必填

版本历史

1
  1. v0.1.0最新Oct 30, 2026

评分

已满足适用检查项的 90%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分