feat: upgrade investigation and presentation runtime
Generic Container CI/CD / test-build-publish (push) Successful in 1m6s
Agent CI/CD / build-test-publish-and-deploy (push) Successful in 1m7s

This commit is contained in:
2026-10-30 17:30:19 +08:00
parent 3b52a0ddab
commit 6336157ff4
104 changed files with 6541 additions and 961 deletions
+4 -6
View File
@@ -6,14 +6,13 @@ type FrontendActionArgs = Record<string, unknown> & {
};
type FrontendActionBridgeResult = {
version: "frontend-action-result@1";
version: "frontend-action-result@2";
status: "succeeded" | "failed" | "rejected" | "cancelled" | "expired";
output?: unknown;
error?: { code?: string; message?: string };
};
export const executeFrontendAction = async (
name: "render_scada_analysis" | "clear_scada_analysis" | "locate_features" | "zoom_to_map" | "show_chart" | "view_history",
args: FrontendActionArgs,
context: { sessionID: string; callID?: string },
) => {
@@ -22,7 +21,7 @@ export const executeFrontendAction = async (
if (!callId) {
throw new Error("frontend action bridge did not inject the OpenCode call ID");
}
const { __frontend_action_call_id: _callId, reason, ...params } = args;
const { __frontend_action_call_id: _callId, reason, command } = args;
let response: Response;
try {
response = await fetch(`${internalBaseUrl}/internal/frontend-actions/request`, {
@@ -34,8 +33,7 @@ export const executeFrontendAction = async (
body: JSON.stringify({
session_id: context.sessionID,
call_id: callId,
name,
params,
command,
fallback_text: reason,
}),
});
@@ -60,7 +58,7 @@ export const unwrapFrontendActionResult = (text: string) => {
} catch {
throw new Error("frontend action bridge returned invalid JSON");
}
if (result.version !== "frontend-action-result@1" || typeof result.status !== "string") {
if (result.version !== "frontend-action-result@2" || typeof result.status !== "string") {
throw new Error("frontend action bridge returned an invalid result");
}
if (result.status !== "succeeded") {