first commit
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
# 卡片回调边界
|
||||
|
||||
当前 DWS lower interface 没有卡片按钮/action callback 的订阅、验签或回复能力,
|
||||
`callback_supported=false`。因此:
|
||||
|
||||
- 不生成 callback URL、签名密钥或虚构的监听命令;
|
||||
- 不把 `dws event consume` 当作卡片 callback 的替代;
|
||||
- 用户必须使用按钮交互时,停止并说明当前不支持,等待平台接口和 Runtime 正式发布。
|
||||
|
||||
卡片的 create/update 能力不代表 callback 可用。
|
||||
@@ -0,0 +1,27 @@
|
||||
# 创建流式卡片
|
||||
|
||||
使用 `dws chat +messages-send-card`。群目标传 `--group`;单聊 userId 传 `--receiver`,
|
||||
Runtime 会唯一解析为 openDingTalkId;已有 openDingTalkId 时传
|
||||
`--receiver-open-dingtalk-id`。三种目标严格三选一。
|
||||
|
||||
- 只传目标:创建卡片并从真实结果取得 `bizId`,供后续更新。
|
||||
- 同时传 `--content`:Runtime 串行执行 create → 从返回提取 `bizId` → update;默认
|
||||
`--flow-status 3`。
|
||||
- 群聊可传 `--at-open-dingtalk-ids` 或 `--at-all`;艾特对象只进入初始
|
||||
`create_and_send_card`。同一次调用带 `--content` 时,Runtime 将 create 返回的
|
||||
`atTag` 自动加在正文前,再调用 `update_streaming_card`;调用方不要拼 ID
|
||||
或艾特占位符。
|
||||
- `--dry-run` 仍执行只读 userId 解析,只输出两步计划,不执行写入。
|
||||
|
||||
创建成功后保留真实 `bizId`。自动更新返回 `verified=true` 时已有明确生效证据;返回
|
||||
`accepted=true, verified=false` 时仅表示服务端已接受请求但未提供独立更新证据,应如实说明,
|
||||
不要重复创建或重复执行相同更新。只有错误明确标记 `retryable=true` 时,才使用原 `bizId`
|
||||
重试;明确未应用或 `bizId` 不一致时停止并保留真实错误。若结果中已经包含 `openTaskId`,
|
||||
可以按用户需要查询一次投递状态;该查询只确认消息投递,不代表卡片正文已经更新成功。
|
||||
|
||||
当前内容仅为 streaming text,不接受 Lark Card JSON、组件树或按钮 callback。
|
||||
|
||||
```bash
|
||||
dws chat +messages-send-card --group <openConversationId> --at-open-dingtalk-ids <mentionedOpenDingTalkId> --content "请确认"
|
||||
dws chat +messages-send-card --group <openConversationId> --at-all --content "请大家确认"
|
||||
```
|
||||
@@ -0,0 +1,14 @@
|
||||
# 流式卡片 Schema
|
||||
|
||||
DWS 当前公开的是 `im.streaming-card.v1` 工作流契约,不是任意组件 Schema:
|
||||
|
||||
- target:group、direct user、direct openDingTalkId;
|
||||
- content:streaming text;
|
||||
- lifecycle:create 可选串联 update,后续按 `bizId` update;
|
||||
- flowStatus:1–5;
|
||||
- callback:不支持。
|
||||
|
||||
参数、required 和 confirmation 读取
|
||||
`dws schema --cli-path "chat +messages-send-card" --compact -f json` 或
|
||||
`dws schema --cli-path "chat +messages-update-card" --compact -f json`。不要把 Lark card JSON 字段翻译成
|
||||
未发布的 DWS flags。
|
||||
@@ -0,0 +1,13 @@
|
||||
# 更新流式卡片
|
||||
|
||||
使用 `dws chat +messages-update-card --biz-id <bizId> --content <文本> --flow-status <1..5>`。
|
||||
|
||||
状态为:1 processing、2 typing、3 completed、4 executing、5 error。Runtime 拒绝范围外的
|
||||
状态;正常完成的最后一次更新应为 3。`bizId` 必须来自真实创建结果,不能用消息 ID 代替。
|
||||
|
||||
更新是写操作,confirmation 以精确 leaf Schema 与 Runtime gate 为准。失败后保留原
|
||||
`bizId` 和状态,不创建新卡片来掩盖更新失败。
|
||||
|
||||
结果中 `verified=true` 表示已有明确更新证据;`accepted=true, verified=false` 仅表示服务端
|
||||
接受了请求但未提供独立生效证据,应如实说明且不得重复执行相同更新。只有错误明确标记
|
||||
`retryable=true` 时才重试;明确未应用或 `bizId` 不一致时停止。
|
||||
Reference in New Issue
Block a user