da2522c8caadce46e0995b58618bcdfaff281865
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
d11aa0f030 |
fix(chat,cmdutil): restore group @-mentions and explicit members list subcommand (#180)
* fix(chat,cmdutil): restore group @-mentions and members list subcommand Two CLI regressions surfaced after PR #170 promoted hardcoded helpers over the discovery envelope: 1. issue #177 — `dws chat message send --group ... --at-users ...` failed with `unknown flag: --at-users` on v1.0.16. The hardcoded helper that replaced the v1.0.15 envelope leaf only declared --group / --user / --open-dingtalk-id / --text / --title and silently dropped the envelope's --at-users / --at-all / --at-mobiles flags, so any group @-mention call bounced at cobra's flag parser before ever reaching the MCP tool. Add the three flags back to `newChatMessageSendCommand` and forward atUserIds / isAtAll / atMobiles to `send_message_as_user` in the `--group` branch; reject the flags loudly outside `--group` to avoid silently swallowing user intent in single-chat mode (single-chat tools have no @-mention semantics). 2. issue #164 — `dws chat group members --id <openConversationId>` returned `unknown flag: --id`. The helper had `members` as a "group with bare RunE + --id/--cursor flags" while the envelope publishes `members` as a leaf for `get_group_members`; the merge layer's shape-mismatch branch treats envelope as authority and silently drops the entire helper subtree (list / add / remove / add-bot all become unreachable). Restructure helper-side `members` into a pure group container and promote list to its own explicit subcommand: dws chat group members list --id <openconversation_id> And extend `pkg/cmdutil/MergeHardcodedLeaves` so the existing OverridePriority annotation also applies to the leaf↔group shape mismatch — when the helper group carries strictly higher priority it replaces the dynamic leaf, mirroring the leaf↔leaf override semantics that PR #170 already established. Without this the helper's `list` subcommand stays unreachable and the user-visible bug persists. Tests: - `internal/helpers/chat_test.go`: forwards-at-mentions (group + each flag variant), rejects-at-mentions-outside-group (single-chat validation), members-list-subcommand (structure + execution). - `internal/app/legacy_test.go`: pickCommands integration test that reproduces the #164 shape mismatch end-to-end and asserts the helper subtree survives. - `pkg/cmdutil/leaf_merge_test.go`: positive + boundary (equal priority) cases for the new leaf↔group promotion path. Verified end-to-end against existing chat helper tests, app pickCommands tests, cmdutil merge tests, cobracmd priority tests, compat dynamic command tests — all green. Skill docs (`skills/references/products/chat.md`) updated to teach the new `members list` path with a migration note, and to surface the restored `--at-mobiles` flag alongside `--at-all` / `--at-users`. Closes #177 Closes #164 * fix(chat): resolve merge conflict in command Long text Combine --title-required wording from #174 with at-mention documentation introduced in this PR. CI build was failing on unresolved <<<<<<< / >>>>>>> markers left in chat.go. |
||
|
|
b0c9160ed5 |
fix(chat,cmdutil): route chat message send by destination flag (#170)
* fix(app): graft hardcoded helpers into dynamic tree instead of dropping pickCommands previously dropped an entire helper subtree whenever a top-level product name collided with the dynamic overlay. The intent was to keep the discovery envelope as runtime authority for leaves it declared, but the side effect was that every helper-only sibling disappeared too — commands like `chat message send-by-bot`, `chat message recall-by-bot`, `chat message send-by-webhook`, and `chat group members add-bot` had silently vanished from the open edition since the pickCommands introduction, making PR #161's send-by-bot routing fix unreachable for open-source users. Switch to cmdutil.MergeHardcodedLeaves for same-named products: the dynamic side still wins every leaf conflict, and helper-only subtrees are grafted into the dynamic tree. Envelopes remain authoritative for leaves they declare; helpers once again fill the gaps they don't. Verified on a freshly built open-edition binary: dws chat message send-by-bot --robot-code ... --users ... --text ... returns a real processQueryKey and routes through canonical_product=bot via helper_override, matching the v1.0.15 baseline. * fix(chat,cmdutil): route chat message send by destination flag `dws chat message send --user <userId>` failed with `不合法的参数` because the envelope-generated dynamic command maps every destination to the group-only tool `send_message_as_user`. Only `--group` was viable on the open edition; single-chat (`--user`, `--open-dingtalk-id`) has never worked end-to-end. Fix is in two parts: 1. Add a hardcoded `chat message send` helper that dispatches by destination flag — `--group` → `send_message_as_user`, `--user` / `--open-dingtalk-id` → `send_direct_message_as_user`. This mirrors the closed-source wukong overlay's chatMessageSendCmd so the open edition lines up with the rest of the product. 2. Let hardcoded leaves opt into overriding the dynamic envelope in `cmdutil.MergeHardcodedLeaves` when they carry a strictly higher OverridePriority. The default remains "envelope is authority"; the opt-in exists for the narrow case where the envelope exposes a single dispatch path but the hardcoded leaf needs richer flag-based routing (as here). The new send helper uses preferLegacyLeaf (priority 100) so it wins against the dynamic leaf. OverridePriority/SetOverridePriority move to pkg/cmdutil as the new source of truth; internal/cobracmd/priority.go now delegates so the annotation key stays single-sourced across the merge layer and helpers. Verified end-to-end against a freshly built open-edition binary: send --user 034766 --text … → send_direct_message_as_user → success send --group <cid> --text … → send_message_as_user → success |
||
|
|
bbca507792 |
feat(discovery): MCP discovery service abstraction with positional params, examples, defaults, and schema v3 extensions (#156)
* discovery * discovery * wk discovery * wk discovery * wk discovery * wk discovery * wk discovery * wk discovery * discovery example and default * position param * Fix test * dev auto login * fix test * fix conflict |
||
|
|
93d6fdb17e |
feat: edition layer for Wukong overlay; promote shared code to pkg/
Introduce a build-time edition hook so downstream overlays (e.g. Wukong)
can customize auth UX, config dir, static server list, visible products,
and extra root commands while keeping the default open-source behavior.
- Add pkg/edition (defaults) and pkg/editiontest contract tests; Makefile
target edition-test; CI job edition-tests.
- Root: optional RegisterExtraCommands with tool caller adapter; inject
static servers to skip market discovery when configured; deduplicate
top-level commands so overlay wins; extend hideNonDirectRuntimeCommands
with edition VisibleProducts and static commands (recovery/schema/mcp).
- Auth/config: gate login subcommand and auth login hints for embedded
editions; optional token auto-purge; edition ConfigDir override.
- version: human-readable multi-line output plus JSON with edition,
architecture, build, commit.
- Relocate internal/{config,convert,validate} to pkg/; add pkg/cli and
pkg/cmdutil (flags/time helpers).
- CI: optional notify-downstream job (GitLab trigger via secrets) on main
push; open_source_policy_test adjusted for new layout.
Secrets (repo settings): WUKONG_TRIGGER_TOKEN, WUKONG_TRIGGER_URL — optional;
if unset, downstream step is skipped.
Made-with: Cursor
|