{ "openapi": "3.0.0", "info": { "title": "HXOPS Agent Runtime Context Tools", "version": "1.0.0", "description": "HXOPS 平台运行态上下文只读解析工具。Dify 应在需要读取 session、task、batch、run purpose、state_hint 或模糊指代线索时调用本工具;遇到“继续”“刚才那个”“上一个失败的”等表达时,应优先读取 reference_context。若只需要 focus id、last action 或 failure reason,可优先读取 reference_context 的细粒度字段,减少上下文判断分支。若 reference_context 返回多个 candidates(多候选),不要猜测,应追问用户或调用业务 Tool 再确认。reference_context 与 state_hint 都只是提示,不是业务事实源,也不能替代 HXOPS 状态机。推进业务状态必须调用对应业务 Tool,不能依据上下文直接宣布完成、上传成功或任务关闭。鉴权:Authorization Bearer 或 X-Integration-Key。" }, "servers": [ { "url": "http://192.168.36.108:5052/api/agent-runtime-context" } ], "paths": { "/tools/parse": { "post": { "operationId": "parse_agent_runtime_context", "summary": "解析 HXOPS agent_runtime_context 中的白名单字段", "description": "只读解析工具;agent_runtime_context 应为 Dify Start 节点中的 JSON 字符串。paths 最多 20 个,且必须属于 allowed_paths。推荐优先读取 reference_context.focus_object.id、reference_context.last_action_target.action、reference_context.last_failed_target.reason 等细粒度字段,降低提示词中的对象拆解成本。模糊指代建议优先读取 reference_context;若拿到多个 candidates(多候选),必须追问或回到业务 Tool 校验,禁止自行猜测推进。reference_context/state_hint 仅用于理解当前现场,不能替代状态机事实,更不能据此直接推进业务或宣布完成。", "parameters": [], "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "required": [ "agent_runtime_context", "paths" ], "properties": { "agent_runtime_context": { "type": "string", "description": "Dify Start 变量 agent_runtime_context 的 JSON 字符串。其中 reference_context 仅用于辅助理解当前现场,不可替代 HXOPS 业务事实源。" }, "paths": { "type": "array", "description": "需要读取的字段路径。", "maxItems": 20, "items": { "type": "string", "enum": [ "agent_code", "context_id", "domain.state_hint.batch_no", "domain.state_hint.current_step", "domain.state_hint.focus_task_no", "domain.state_hint.match_status", "domain.state_hint.pending_human_reason", "domain.state_hint.review_status", "domain.state_hint.status", "domain.state_hint.upload_status", "domain.summary", "domain.type", "platform.locale", "platform.parent_session_id", "platform.request_id", "platform.session_id", "platform.trigger_source", "reference_context.candidates", "reference_context.focus_object", "reference_context.focus_object.id", "reference_context.focus_object.type", "reference_context.last_action_target", "reference_context.last_action_target.action", "reference_context.last_action_target.id", "reference_context.last_failed_target", "reference_context.last_failed_target.id", "reference_context.last_failed_target.reason", "reference_context.recent_activity_summary", "refs.batch_no", "refs.file_name", "refs.run_purpose", "refs.schedule_task_id", "refs.task_no", "schema_version", "scope" ] } } } } } } }, "responses": { "200": { "description": "Parse response", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string", "enum": [ "ok" ] }, "data": { "type": "object", "additionalProperties": true }, "missing": { "type": "array", "items": { "type": "string" } } } } } } } } } } } }