Commit Graph

1 Commits

Author SHA1 Message Date
Cursor Agent
dd5f08fb35 feat(plugins): od plugin diff <a> <b> (Phase 4 author tooling)
Plan AA1.

apps/daemon/src/plugins/diff.ts ships a pure helper:

  diffPlugins({ a, b }) \u2192 PluginDiffReport
    { pluginId?, entries: PluginDiffEntry[], added, removed, changed }

Each entry carries field path + kind ('added' | 'removed' |
'changed') + before / after / optional summary. Entries sort by
field path so the report is byte-deterministic across re-runs
(modulo timestamps, which the helper avoids comparing).

Compared fields:

  Top-level:   id, title, version, sourceKind, source, trust,
               capabilitiesGranted
  Manifest:    title, version, description, license, tags
  od.*:        kind, taskKind, mode, capabilities, inputs[]
               (by name), context.skills (by ref / path),
               context.craft, context.assets, connectors.required
               (by id), genui.surfaces (by id)
  Pipeline:    stages roster + per-stage atoms[] + until + repeat

Collection diffs collapse to '<n> added, <m> removed' summaries
so the CLI renders one line per field instead of dragging in a
generic deep-diff library.

CLI: `od plugin diff <id-a> <id-b> [--json]`. Renders +/-/~
glyphs per kind. printPluginHelp() updated.

Daemon tests: 1705 \u2192 1716 (+11 cases on plugins-diff:
equivalence, top-level version + trust changes, capabilitiesGranted
add / remove, id rename surfaces (no shared pluginId), taskKind
change, inputs[] roster diff, pipeline added / removed / per-
stage atoms churn, connectors.required churn, lexicographic
sort, aggregate count parity).

Co-authored-by: Tom Huang <1043269994@qq.com>
2026-05-09 16:48:58 +00:00