Files
dingtalk-workspace-cli/internal/helpers
玉澜 93d6e1a001 feat(cmdcore): unified CommandSpec + FromLeafSpec/FromShortcut adapters (Phase 2)
Introduce cmdcore.CommandSpec as the single typed leaf definition and
cmdcore.NewCommand as the one orchestration path (flags → constraint decl
checks → Runtime Schema projection → constraint help → PostMount → RunE
escape / generated RunE{required → constraints → Validate → BuildArgs →
ConfirmRisk → Dispatch}). Dispatch becomes a spec property, not a
separate framework.

helpers.NewLeafCommand now delegates to cmdcore.NewCommand(FromLeafSpec),
so every LeafSpec command — including all 27 devapp leaves — flows through
the unified spec. The MCP dispatch (Call / callMCPToolOnServer /
callMCPTool) is captured in the FromLeafSpec closure.

internal/shortcut/adapter.go adds FromShortcut, the typed seam mapping a
Shortcut's shared base (flags of every kind, known constraints, risk,
help identity) into a CommandSpec. It is intentionally NOT wired into the
live mount() path: Shortcut's multi-step Execute, decline-returns-nil
semantics, and Flag.Enum/Hidden/custom-constraint extras are not modeled
by cmdcore yet, so the 376 shipped shortcuts stay byte-identical. Live
wiring is deferred to Phase 3, gated by shortcut-list + schema equivalence.

Commands are provably unaffected: check-generated-drift ok (840 tools,
identical hashes), `dws schema --all` and `shortcut list` unchanged, full
helpers/cmdcore/shortcut suites green, changed-code coverage 100%.
2026-07-30 20:31:54 +08:00
..
2026-07-15 12:08:39 +08:00
2026-07-15 11:41:30 +08:00
2026-07-15 11:41:30 +08:00
2026-06-18 18:34:12 +08:00
2026-06-18 18:34:12 +08:00
2026-07-22 16:31:10 +08:00
2026-07-22 16:31:10 +08:00
2026-03-28 17:51:22 +08:00
2026-07-15 12:08:39 +08:00
2026-07-15 12:08:39 +08:00
2026-07-28 11:36:44 +08:00
2026-07-15 12:08:39 +08:00
2026-07-15 11:41:30 +08:00
2026-03-27 17:55:57 +08:00
2026-03-27 17:55:57 +08:00
2026-07-28 12:09:57 +08:00