feat(web): annotation result copy matches policy-driven ingestion

Saved strategies now report intents/fetch/planned/blocked counts and point at
解析监控 → 待入库; the blocked note explains the 需下架 lane instead of the
deprecated snapshot-diff confirmation step.
This commit is contained in:
姚章浩
2026-09-13 22:25:19 +08:00
parent 63f3b2c503
commit fad8b10247
4 changed files with 11 additions and 10 deletions
+2 -2
View File
@@ -78,7 +78,7 @@ export async function fetchAllCatalogFolders(connectionID:string,parentID:string
export interface CatalogRoutingCapabilities{internal_enabled:boolean;external_enabled:boolean}
export interface CatalogRouteInput{connection_id:string;node_ids:string[];policy:CatalogPolicy;reason:string}
export interface CatalogRouteResult{selected_files:number;routable_files:number;unbound_files:number;hash_unknown_files:number;unavailable_files:number}
export interface CatalogRouteResult{selected_files:number;intents_recorded:number;fetch_queued:number;planned_publications:number;blocked_items:number;unbound_files:number}
export async function fetchCatalogRoutingCapabilities(signal?:AbortSignal):Promise<CatalogRoutingCapabilities>{
const response=await fetch('/api/v1/source-catalog/routing-capabilities',{headers:{Accept:'application/json'},signal});if(!response.ok)throw new Error(`加载分流配置失败(HTTP ${response.status})`)
@@ -87,7 +87,7 @@ export async function fetchCatalogRoutingCapabilities(signal?:AbortSignal):Promi
}
export async function routeCatalogFiles(input:CatalogRouteInput):Promise<CatalogRouteResult>{
const response=await fetch('/api/v1/source-catalog/route',{method:'POST',headers:{Accept:'application/json','Content-Type':'application/json','Idempotency-Key':newOperationID()},body:JSON.stringify(input)});if(!response.ok)throw new Error(response.status===503?'对内/对外知识库尚未配置':`处理策略保存失败(HTTP ${response.status})`)
const value=await response.json() as unknown;if(!record(value)||!record(value.data)||!count(value.data.selected_files)||!count(value.data.routable_files)||!count(value.data.unbound_files)||!count(value.data.hash_unknown_files)||!count(value.data.unavailable_files))throw new Error('文件处理响应无效')
const value=await response.json() as unknown;if(!record(value)||!record(value.data)||!count(value.data.selected_files)||!count(value.data.intents_recorded)||!count(value.data.fetch_queued)||!count(value.data.planned_publications)||!count(value.data.blocked_items)||!count(value.data.unbound_files))throw new Error('文件处理响应无效')
return value.data as unknown as CatalogRouteResult
}
export async function triggerCatalogRefresh(connectionID:string):Promise<Job>{