Files
玉澜andCursor 7773eb27f1 refactor(corecmd): rename package and finish ContractFinal leaf migration
Move cmdcore to corecmd, declare attendance ContractFinal in helpers, keep
Sheet destructive commands --yes-only, and align catalog/policy provenance.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-31 14:13:46 +08:00

50 lines
1.5 KiB
Go

package helpers
import (
"github.com/DingTalk-Real-AI/dingtalk-workspace-cli/internal/cli"
"github.com/spf13/cobra"
)
func newLiveCommand() *cobra.Command {
root := &cobra.Command{
Use: "live",
Short: "直播列表 / 信息",
Long: `查看钉钉直播:列出我的直播记录。`,
RunE: groupRunE,
}
streamCmd := &cobra.Command{Use: "stream", Short: "直播流管理", RunE: groupRunE}
streamListCmd := &cobra.Command{
Use: "list",
Short: "查看我的直播列表",
Example: ` dws live stream list`,
RunE: func(cmd *cobra.Command, args []string) error {
return callMCPTool("get_my_lives", nil)
},
}
DeclareLeafMetadata(streamListCmd, LeafSpec{
Safety: cli.SafetySpec{
Effect: "read", Risk: "low",
Confirmation: "not_required", Idempotency: "idempotent",
},
Schema: LeafSchema{
Description: "查看当前用户发起的直播列表与基础统计",
Interface: &LeafInterfaceDecl{
Mode: "mcp", Availability: "available",
ProductID: "live", RPCName: "get_my_lives",
},
Selection: LeafSelectionDecl{
AgentSummary: "查看当前用户发起的直播列表与基础统计",
UseWhen: []string{"用户要看自己发起过的直播、状态或观看量等列表信息"},
AvoidWhen: []string{"需要创建/开播/结束直播时不要使用;当前公开面仅列表查询"},
Examples: []string{"dws live stream list"},
},
},
})
streamCmd.AddCommand(streamListCmd)
root.AddCommand(streamCmd)
return root
}