feat(agent): add frontend action bridge
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
export const FRONTEND_ACTION_VERSION = "frontend-action@1" as const;
|
||||
export const FRONTEND_ACTION_RESULT_VERSION = "frontend-action-result@1" as const;
|
||||
|
||||
export type FrontendActionRisk = "view" | "reversible" | "side_effect";
|
||||
export type FrontendActionStatus = "succeeded" | "failed" | "rejected" | "cancelled" | "expired";
|
||||
|
||||
export type FrontendActionRequest = {
|
||||
version: typeof FRONTEND_ACTION_VERSION;
|
||||
actionId: string;
|
||||
toolCallId: string;
|
||||
sessionId: string;
|
||||
name: string;
|
||||
params: unknown;
|
||||
risk: FrontendActionRisk;
|
||||
replayPolicy: "never" | "explicit";
|
||||
issuedAt: number;
|
||||
expiresAt: number;
|
||||
fallbackText?: string;
|
||||
replayOf?: string;
|
||||
};
|
||||
|
||||
export type FrontendActionResult = {
|
||||
version: typeof FRONTEND_ACTION_RESULT_VERSION;
|
||||
actionId: string;
|
||||
status: FrontendActionStatus;
|
||||
output?: unknown;
|
||||
error?: { code: string; message: string };
|
||||
completedAt: number;
|
||||
};
|
||||
|
||||
export type FrontendActionManifest = {
|
||||
id: string;
|
||||
version: typeof FRONTEND_ACTION_VERSION;
|
||||
risk: FrontendActionRisk;
|
||||
timeoutMs: number;
|
||||
supportedSurfaces: ["map_overlay"] | ["side_panel", "canvas"];
|
||||
};
|
||||
Reference in New Issue
Block a user