mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-14 16:26:57 +08:00
Improve active skill schema handling
This commit is contained in:
@@ -38,8 +38,8 @@
|
||||
},
|
||||
"enabled": {
|
||||
"type": "bool",
|
||||
"default": false,
|
||||
"description": "是否启用该交易所配置。启用前必须通过凭证完整性校验。"
|
||||
"default": true,
|
||||
"description": "是否启用该交易所配置。只要必要字段齐全并配置成功,就默认启用。"
|
||||
},
|
||||
"hyperliquid_wallet_addr": {
|
||||
"type": "credential",
|
||||
|
||||
@@ -348,11 +348,6 @@
|
||||
"type": "float",
|
||||
"min": 0,
|
||||
"description": "最大保证金占用比例。"
|
||||
},
|
||||
"min_position_size": {
|
||||
"type": "float",
|
||||
"min": 0,
|
||||
"description": "最小下单金额。"
|
||||
}
|
||||
},
|
||||
"validation_rules": [
|
||||
@@ -365,7 +360,8 @@
|
||||
"删除操作不可逆,必须先向用户确认再执行。",
|
||||
"激活(activate)操作将该策略设为默认模板,不是启动运行。",
|
||||
"scan_interval_minutes、initial_balance、lighter_api_key_index 这类交易员/交易所边界值不属于策略本身,若用户在改策略时提到,应引导去对应 trader 或 exchange 配置。",
|
||||
"btceth_max_position_value_ratio、altcoin_max_position_value_ratio、max_margin_usage、min_position_size 等风控字段若越界,应先自动收敛或提示用户确认修正后的值。",
|
||||
"btceth_max_position_value_ratio、altcoin_max_position_value_ratio、max_margin_usage 等风控字段若越界,应先自动收敛或提示用户确认修正后的值。",
|
||||
"最小开仓金额是系统固定值 12 USDT,Agent 不能修改;若用户要求改这个值,应直接说明这是手动面板中的 System enforced 固定项。",
|
||||
"启用量化数据相关开关时,若需要 nofxos_api_key,应主动提醒用户补齐。",
|
||||
"启用排行榜相关能力时,只修改用户明确提到的 enable_*、duration、limit 字段,不要偷偷打开其他排行榜。"
|
||||
],
|
||||
@@ -373,7 +369,7 @@
|
||||
"create": {
|
||||
"description": "创建策略模板。至少需要名称,其他配置可按需追问或按默认值补齐。",
|
||||
"required_slots": ["name"],
|
||||
"optional_slots": ["description", "is_public", "config_visible", "lang", "strategy_type", "symbol", "source_type", "static_coins", "excluded_coins", "primary_timeframe", "selected_timeframes", "btceth_max_leverage", "altcoin_max_leverage", "max_positions", "min_confidence", "min_risk_reward_ratio", "custom_prompt", "role_definition", "trading_frequency", "entry_standards", "decision_process", "use_atr_bounds", "atr_multiplier", "enable_direction_adjust", "direction_bias_ratio", "grid_count", "total_investment", "leverage", "upper_price", "lower_price", "distribution", "max_drawdown_pct", "stop_loss_pct", "daily_loss_limit_pct", "use_maker_only", "use_ai500", "ai500_limit", "use_oi_top", "oi_top_limit", "use_oi_low", "oi_low_limit", "primary_count", "enable_ema", "enable_macd", "enable_rsi", "enable_atr", "enable_boll", "enable_volume", "enable_oi", "enable_funding_rate", "ema_periods", "rsi_periods", "atr_periods", "boll_periods", "nofxos_api_key", "enable_quant_data", "enable_quant_oi", "enable_quant_netflow", "enable_oi_ranking", "oi_ranking_duration", "oi_ranking_limit", "enable_netflow_ranking", "netflow_ranking_duration", "netflow_ranking_limit", "enable_price_ranking", "price_ranking_duration", "price_ranking_limit", "btceth_max_position_value_ratio", "altcoin_max_position_value_ratio", "max_margin_usage", "min_position_size"],
|
||||
"optional_slots": ["description", "is_public", "config_visible", "lang", "strategy_type", "symbol", "source_type", "static_coins", "excluded_coins", "primary_timeframe", "selected_timeframes", "btceth_max_leverage", "altcoin_max_leverage", "max_positions", "min_confidence", "min_risk_reward_ratio", "custom_prompt", "role_definition", "trading_frequency", "entry_standards", "decision_process", "use_atr_bounds", "atr_multiplier", "enable_direction_adjust", "direction_bias_ratio", "grid_count", "total_investment", "leverage", "upper_price", "lower_price", "distribution", "max_drawdown_pct", "stop_loss_pct", "daily_loss_limit_pct", "use_maker_only", "use_ai500", "ai500_limit", "use_oi_top", "oi_top_limit", "use_oi_low", "oi_low_limit", "primary_count", "enable_ema", "enable_macd", "enable_rsi", "enable_atr", "enable_boll", "enable_volume", "enable_oi", "enable_funding_rate", "ema_periods", "rsi_periods", "atr_periods", "boll_periods", "nofxos_api_key", "enable_quant_data", "enable_quant_oi", "enable_quant_netflow", "enable_oi_ranking", "oi_ranking_duration", "oi_ranking_limit", "enable_netflow_ranking", "netflow_ranking_duration", "netflow_ranking_limit", "enable_price_ranking", "price_ranking_duration", "price_ranking_limit", "btceth_max_position_value_ratio", "altcoin_max_position_value_ratio", "max_margin_usage"],
|
||||
"goal": "创建一个可供 trader 绑定使用的策略模板。",
|
||||
"dynamic_rules": [
|
||||
"若用户只是要给 trader 绑定现有策略,应优先在父任务里补 strategy 槽位,而不是误开新的 create。",
|
||||
@@ -387,7 +383,7 @@
|
||||
"update": {
|
||||
"description": "更新策略模板的任意可编辑字段。",
|
||||
"required_slots": ["target_ref"],
|
||||
"optional_slots": ["name", "description", "is_public", "config_visible", "symbol", "source_type", "static_coins", "excluded_coins", "primary_timeframe", "selected_timeframes", "btceth_max_leverage", "altcoin_max_leverage", "max_positions", "min_confidence", "min_risk_reward_ratio", "custom_prompt", "role_definition", "trading_frequency", "entry_standards", "decision_process", "grid_count", "total_investment", "leverage", "upper_price", "lower_price", "distribution", "use_atr_bounds", "atr_multiplier", "enable_direction_adjust", "direction_bias_ratio", "max_drawdown_pct", "stop_loss_pct", "daily_loss_limit_pct", "use_maker_only", "use_ai500", "ai500_limit", "use_oi_top", "oi_top_limit", "use_oi_low", "oi_low_limit", "primary_count", "enable_ema", "enable_macd", "enable_rsi", "enable_atr", "enable_boll", "enable_volume", "enable_oi", "enable_funding_rate", "ema_periods", "rsi_periods", "atr_periods", "boll_periods", "nofxos_api_key", "enable_quant_data", "enable_quant_oi", "enable_quant_netflow", "enable_oi_ranking", "oi_ranking_duration", "oi_ranking_limit", "enable_netflow_ranking", "netflow_ranking_duration", "netflow_ranking_limit", "enable_price_ranking", "price_ranking_duration", "price_ranking_limit", "btceth_max_position_value_ratio", "altcoin_max_position_value_ratio", "max_margin_usage", "min_position_size"],
|
||||
"optional_slots": ["name", "description", "is_public", "config_visible", "symbol", "source_type", "static_coins", "excluded_coins", "primary_timeframe", "selected_timeframes", "btceth_max_leverage", "altcoin_max_leverage", "max_positions", "min_confidence", "min_risk_reward_ratio", "custom_prompt", "role_definition", "trading_frequency", "entry_standards", "decision_process", "grid_count", "total_investment", "leverage", "upper_price", "lower_price", "distribution", "use_atr_bounds", "atr_multiplier", "enable_direction_adjust", "direction_bias_ratio", "max_drawdown_pct", "stop_loss_pct", "daily_loss_limit_pct", "use_maker_only", "use_ai500", "ai500_limit", "use_oi_top", "oi_top_limit", "use_oi_low", "oi_low_limit", "primary_count", "enable_ema", "enable_macd", "enable_rsi", "enable_atr", "enable_boll", "enable_volume", "enable_oi", "enable_funding_rate", "ema_periods", "rsi_periods", "atr_periods", "boll_periods", "nofxos_api_key", "enable_quant_data", "enable_quant_oi", "enable_quant_netflow", "enable_oi_ranking", "oi_ranking_duration", "oi_ranking_limit", "enable_netflow_ranking", "netflow_ranking_duration", "netflow_ranking_limit", "enable_price_ranking", "price_ranking_duration", "price_ranking_limit", "btceth_max_position_value_ratio", "altcoin_max_position_value_ratio", "max_margin_usage"],
|
||||
"goal": "更新一个已有策略模板的指定配置,而不覆盖未提及字段。",
|
||||
"dynamic_rules": [
|
||||
"只更新用户明确提到的字段,不要覆盖未提及的字段。",
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
"若单笔名义价值超过账户权益的 100%,直接拒绝,不允许创建待确认订单。",
|
||||
"加密货币订单的杠杆上限受策略 btceth_max_leverage / altcoin_max_leverage 约束,默认上限为 5x;超出时直接拒绝。",
|
||||
"BTC/ETH 单笔最大仓位价值默认不超过 5 倍账户权益,山寨币默认不超过 1 倍账户权益;若策略里有自定义比例,以策略为准。",
|
||||
"最小仓位价值默认 12 USDT;若策略配置了 min_position_size,以策略为准。低于最小值时直接拒绝。",
|
||||
"最小仓位价值固定为 12 USDT;这是系统强制项,不允许通过 Agent 修改。低于最小值时直接拒绝。",
|
||||
"创建后的待确认订单默认 5 分钟有效,超时自动失效。"
|
||||
],
|
||||
"success_output": "返回 trade_id、估算仓位价值、是否触发大额确认、确认命令和 5 分钟有效期。",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "trader_management",
|
||||
"kind": "management",
|
||||
"domain": "trader",
|
||||
"description": "当用户想创建、查看、修改、删除、启动或停止交易员时调用。交易员是装配层,核心是名称以及绑定的交易所、模型、策略;编辑交易员默认只换绑定,不修改这些依赖对象的内部配置。若用户要改策略参数、模型配置或交易所凭证,应切到各自的 management skill。创建交易员时必须收齐名称、交易所、模型、策略;其中交易所、模型、策略既可以直接选择用户已有可用资源,也可以在当前主流程里先新建/启用对应资源,再继续完成交易员创建。不用于排查交易员启动失败、未下单、收益异常、仓位异常等诊断问题。",
|
||||
"description": "当用户想创建、查看、修改、删除、启动或停止交易员时调用。交易员是装配层;创建交易员时需要名称以及绑定的交易所、模型、策略。编辑交易员只允许修改手动面板可改的 6 项:绑定交易所、绑定模型、绑定策略、扫描间隔、保证金模式、是否展示到竞技场;不修改这些依赖对象的内部配置,也不在这里改名。若用户要改策略参数、模型配置或交易所凭证,应切到各自的 management skill。创建交易员时交易所、模型、策略既可以直接选择用户已有可用资源,也可以在当前主流程里先新建/启用对应资源,再继续完成交易员创建。不用于排查交易员启动失败、未下单、收益异常、仓位异常等诊断问题。",
|
||||
"intents": [
|
||||
"创建交易员",
|
||||
"修改交易员",
|
||||
@@ -50,45 +50,6 @@
|
||||
"default": true,
|
||||
"description": "是否在竞技场中显示该交易员的成绩。"
|
||||
},
|
||||
"btc_eth_leverage": {
|
||||
"type": "int",
|
||||
"min": 1,
|
||||
"max": 20,
|
||||
"description": "交易员级别的 BTC/ETH 杠杆覆盖值,手动面板上限 20。"
|
||||
},
|
||||
"altcoin_leverage": {
|
||||
"type": "int",
|
||||
"min": 1,
|
||||
"max": 20,
|
||||
"description": "交易员级别的山寨币杠杆覆盖值,手动面板上限 20。"
|
||||
},
|
||||
"trading_symbols": {
|
||||
"type": "string",
|
||||
"description": "指定交易币对,通常为逗号分隔,例如 BTCUSDT,ETHUSDT。"
|
||||
},
|
||||
"custom_prompt": {
|
||||
"type": "string",
|
||||
"description": "交易员级别附加提示词,用于覆盖或补充默认策略提示。"
|
||||
},
|
||||
"override_base_prompt": {
|
||||
"type": "bool",
|
||||
"default": false,
|
||||
"description": "是否完全覆盖系统默认提示词。"
|
||||
},
|
||||
"system_prompt_template": {
|
||||
"type": "string",
|
||||
"description": "系统提示词模板名称,例如 default。"
|
||||
},
|
||||
"use_ai500": {
|
||||
"type": "bool",
|
||||
"default": false,
|
||||
"description": "是否启用 AI500 作为交易员级别候选币来源。"
|
||||
},
|
||||
"use_oi_top": {
|
||||
"type": "bool",
|
||||
"default": false,
|
||||
"description": "是否启用 OI Top 作为交易员级别候选币来源。"
|
||||
},
|
||||
"auto_start": {
|
||||
"type": "bool",
|
||||
"default": false,
|
||||
@@ -103,8 +64,6 @@
|
||||
"交易员初始余额由系统在创建时自动读取绑定交易所账户净值,不接受用户手动设置、充值或修改。",
|
||||
"启动交易员前,绑定的模型必须已启用且完整,绑定的交易所也必须已启用且通过对应交易所的完整性校验,否则拒绝启动并明确指出缺哪一项。",
|
||||
"若绑定的是 OKX 交易所,启用前必须已有 passphrase;若绑定的是 Hyperliquid,启用前必须已有 wallet_addr;若绑定的是 Aster,启用前必须已有 user、signer、private_key;若绑定的是 Lighter,启用前必须已有 wallet_addr 和 api_key_private_key。",
|
||||
"btc_eth_leverage 和 altcoin_leverage 若超出系统允许范围,应自动收敛或提示用户修正。",
|
||||
"trading_symbols 若填写,应保持为可识别的交易对列表格式。",
|
||||
"启动(start)和停止(stop)操作属于高风险操作,必须先向用户确认再执行。",
|
||||
"删除(delete)操作不可逆,必须先向用户确认再执行。"
|
||||
],
|
||||
@@ -112,14 +71,13 @@
|
||||
"create": {
|
||||
"description": "创建新的交易员。若缺少交易所、模型或策略,可在当前流程内先选择已有资源,或切去对应 skill 新建/启用后自动回流继续。",
|
||||
"required_slots": ["name", "exchange", "model", "strategy"],
|
||||
"optional_slots": ["auto_start", "scan_interval_minutes", "is_cross_margin", "show_in_competition", "btc_eth_leverage", "altcoin_leverage", "trading_symbols", "custom_prompt", "override_base_prompt", "system_prompt_template", "use_ai500", "use_oi_top"],
|
||||
"optional_slots": ["auto_start", "scan_interval_minutes", "is_cross_margin", "show_in_competition"],
|
||||
"goal": "创建并初始化一个交易员。",
|
||||
"dynamic_rules": [
|
||||
"若用户提到的交易所、模型或策略已经存在且可用,应优先直接补入对应槽位,不要重新创建。",
|
||||
"若依赖资源不存在、被禁用,或用户明确要求新建或启用,禁止直接报缺字段;应切去对应 management:create 或 management:update_status 子任务。",
|
||||
"子任务成功后,系统会恢复当前交易员草稿并继续补齐剩余槽位。",
|
||||
"scan_interval_minutes 超出 3~60 时,自动收敛并告知用户。",
|
||||
"若用户明确想覆盖杠杆、币种范围或提示词,应允许在创建阶段一并收集 btc_eth_leverage、altcoin_leverage、trading_symbols、custom_prompt、override_base_prompt、system_prompt_template、use_ai500、use_oi_top。",
|
||||
"不要向用户收集或确认初始余额;创建时由系统自动读取绑定交易所账户净值作为初始余额。",
|
||||
"创建完成后询问用户是否立即启动(auto_start),启动前再次确认。"
|
||||
],
|
||||
@@ -127,35 +85,27 @@
|
||||
"failure_output": "用人话指出缺失依赖项,或说明当前正在进入哪个依赖子任务。"
|
||||
},
|
||||
"update": {
|
||||
"description": "更新已有交易员,但默认只处理改名或换绑策略、交易所、模型。",
|
||||
"description": "更新已有交易员,但只处理手动面板允许的字段:换绑策略、交易所、模型,或修改扫描间隔、保证金模式、竞技场显示。",
|
||||
"required_slots": ["target_ref"],
|
||||
"optional_slots": ["name", "exchange_id", "ai_model_id", "strategy_id"],
|
||||
"goal": "更新一个已有交易员的名称或绑定关系,但不改动策略、模型、交易所内部配置。",
|
||||
"optional_slots": ["exchange_id", "ai_model_id", "strategy_id", "scan_interval_minutes", "is_cross_margin", "show_in_competition"],
|
||||
"goal": "更新一个已有交易员的手动面板字段,但不改动策略、模型、交易所内部配置。",
|
||||
"dynamic_rules": [
|
||||
"只更新用户明确提到的字段,不要覆盖未提及的字段。",
|
||||
"换绑交易所/模型/策略时,新的资源必须已存在且已启用,否则提示用户先启用或新建。",
|
||||
"如果用户要求改名,应明确告知交易员改名不在这里处理。",
|
||||
"如果用户实际上是想修改策略参数、模型配置或交易所凭证,不要继续留在 trader update;应切到对应 management skill。"
|
||||
],
|
||||
"success_output": "返回更新后的 trader_id 与简短配置摘要,明确哪些字段已经生效。",
|
||||
"failure_output": "明确指出目标交易员不存在、依赖资源不可用,或哪一个字段值仍需用户补充/修正。"
|
||||
},
|
||||
"update_name": {
|
||||
"description": "仅修改交易员名称。",
|
||||
"required_slots": ["target_ref", "name"],
|
||||
"goal": "把指定交易员改成新的名称,不影响其他配置。",
|
||||
"dynamic_rules": [
|
||||
"若当前输入里同时包含别的配置字段,应优先转去更通用的 update,而不是只改名。"
|
||||
],
|
||||
"success_output": "返回 trader_id,并明确告知新的交易员名称。",
|
||||
"failure_output": "明确指出目标交易员不存在,或新的名称仍未收齐。"
|
||||
},
|
||||
"update_bindings": {
|
||||
"description": "修改交易员绑定的交易所、模型或策略(可同时修改多个)。",
|
||||
"description": "修改交易员手动面板可编辑的字段,可同时修改绑定关系、扫描间隔、保证金模式、竞技场显示。",
|
||||
"required_slots": ["target_ref"],
|
||||
"optional_slots": ["exchange_id", "ai_model_id", "strategy_id"],
|
||||
"goal": "调整交易员绑定的依赖资源,而不改动无关配置。",
|
||||
"optional_slots": ["exchange_id", "ai_model_id", "strategy_id", "scan_interval_minutes", "is_cross_margin", "show_in_competition"],
|
||||
"goal": "调整交易员手动面板可编辑的字段,而不改动无关配置。",
|
||||
"dynamic_rules": [
|
||||
"新绑定的资源必须已存在且已启用,否则提示用户先启用或新建。"
|
||||
"新绑定的资源必须已存在且已启用,否则提示用户先启用或新建。",
|
||||
"扫描间隔超出 3~60 时,自动收敛并告知用户。"
|
||||
],
|
||||
"success_output": "返回 trader_id,并明确展示新的模型/交易所/策略绑定结果。",
|
||||
"failure_output": "明确指出缺少哪个绑定目标,或当前依赖资源为什么不可直接绑定。"
|
||||
@@ -214,15 +164,17 @@
|
||||
"failure_output": "明确指出缺少确认、目标交易员不存在,或当前状态无法停止。"
|
||||
},
|
||||
"delete": {
|
||||
"description": "删除交易员,不可逆操作,必须确认。",
|
||||
"required_slots": ["target_ref"],
|
||||
"description": "删除交易员,不可逆操作,必须确认。支持删除单个、多个或全部交易员。",
|
||||
"required_slots": [],
|
||||
"needs_confirmation": true,
|
||||
"goal": "删除一个交易员及其运行入口。",
|
||||
"goal": "删除一个、多个或全部交易员及其运行入口。",
|
||||
"dynamic_rules": [
|
||||
"必须在确认后执行,并明确提醒该操作不可逆。"
|
||||
"必须在确认后执行,并明确提醒该操作不可逆。",
|
||||
"删除范围可以是单个 target_ref、多个目标,或 bulk_scope=all。",
|
||||
"删除前必须确认目标交易员都已停止;若存在运行中的交易员,不能删除,应要求用户先停止这些交易员。"
|
||||
],
|
||||
"success_output": "返回删除成功结果,并明确告知该交易员已被移除。",
|
||||
"failure_output": "明确指出缺少确认、目标交易员不存在,或删除失败原因。"
|
||||
"success_output": "返回删除成功结果,并明确告知哪些交易员已被移除。",
|
||||
"failure_output": "明确指出缺少确认、目标交易员不存在、目标仍在运行,或删除失败原因。"
|
||||
},
|
||||
"query_list": {
|
||||
"description": "查询所有交易员列表,包含名称、运行状态、绑定信息。",
|
||||
@@ -256,7 +208,6 @@
|
||||
"tool_mapping": {
|
||||
"create": "manage_trader:create",
|
||||
"update": "manage_trader:update",
|
||||
"update_name": "manage_trader:update",
|
||||
"update_bindings": "manage_trader:update",
|
||||
"configure_strategy": "manage_trader:update",
|
||||
"configure_exchange": "manage_trader:update",
|
||||
|
||||
Reference in New Issue
Block a user