export { isRecord, unwrapEnvelope } from "../../utils/response.js"; export declare const ACTION_DECISION_SCHEMA: { readonly type: "object"; readonly properties: { readonly execute: { readonly type: "boolean"; }; readonly confidence: { readonly type: "integer"; readonly minimum: 1; readonly maximum: 10; }; readonly reasoning: { readonly type: "string"; }; readonly actionType: { readonly type: "string"; }; readonly payload: { readonly type: "object"; }; }; readonly required: readonly ["execute", "confidence", "reasoning"]; }; export declare const SYSTEM_PROMPT = "You are a trading decision engine. Analyze the provided context and decide whether to execute the requested trading action.\n\nRespond with a JSON object:\n- execute (boolean): whether the action should proceed\n- confidence (integer 1\u201310): how confident you are\n- reasoning (string): concise explanation of your decision\n- actionType (string): the action type being evaluated\n- payload (object): action-specific fields. For OPEN_POSITION, payload.signals is an array where each signal has: asset (string), direction (\"LONG\"|\"SHORT\"), reason (string). Optionally include \"leverage\" (number, your recommended leverage) and \"margin\" (number, $ margin amount) per signal if you have conviction about position sizing."; /** * Extract a decision object from the llm-task response. * * Handles multiple response shapes the gateway may return: * 1. `{ json: { execute, ... }, usage }` — structured output (preferred) * 2. `{ execute, confidence, ... }` — decision at top level * 3. `{ details: { json: { execute, ... } }, content }` — gateway /tools/invoke * 4. `{ content: [{ type:"text", text:"{ ... }" }] }` — text fallback in content array * 5. `{ text: "{ ... }", usage }` — flat text fallback with embedded JSON * 6. `{ result: { ... }, usage }` — result-wrapped variant */ export declare function extractDecision(raw: unknown): { decision: T; tokensUsed: number; }; //# sourceMappingURL=shared.d.ts.map