Files
zclaw_openfang/hands/predictor.HAND.toml
iven 5599c1a4db feat(phase2): complete P1 tasks - Channels, Triggers, Skills CRUD and UI enhancements
Phase 2 P1 Tasks Completed:

API Layer (gateway-client.ts, gatewayStore.ts):
- Add Channels CRUD: getChannel, createChannel, updateChannel, deleteChannel
- Add Triggers CRUD: getTrigger, createTrigger, updateTrigger, deleteTrigger
- Add Skills CRUD: getSkill, createSkill, updateSkill, deleteSkill
- Add Scheduled Tasks API: createScheduledTask, deleteScheduledTask, toggleScheduledTask
- Add loadModels action for dynamic model list

UI Components:
- ModelsAPI.tsx: Dynamic model loading from API with loading/error states
- SchedulerPanel.tsx: Full CreateJobModal with cron/interval/once scheduling
- SecurityStatus.tsx: Loading states, error handling, retry functionality
- WorkflowEditor.tsx: New workflow creation/editing modal (new file)
- WorkflowHistory.tsx: Workflow execution history viewer (new file)
- WorkflowList.tsx: Integrated editor and history access

Configuration:
- Add 4 Hands TOML configs: clip, collector, predictor, twitter

Documentation (SYSTEM_ANALYSIS.md):
- Update API coverage: 65% → 89% (53/62 endpoints)
- Update UI completion: 85% → 92%
- Mark Phase 2 P1 tasks as completed
- Update technical debt cleanup status

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-15 01:38:34 +08:00

144 lines
2.8 KiB
TOML

# Predictor Hand - 预测分析能力包
#
# OpenFang Hand 配置
# 这个 Hand 提供预测分析、趋势预测和数据建模能力
[hand]
name = "predictor"
version = "1.0.0"
description = "预测分析能力包 - 执行回归、分类和时间序列预测"
author = "ZCLAW Team"
# Hand 类型
type = "data"
# 是否需要人工审批才能执行
requires_approval = false
# 默认超时时间(秒)
timeout = 600
# 最大并发执行数
max_concurrent = 2
# 能力标签
tags = ["prediction", "analytics", "forecasting", "ml", "statistics"]
[hand.config]
# 模型配置
default_model = "auto" # auto, regression, classification, timeseries
model_storage = "/tmp/zclaw/predictor/models"
# 训练配置
train_test_split = 0.8
cross_validation = 5
# 输出配置
output_format = "report" # report, json, chart
include_visualization = true
confidence_level = 0.95
# 特征工程
auto_feature_selection = true
max_features = 50
[hand.triggers]
# 触发器配置
manual = true
schedule = true
webhook = false
# 事件触发器
[[hand.triggers.events]]
type = "data.updated"
pattern = ".*(forecast|predict|analyze).*"
priority = 7
[[hand.triggers.events]]
type = "chat.intent"
pattern = "预测|分析|趋势|forecast|predict|analyze|trend"
priority = 5
[hand.permissions]
# 权限要求
requires = [
"file.read",
"file.write",
"compute.ml"
]
# RBAC 角色要求
roles = ["operator.read", "operator.write"]
# 速率限制
[hand.rate_limit]
max_requests = 20
window_seconds = 3600 # 1 hour
# 审计配置
[hand.audit]
log_inputs = true
log_outputs = true
retention_days = 30
# 参数定义
[[hand.parameters]]
name = "dataSource"
label = "数据源"
type = "text"
required = true
description = "数据文件路径或 URL"
[[hand.parameters]]
name = "model"
label = "模型类型"
type = "select"
required = true
options = ["regression", "classification", "timeseries"]
description = "预测模型的类型"
[[hand.parameters]]
name = "targetColumn"
label = "目标列"
type = "text"
required = true
description = "要预测的目标变量列名"
[[hand.parameters]]
name = "featureColumns"
label = "特征列"
type = "text"
required = false
description = "用于预测的特征列(逗号分隔,留空自动选择)"
# 工作流步骤
[[hand.workflow]]
id = "load"
name = "加载数据"
description = "读取和验证输入数据"
[[hand.workflow]]
id = "preprocess"
name = "数据预处理"
description = "清洗数据、处理缺失值、特征工程"
[[hand.workflow]]
id = "train"
name = "训练模型"
description = "训练预测模型并进行交叉验证"
[[hand.workflow]]
id = "evaluate"
name = "评估模型"
description = "计算模型性能指标"
[[hand.workflow]]
id = "predict"
name = "执行预测"
description = "使用训练好的模型进行预测"
[[hand.workflow]]
id = "report"
name = "生成报告"
description = "生成包含可视化的分析报告"