{"openapi":"3.1.0","info":{"title":"Universal Court Judgment Skill API","version":"0.4.0","description":"Loads the portable skill and routes searches to Fyopen or a local Wenshu browser bridge."},"servers":[{"url":"https://china-court-judgment-skill.pages.dev"}],"paths":{"/health":{"get":{"operationId":"healthCheck","responses":{"200":{"description":"Healthy"}}}},"/skills/search-china-court-judgments":{"get":{"operationId":"loadJudgmentSkill","responses":{"200":{"description":"Skill manifest and instructions","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/judgments/search":{"post":{"operationId":"searchJudgments","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JudgmentSearchInput"}}}},"responses":{"200":{"description":"Search results or a compliant manual search plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JudgmentSearchResult"}}}},"400":{"description":"Invalid request"},"502":{"description":"Configured provider failed"}}}},"/v1/browser/pending":{"get":{"operationId":"getPendingBrowserSearch","description":"Local bridge endpoint used by the Browser Helper.","responses":{"200":{"description":"Pending task or idle"}}}},"/v1/browser/results":{"post":{"operationId":"submitBrowserSearchResults","description":"Local bridge endpoint used to submit visible page results.","responses":{"202":{"description":"Results accepted"}}}}},"components":{"schemas":{"JudgmentSearchInput":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://example.local/schemas/search-input.schema.json","title":"JudgmentSearchInput","type":"object","properties":{"query":{"type":"string","description":"Natural-language research question."},"case_number":{"type":"string"},"parties":{"type":"array","items":{"type":"string"},"maxItems":10},"keywords":{"type":"array","items":{"type":"string"},"maxItems":20},"cause":{"type":"string"},"case_type":{"enum":["civil","criminal","administrative","compensation","enforcement","other"]},"court":{"type":"string"},"court_level":{"type":"string"},"region":{"type":"string"},"date_from":{"type":"string","format":"date"},"date_to":{"type":"string","format":"date"},"procedure":{"type":"string"},"limit":{"type":"integer","minimum":1,"maximum":50,"default":10},"require_official_source":{"type":"boolean","default":true},"provider":{"enum":["auto","fyopen","wenshu_web"],"default":"auto","description":"Provider selection. fyopen requires server credentials; wenshu_web requires a local browser bridge."},"fyopen_service":{"enum":["expert_view","practice"],"default":"expert_view","description":"Fyopen service: adjudication viewpoints or practical research knowledge."},"resume_token":{"type":"string","description":"Token returned by a browser-assisted search."}},"anyOf":[{"required":["query"]},{"required":["case_number"]},{"required":["parties"]},{"required":["keywords"]},{"required":["cause"]},{"required":["court"]},{"required":["resume_token"]}],"additionalProperties":false},"JudgmentSearchResult":{"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://example.local/schemas/case-result.schema.json","title":"JudgmentSearchResult","type":"object","required":["status","search_date","filters","cases","limitations"],"properties":{"status":{"enum":["ok","partial","manual_search_required","manual_verification_required","error"]},"provider":{"type":"string"},"search_date":{"type":"string","format":"date"},"filters":{"type":"object"},"cases":{"type":"array","items":{"type":"object","required":["title","case_number","court","decision_date","result","key_points","source_url","verified"],"properties":{"title":{"type":"string"},"case_number":{"type":"string"},"court":{"type":"string"},"decision_date":{"type":"string"},"case_type":{"type":"string"},"cause":{"type":"string"},"parties":{"type":"array","items":{"type":"string"}},"result":{"type":"string"},"key_points":{"type":"array","items":{"type":"string"}},"source_url":{"type":"string","format":"uri"},"source_tier":{"enum":["official","secondary"]},"verified":{"type":"boolean"}},"additionalProperties":false}},"provider_hits":{"type":"array","items":{"type":"object","required":["title","content","case_number","source_url"],"properties":{"title":{"type":"string"},"content":{"type":"string"},"case_number":{"type":"string"},"source_url":{"type":"string","format":"uri"}},"additionalProperties":false}},"limitations":{"type":"array","items":{"type":"string"}},"search_plan":{"type":"array","items":{"type":"string"}},"sources":{"type":"array","items":{"type":"string","format":"uri"}},"resume_token":{"type":"string"},"browser_url":{"type":"string","format":"uri"},"next_action":{"type":"string"}},"additionalProperties":false}}}}