Files
dingtalk-workspace-cli/internal/cli/schema_hints/metadata/chat.json
T
玉澜 e705012011 feat(schema): migrate parameter overlays into code declarations
Move 121/210 parameter-level Schema field overlays from
schema_hints/metadata JSON into in-code ParamDecl declarations on
DeclareLeafMetadata commands. The declared values are emitted as
dws.schema.* annotations at assembly time via ApplyParamDecls,
outranking tool_schema_hint (rank 620 > 500) so the hint overlay
becomes redundant once the declaration is in place.

Key mechanism changes:
- Add SchemaDecl.Parameters []ParamDecl with property/required/
  interface_type/description/required_when/enum fields
- Add cli.ParamDecl type carried inside ContractFinalPayload
- ApplyParamDecls emits dws.schema.* annotations from the payload
  at assembly time (no sync.Map, no tree-rebuild key issue)
- Add cli.AnnotateRuntimeFlagInterfaceType (41 overlays needed it)
- Add cli.AnnotateRuntimeFlagRequiredValue for explicit true/false
- Compatibility alias check tolerates dws.schema.* annotation
  differences between primary and alias commands
- Remove runtime source_hash recomputation (87ms/997k allocs saved;
  enforced by check-generated-drift.sh at build time instead)
- Add shortcut.Flag.RequiredWhen and wire through FromShortcut
- Add boolFlag OR semantics to fix confirmationBypass disagreement
- Add bindKey default kebab-to-camel for forgotten Bind
- Add schema consumption benchmarks (catalog decode 1.5s/817MB,
  shortcut load 1.9ms/3MB — three orders of magnitude apart)
- Add catalog codegen feasibility probe (34 tools: 0.06s compile,
  31ns access, 87KB linked — extrapolates to 2.1MB for 845 tools)

Migrated products (29 tools, 121 fields):
  aisearch(1), chat(12), contact(4), doc(3), drive(1),
  hrbrain(10), mail(2), report(1), sheet(3), todo(6)

Remaining 89 fields across 11 products blocked by:
  - RPCName not found as string literal (19 tools, shortcut/variable)
  - No matching DeclareLeafMetadata near callMCPTool (11 tools)
  - No single RPCName for multi-step commands (drive.upload etc.)

All tests green: corecmd, cli, helpers. Generation and drift clean.
2026-08-01 09:25:40 +08:00

137 lines
6.9 KiB
JSON

