Files
zclaw_openfang/hands/twitter.HAND.toml
iven a71c4138cc
Some checks failed
CI / Lint & TypeCheck (push) Has been cancelled
CI / Unit Tests (push) Has been cancelled
CI / Build Frontend (push) Has been cancelled
CI / Rust Check (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
CI / E2E Tests (push) Has been cancelled
fix(audit): 修复深度审计发现的 P0/P1 问题 (8项)
基于 DEEP_AUDIT_REPORT.md 修复 2 CRITICAL + 4 HIGH + 1 MEDIUM 问题:

- C1: PromptOnly 技能集成 LLM 调用 — 定义 LlmCompleter trait,
  通过 LlmDriverAdapter 桥接 zclaw_runtime::LlmDriver,
  PromptOnlySkill.execute() 现在调用 LLM 生成内容
- C2: 反思引擎空记忆 bug — 新增 query_memories_for_reflection()
  从 VikingStorage 查询真实记忆传入 reflect()
- H7: Agent Store 接口适配 — KernelClient 添加 listClones/createClone/
  deleteClone/updateClone 方法,映射到 agent_* 命令
- H8: Hand 审批检查 — hand_execute 执行前检查 needs_approval,
  需审批返回 pending_approval 状态
- M1: 幽灵命令注册 — 注册 hand_get/hand_run_status/hand_run_list
  三个 Tauri 桩命令
- H1/H2: SpeechHand/TwitterHand 添加 demo 标签
- H5: 归档过时 VERIFICATION_REPORT

文档更新: DEEP_AUDIT_REPORT.md 标记修复状态,README.md 更新
关键指标和变更历史。整体完成度从 ~50% 提升至 ~58%。
2026-03-27 09:36:50 +08:00

157 lines
3.2 KiB
TOML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Twitter Hand - Twitter/X 自动化能力包
#
# ZCLAW Hand 配置
# 这个 Hand 提供 Twitter/X 平台的自动化操作和互动能力
[hand]
name = "twitter"
version = "1.0.0"
description = "Twitter/X 自动化能力包 - 发推文、搜索、分析和互动"
author = "ZCLAW Team"
# Hand 类型
type = "communication"
# 是否需要人工审批才能执行
# 发推文等敏感操作需要审批
requires_approval = true
# 默认超时时间(秒)
timeout = 120
# 最大并发执行数
max_concurrent = 3
# 能力标签
tags = ["twitter", "social", "automation", "engagement", "marketing", "demo"]
[hand.config]
# API 配置
api_version = "v2"
rate_limit_mode = "strict" # strict, relaxed
# 发推配置
max_tweet_length = 280
auto_shorten_urls = true
url_shortener = "none" # none, bitly, custom
# 搜索配置
search_max_results = 100
search_include_metrics = true
# 互动配置
max_daily_likes = 50
max_daily_retweets = 25
max_daily_follows = 30
# 安全设置
allow_sensitive_content = false
filter_spam = true
[hand.triggers]
# 触发器配置
manual = true
schedule = true
webhook = true
# 事件触发器
[[hand.triggers.events]]
type = "schedule.cron"
pattern = "0 9,12,18 * * *" # 每天3次
priority = 5
[[hand.triggers.events]]
type = "chat.intent"
pattern = "推特|发推|tweet|twitter|x\\.com"
priority = 5
[hand.permissions]
# 权限要求
requires = [
"twitter.read",
"twitter.write",
"twitter.engage"
]
# RBAC 角色要求
roles = ["operator.read", "operator.write", "social.manage"]
# 速率限制(严格遵循 Twitter API 限制)
[hand.rate_limit]
max_requests = 100
window_seconds = 900 # 15 minutes
# 审计配置
[hand.audit]
log_inputs = true
log_outputs = true
retention_days = 90 # 社交媒体操作保留更长时间
# 参数定义
[[hand.parameters]]
name = "action"
label = "操作类型"
type = "select"
required = true
options = ["post", "search", "analyze", "engage"]
description = "要执行的 Twitter 操作"
[[hand.parameters]]
name = "content"
label = "内容"
type = "textarea"
required = false
description = "推文内容或搜索查询"
[[hand.parameters]]
name = "schedule"
label = "计划时间"
type = "text"
required = false
description = "ISO 日期时间或 'now'"
[[hand.parameters]]
name = "mediaUrls"
label = "媒体 URL"
type = "text"
required = false
description = "附加媒体的 URL逗号分隔最多4个"
# 工作流步骤(根据操作类型)
[[hand.workflow]]
id = "validate"
name = "验证请求"
description = "检查操作权限和参数有效性"
[[hand.workflow]]
id = "prepare"
name = "准备内容"
description = "处理内容、缩短 URL、附加媒体"
[[hand.workflow]]
id = "execute"
name = "执行操作"
description = "调用 Twitter API 执行操作"
[[hand.workflow]]
id = "verify"
name = "验证结果"
description = "确认操作成功并记录结果"
# 操作特定的工作流
[[hand.workflow.post]]
steps = ["validate", "prepare", "execute", "verify"]
approval_required = true
[[hand.workflow.search]]
steps = ["validate", "execute", "verify"]
approval_required = false
[[hand.workflow.analyze]]
steps = ["validate", "execute", "verify"]
approval_required = false
[[hand.workflow.engage]]
steps = ["validate", "execute", "verify"]
approval_required = true