feat(news): restrict research to local sources and process frozen batches
Development CI / check-and-build (push) Successful in 3m23s
GitHub Git mirror / mirror (push) Successful in 6s
Development CI / deploy-development (push) Successful in 5s

This commit is contained in:
eezd committed 2026-11-05 20:43:31 +08:00
1 parent d79a10c2e6
commit 89da4df785
28 files changed
+360 -409

No files matched your search

+2 -1
View File
@@ -1,7 +1,8 @@
export interface Keyword { canonical: string, aliases: string[], quote: string }
export interface ModelConfig { provider_id: number | null, model: string, reasoning_effort: string | null, skill_id: number | null }
export interface Config { index: ModelConfig, research: ModelConfig, concurrency: number }
export interface Settings { config: Partial<Config>, enabled: boolean, start_at: string }
export interface BatchProgress { id: number, phase: string, cutoff_at: string, packages_total: number, packages_done: number, packages_failed: number, packages_deferred: number, events_total: number, events_done: number, events_failed: number, events_deferred: number }
export interface Settings { batch?: BatchProgress | null, config: Partial<Config>, enabled: boolean, start_at: string }
export interface Package { id: number, news_id: number, title: string, url: string, state: string, error: string | null, keywords: Keyword[], events: { id: number, title: string, reason: string, quote: string }[] }
export interface Point { time_precision: "minute" | "day" | "month" | "unknown", planned_precision: "minute" | "day" | "month" | "unknown", package_ids: number[], time_text: string, description: string, occurred_at: string | null, planned_at: string | null, reported_at: string | null, period_text: string, evidence_refs: { article_id: number, quote: string }[] }
export interface Result { title: string, summary: string, facts: string, reasoning: string, uncertainty: string, opinions: string, counter_evidence: string, watchpoints: string, asset_impacts: string, importance_stars: number, risk_stars: number, confidence: string, verification: string, timeline_points: Point[] }
+10 -1
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import type { Config, Event, EventDetail, Package, PackageDetail, VersionDetail, Vocabulary } from "@@/apis/news-research/type"
import type { BatchProgress, Config, Event, EventDetail, Package, PackageDetail, VersionDetail, Vocabulary } from "@@/apis/news-research/type"
import type { Provider } from "@@/apis/settings/type"
import type { SkillNode } from "@@/apis/skills/type"
import * as api from "@@/apis/news-research"
@@ -88,6 +88,8 @@ const opened = ref(false)
const packageOpened = ref(false)
const settingsOpened = ref(false)
const enabled = ref(false)
const batch = ref<BatchProgress | null>(null)
const batchPhases: Record<string, string> = { assigning: "索引与归属中", researching: "集中研究中", done: "已完成", partial: "部分失败或延期" }
const loading = ref(false)
const error = ref(false)
const busy = ref(false)
@@ -120,6 +122,7 @@ async function load() {
const [settings, rows] = await Promise.all([api.getSettingsApi(), tab.value === "events" ? api.listEventsApi(q.value, page.value) : api.listPackagesApi(q.value, page.value)])
if (!valid() || seq !== sequence) return
enabled.value = settings.enabled
batch.value = settings.batch ?? null
if (tab.value === "events") events.value = rows.items as Event[]
else packages.value = rows.items as Package[]
total.value = rows.total
@@ -324,6 +327,12 @@ onBeforeUnmount(() => {
<p class="mb-4 text-sm text-slate-500">
新闻包保存原文和关键词;事件汇集相关报道,持续更新判断与时间线。
</p>
<p v-if="batch" class="mb-4 text-sm text-slate-500">
批次 #{{ batch.id }} · {{ batchPhases[batch.phase] ?? batch.phase }} ·
新闻归属 {{ batch.packages_done }}/{{ batch.packages_total }},失败 {{ batch.packages_failed }},延期 {{ batch.packages_deferred }} ·
事件研究 {{ batch.events_done }}/{{ batch.events_total }},失败 {{ batch.events_failed }},延期 {{ batch.events_deferred }}。
新新闻和重试请求排入下一批,研究仅使用站内资料。
</p>
<el-alert v-if="error" title="读取失败,保留上次结果,可刷新重试" type="error" :closable="false" />
<div class="mb-4 flex flex-wrap gap-3">
<el-input v-model="q" clearable placeholder="搜索名称、规范关键词或原文别名" class="max-w-md" />