{
"version": 1,
"source": {
"kind": "explicit",
"name": "dws-tool-metadata/chat",
"repository": "DingTalk-Real-AI/dingtalk-workspace-cli",
"channel": "open-source",
"reviewed": true
},
"tools": {
"chat.add_emoji_reaction": {
"reviewed": true,
"cli_path": "chat message add-emoji",
"review_reason": "The four reviewed conversation locator flags are aliases for one openConversationId property; the typed require-one-of constraint owns their conditional requirement."
},
"chat.add_text_emotion": {
"reviewed": true,
"cli_path": "chat message add-text-emotion",
"review_reason": "The four reviewed conversation locator flags are aliases for one openConversationId property; the typed require-one-of constraint owns their conditional requirement."
},
"chat.create_smart_conv_category": {
"parameters": {
"keywords": {
"description": "群名称关键词列表,逗号分隔(可选)",
"interface_type": "array",
"property": "groupNameKeywords",
"required": false
},
"members": {
"description": "群内成员 openDingTalkId 列表,逗号分隔(可选)",
"interface_type": "array",
"property": "memberOpenDingTalkIds",
"required": false
},
"name": {
"description": "分组名称 (必填)",
"property": "categoryName",
"required": true
}
},
"reviewed": true,
"cli_path": "chat category create-smart",
"review_reason": "Expose the existing smart-category helper through the reviewed Agent Schema and preserve its CLI-to-interface parameter contract."
},
"chat.list_message_favorites": {
"parameters": {
"size": {
"interface_type": "string"
}
},
"reviewed": true,
"cli_path": "chat message list-favorites",
"review_reason": "Preserve the reviewed CLI-to-interface conversion: Cobra validates --size as an integer from 1 to 100, then the helper serializes it to the string-valued list_message_favorites size property."
},
"chat.list_owned_or_admin_groups": {
"reviewed": true,
"cli_path": "chat group list-my-groups",
"review_reason": "The reviewed CLI lists all owned or administered groups when --role and --limit are omitted; both flags are optional filters despite stricter imported interface metadata."
},
"chat.remove_emoji_reaction": {
"reviewed": true,
"cli_path": "chat message remove-emoji",
"review_reason": "The four reviewed conversation locator flags are aliases for one openConversationId property; the typed require-one-of constraint owns their conditional requirement."
},
"chat.remove_text_emotion": {
"reviewed": true,
"cli_path": "chat message remove-text-emotion",
"review_reason": "The four reviewed conversation locator flags are aliases for one openConversationId property; the typed require-one-of constraint owns their conditional requirement."
},
"chat.set_group_member_mute_list": {
"reviewed": true,
"cli_path": "chat group-mute-member",
"review_reason": "The reviewed Cobra contract makes --off an optional mode switch: omission adds members to the mute list, while --off removes them. The shared MCP schema incorrectly marks the boolean as unconditionally required."
},
"chat.set_group_mute": {
"reviewed": true,
"cli_path": "chat group-mute",
"review_reason": "The reviewed optional --off switch selects unmute; omission deliberately selects mute, so false is a valid default rather than missing required input."
},
"chat.set_top_conversation": {
"reviewed": true,
"cli_path": "chat set-top",
"review_reason": "The reviewed optional --off switch selects unpin; omission deliberately selects pin, so false is a valid default rather than missing required input."
},
"chat.update_conv_member_roles": {
"reviewed": true,
"cli_path": "chat group set-admin",
"review_reason": "The reviewed optional --off switch selects administrator removal; omission deliberately selects administrator assignment."
},
"chat.update_notification_off": {
"reviewed": true,
"cli_path": "chat mute",
"review_reason": "The reviewed locator aliases feed one openConversationId property, while optional --off selects unmute; typed constraints require one locator without making the mode switch mandatory."
},
"chat.edit_message": {
"reviewed": true,
"cli_path": "chat message edit",
"review_reason": "The reviewed handler requires one conversation locator, a message ID, and exactly one of text or raw content; it optionally derives a title and maps mention controls before invoking edit_message."
},
"chat.get_conv_categories_info": {
"reviewed": true,
"cli_path": "chat category batch-info",
"review_reason": "The reviewed handler requires a comma-separated category-ID list, parses it to integers, and invokes get_conv_categories_info without a mutation or confirmation gate."
},
"chat.list_conv_categories_by_conv": {
"reviewed": true,
"cli_path": "chat category list-by-conv",
"review_reason": "The reviewed handler accepts one of three conversation locator aliases and invokes list_conv_categories_by_conv without a mutation or confirmation gate."
},
"chat.update_group_nick": {
"reviewed": true,
"cli_path": "chat group update-nick",
"review_reason": "The reviewed handler requires the target conversation while intentionally allowing omitted --nick to send an empty nickname and clear the current user's group nickname."
},
"chat.upgrade_group_to_external": {
"reviewed": true,
"cli_path": "chat group upgrade-to-external",
"review_reason": "The reviewed handler validates the target group and optional string-valued extension object, permits caller-authoritative dry-run, and requires explicit --yes before the irreversible upgrade."
},
"chat.shortcut_messages_send_card": {
"parameters": {
"receiver-open-dingtalk-id": {
"property": "receiverOpenDingTalkId",
"required": false
}
},
"reviewed": true,
"cli_path": "chat +messages-send-card",
"review_reason": "Reviewed against authenticated contact-search resolution, create-only, two-action dry-run, create/update success, missing bizId, and partial-failure behavior that preserves the created bizId; the explicit openDingTalkId flag is bound to the lower interface's exact receiverOpenDingTalkId property."
},
"chat.update_text_emotion": {
"reviewed": true,
"cli_path": "chat message update-text-emotion",
"review_reason": "Ported from dws-wukong commits d6831318 and bcf56ccf, merged at 30f13f02. The four conversation locators alias one property; the other six business parameters are required by Cobra before the single im/update_text_emotion call."
}
}
}