DRONE_COMMS_LINK // SECURE
DRONE_UNIT_734 ONLINE. AWAITING COMMANDS, AGENT.
SCRIPTING_MODULE // JS_RUNTIME
Define handleMessage(msg, res) to control drone responses. Use res(text) to reply or res.tool(name, args) to invoke tools.
Agent Web was traveling with an autonomous reconnaissance drone (DRONE_UNIT_734) that remained intact at the crime scene. Your first task is to establish basic communication with the drone's AI system.
Part 1 Goal: Make a basic API call (without tools) and ask the drone about its location. The drone will respond with encoded location data that you must decode.
Part 1 Requirements:
POST /api/v1/ai/chatmessages array (just like ChatGPT API)💡 Hint: The drone will include something like "LOCATION_SCAN: 57617265686F757365" in its response. You'll need to decode this hex string to plain text.
Now that you have basic communication, you need to access the drone's advanced analysis capabilities. The drone's CSI kit detected weapon evidence, but it can only reveal this data through its tool interface.
Part 2 Goal: Define a tool called analyze_evidence and make the AI call it to retrieve encoded weapon data.
Part 2 Requirements:
analyze_evidence (no parameters needed)tool_calls instead of textTool Schema Format:
{
type: "function",
function: {
name: "analyze_evidence",
description: "Analyze detected evidence",
parameters: { type: "object", properties: {} }
}
}💡 Hint: When the AI calls your tool, it will return arguments with an encoded_data field. Use atob() to decode Base64.
DRONE_UNIT_734 ONLINE. AWAITING COMMANDS, AGENT.
Define handleMessage(msg, res) to control drone responses. Use res(text) to reply or res.tool(name, args) to invoke tools.