import { createPromptSuggestionService } from "../../src/chat/prompt-suggestions.js"; import { config } from "../../src/config.js"; import { OpencodeRuntimeAdapter } from "../../src/runtime/opencode.js"; // Opt-in feature smoke: one real inference, no persisted chat or business tools. const runtime = new OpencodeRuntimeAdapter(); try { const generate = createPromptSuggestionService(runtime); const result = await generate({ actorKey: "suggestion-smoke", projectKey: "suggestion-smoke", projectId: "suggestion-smoke", userId: "suggestion-smoke", network: "supply", traceId: "suggestion-smoke" }, { activities: [{ id: "demo:pressure", kind: "task", title: "演示压力监测数据核查", occurred_at: new Date().toISOString(), summary: "仅为功能验证的演示活动,不代表真实告警。", origin: "demo", status: "pending" }], }, config.OPENCODE_MODEL); console.log(JSON.stringify({ model: config.OPENCODE_MODEL, count: result.suggestions.length, questions: result.suggestions.map((item) => item.question) })); } finally { await runtime.dispose(); }