mirror of
https://github.com/larksuite/cli.git
synced 2026-09-14 18:42:53 +08:00
bb03c8ac4d
* feat: support vc agent active meetings
* docs: clarify vc agent active meeting flow
* fix: align active meeting shortcut scope
* docs: clarify active meeting id fields
* fix: reject meeting numbers for vc events
* docs: clarify vc agent active meeting flow
* docs: refine vc agent meeting flow guidance
* docs: address vc agent skill review feedback
* docs: clarify vc meeting product wording
* docs: align vc agent skill with quality guidelines
* docs: trim vc agent skill token budget
* Revert "docs: trim vc agent skill token budget"
This reverts commit 8560bb9c19.
59 lines
1.7 KiB
Go
59 lines
1.7 KiB
Go
// Copyright (c) 2026 Lark Technologies Pte. Ltd.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package vc
|
|
|
|
import (
|
|
"context"
|
|
"fmt"
|
|
"io"
|
|
"strings"
|
|
|
|
"github.com/larksuite/cli/errs"
|
|
"github.com/larksuite/cli/shortcuts/common"
|
|
)
|
|
|
|
// VCMeetingLeave leaves a meeting via /vc/v1/bots/leave.
|
|
var VCMeetingLeave = common.Shortcut{
|
|
Service: "vc",
|
|
Command: "+meeting-leave",
|
|
Description: "Leave a meeting by meeting ID",
|
|
Risk: "write",
|
|
Scopes: []string{"vc:meeting.bot.join:write"},
|
|
AuthTypes: []string{"user", "bot"},
|
|
HasFormat: true,
|
|
Flags: []common.Flag{
|
|
{Name: "meeting-id", Required: true, Desc: "meeting ID to leave"},
|
|
},
|
|
Validate: func(ctx context.Context, runtime *common.RuntimeContext) error {
|
|
if strings.TrimSpace(runtime.Str("meeting-id")) == "" {
|
|
return errs.NewValidationError(errs.SubtypeInvalidArgument, "--meeting-id is required").WithParam("--meeting-id")
|
|
}
|
|
return nil
|
|
},
|
|
DryRun: func(ctx context.Context, runtime *common.RuntimeContext) *common.DryRunAPI {
|
|
return common.NewDryRunAPI().
|
|
POST("/open-apis/vc/v1/bots/leave").
|
|
Body(map[string]interface{}{
|
|
"meeting_id": strings.TrimSpace(runtime.Str("meeting-id")),
|
|
})
|
|
},
|
|
Execute: func(ctx context.Context, runtime *common.RuntimeContext) error {
|
|
meetingID := strings.TrimSpace(runtime.Str("meeting-id"))
|
|
body := map[string]interface{}{
|
|
"meeting_id": meetingID,
|
|
}
|
|
data, err := runtime.CallAPITyped("POST", "/open-apis/vc/v1/bots/leave", nil, body)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
if data == nil {
|
|
data = map[string]interface{}{}
|
|
}
|
|
runtime.OutFormat(data, nil, func(w io.Writer) {
|
|
fmt.Fprintf(w, "Left meeting %s successfully.\n", meetingID)
|
|
})
|
|
return nil
|
|
},
|
|
}
|