Move project and host queries into native MCP with host-owned OAuth/context, while retaining memory, skills, actions and publication plugins. Add nearby-model queries and explicit chat/task/learning model defaults. Adopt Responses HTTP/SSE and native steer/queue inbox delivery, preserving scoped session ownership, pending input edits and investigation communication. Disable local-provider discovery: Server /health allowed native vLLM to probe /v1/models on port 8000. A native before/after regression prevents recurrence. Validation: 170 focused Bun tests; service/plugin typechecks; native discovery, provider-discovery and input-inbox smoke checks; no paid model inference.
16 lines
1.1 KiB
TypeScript
16 lines
1.1 KiB
TypeScript
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();
|
|
}
|