Repository navigation
feat(cloudflare-clef): add Cloudflare CLEF decision-evaluation MCP plugin - #139
TriDefender wants to merge 3 commits into
Conversation
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
…a environment variables
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
|
Update while awaiting review: bumped to 0.3.0 with one feature — |
|
✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically. |
Plugin type (required) / 插件类型(必填)
Affected plugin name(s) / 涉及的插件名称:
cloudflare-clef(Standard plugin)What / 改动内容
Adds a new community plugin
external_plugins/cloudflare-clefv0.2.0 and itsmarketplace.jsonentry.User problem. Agents often need calibrated judgments over concrete evidence — triage, routing, severity grading, accept/reject — where free-text guessing from the chat model is unreliable. This plugin exposes an MCP tool
clef_evaluatethat sends a state plus typed questions (boolean / choice / score, arbitrary unicode ids) to Cloudflare Workers AI CLEF Flash / CLEF and returns per-question answers with full probability distributions and usage.Notable properties.
server/store-secret.ps1stores the Cloudflare Account ID and API token DPAPI-encrypted (bound to the current Windows user) at%USERPROFILE%\.zcode\secrets\cloudflare-clef.json;server/launch.mjsdecrypts at startup via PowerShell and injects them into the process environment (MCP traffic never passes through PowerShell). Environment variables are the cross-platform fallback and take precedence. An alternative to plaintextuserConfigsecrets.https://api.cloudflare.com/client/v4/accounts/<accountId>/ai/run/@cf/cloudflare/<model>(no redirects, no retries, no telemetry); response bodies capped at 1 MiB; evidence budget ~24k text bytes and <= 4 images (PNG/JPEG/WebP).How it was tested.
node --test external_plugins/cloudflare-clef/server/protocol.test.mjs: 15/15 pass (protocol encoding, response validation, image extraction, prototype-pollution-safe id round-trips — ported with the protocol layer).initializehandshake,tools/list, unknown tool/method error codes, missing-credential guidance.Versions and registration. Plugin manifest and
marketplace.jsonentry both 0.2.0, same description anddescription_i18n.Repository checks.
python3 scripts/validate.py: OK (53 plugins).git diff --check: clean.python3 scripts/build_dist.py: on this fresh checkout it fails at the pre-existing UI plugins (excalidraw and the Craft plugins needpnpm buildfirst, as documented in the README); unrelated to this change. The new plugin itself was verified with the repo's ownbuild_zip(): deterministic 22,492-byte zip, sha256e636282c849c906b….Dependencies, network, permissions, side effects. Runtime needs Node >= 22 (
nodeon PATH). On Windows, startup invokespowershellfor the DPAPI decrypt of two short ciphertexts; MCP I/O stays in Node. No other processes, no file writes outside the plugin process, no telemetry.Licensing / provenance. MIT (LICENSE in the plugin's source repo). The protocol layer (
server/protocol.mjs,server/protocol.test.mjs) is ported byte-identical from the MIT-licensed OpenClaw pluginopenclaw-cloudflare-clef0.1.3 (distributed via the OpenClaw plugin registry,clawhub:openclaw-cloudflare-clef); authorship and derivation are stated in both plugin READMEs. All other code is new.Source repository: https://github.com/TriDefender/zcode-cloudflare-clef