56 lines
4.4 KiB
JSON
56 lines
4.4 KiB
JSON
{
|
|
"_meta": {
|
|
"description": "D6 fixtures for langgraph-python / gen-ui-open-advanced",
|
|
"sourceFile": "harness/fixtures/d5/gen-ui-open.json (advanced pills)",
|
|
"copiedFrom": "langgraph-typescript (canonical sandboxed-UI jsFunctions)",
|
|
"note": "Sandboxed-UI jsFunctions copied verbatim from langgraph-typescript so the calculator keypad+= and host-ping button wire to the iframe<->host bridge. The 'Inline expression evaluator' pill is NOT duplicated here — it already lives in gen-ui-open.json (same context, identical generateSandboxedUi arguments + its own tool-result follow-up), so this file only supplies the otherwise-missing Calculator and Ping pills.",
|
|
"created": "2026-05-22"
|
|
},
|
|
"fixtures": [
|
|
{
|
|
"_comment": "gen-ui-open-advanced: Calculator pill — generateSandboxedUi with jsFunctions wiring for evaluateExpression host callback.",
|
|
"match": {
|
|
"userMessage": "Calculator (calls evaluateExpression)",
|
|
"hasToolResult": false,
|
|
"context": "langgraph-python"
|
|
},
|
|
"response": {
|
|
"toolCalls": [
|
|
{
|
|
"id": "call_d5_open_gen_ui_calc_001",
|
|
"name": "generateSandboxedUi",
|
|
"arguments": "{\"initialHeight\":480,\"placeholderMessages\":[\"Composing calculator UI…\"],\"css\":\"body{margin:0;font-family:system-ui;background:#0f172a;color:#e2e8f0}.wrap{padding:16px;max-width:240px}.display{background:#1e293b;padding:8px;border-radius:8px;margin-bottom:8px;font-family:monospace;text-align:right}.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}button{padding:10px;background:#334155;border:0;color:#e2e8f0;border-radius:6px;font-size:14px}\",\"html\":\"<div class=\\\"wrap\\\" data-testid=\\\"ogui-calculator\\\"><div class=\\\"display\\\" id=\\\"d\\\">0</div><div class=\\\"grid\\\"><button>7</button><button>8</button><button>9</button><button>+</button><button>4</button><button>5</button><button>6</button><button>-</button><button>1</button><button>2</button><button>3</button><button>*</button><button>0</button><button>.</button><button id=\\\"eq\\\">=</button><button>/</button></div></div>\",\"jsFunctions\":\"(function(){var expr='';var display=document.getElementById('d');document.querySelectorAll('.grid button').forEach(function(btn){btn.addEventListener('click',async function(){if(btn.id==='eq'){var res=await Websandbox.connection.remote.evaluateExpression({expression:expr});if(res&&res.ok){display.textContent=String(res.value);expr=String(res.value);}else{display.textContent='err';expr='';}}else{expr+=btn.textContent;display.textContent=expr;}});});})();\"}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"_comment": "gen-ui-open-advanced: Ping the host pill — generateSandboxedUi with notifyHost callback.",
|
|
"match": {
|
|
"userMessage": "Ping the host (calls notifyHost)",
|
|
"hasToolResult": false,
|
|
"context": "langgraph-python"
|
|
},
|
|
"response": {
|
|
"toolCalls": [
|
|
{
|
|
"id": "call_d5_open_gen_ui_ping_001",
|
|
"name": "generateSandboxedUi",
|
|
"arguments": "{\"initialHeight\":320,\"placeholderMessages\":[\"Composing host-ping card…\"],\"css\":\"body{margin:0;font-family:system-ui;background:#0f172a;color:#e2e8f0}.card{padding:24px;background:#1e293b;border-radius:12px;margin:16px;text-align:center}button{padding:10px 20px;background:#6366f1;border:0;color:#fff;border-radius:8px;font-size:14px;cursor:pointer}.out{margin-top:12px;font-size:12px;color:#94a3b8}\",\"html\":\"<div class=\\\"card\\\" data-testid=\\\"ogui-ping\\\"><h2>Notify the host</h2><button id=\\\"hi\\\">Say hi to the host</button><div class=\\\"out\\\" id=\\\"out\\\">awaiting click…</div></div>\",\"jsFunctions\":\"document.getElementById('hi').addEventListener('click',async function(){var out=document.getElementById('out');out.textContent='sending…';var res=await Websandbox.connection.remote.notifyHost({message:'Hello from sandbox'});out.textContent=res&&res.ok?'host replied at '+res.receivedAt:'failed';});\"}"
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"_comment": "gen-ui-open-advanced narration fallback.",
|
|
"match": {
|
|
"userMessage": "continue the advanced gen-ui flow",
|
|
"context": "langgraph-python"
|
|
},
|
|
"response": {
|
|
"content": "The advanced gen-UI flow continued with the second-step component. The chained payloads from turns 1 and 2 form the complete advanced gen-UI sequence."
|
|
}
|
|
}
|
|
]
|
|
}
|