pine_get_status
Retrieve the current emulator state to determine if it is running, paused, shutdown, or unknown.
Instructions
Get the current emulator state: 'running', 'paused', 'shutdown', or 'unknown'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:31-35 (schema)Tool definition (inputSchema) for pine_get_status. No inputs required; describes returning one of 'running', 'paused', 'shutdown', or 'unknown'.
{ name: "pine_get_status", description: "Get the current emulator state: 'running', 'paused', 'shutdown', or 'unknown'.", inputSchema: { type: "object", properties: {} }, }, - src/tools.ts:202-204 (handler)Handler for pine_get_status: calls pine.getStatus() and returns the status string.
case "pine_get_status": { return ok(`Status: ${await pine.getStatus()}`); } - src/tools.ts:171-175 (registration)The registerTools function (called from index.ts) sets up the ListTools/ CallTool request handlers that dispatch to the pine_get_status case.
export function registerTools(server: Server, pine: PineClient): void { server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: TOOLS })); server.setRequestHandler(CallToolRequestSchema, async (req) => { const { name, arguments: args = {} } = req.params; - src/pine.ts:283-287 (helper)The getStatus() method on PineClient sends opcode 0x0F (Status) over the PINE protocol and decodes the u32 reply: 0→'running', 1→'paused', 2→'shutdown', else→'unknown'.
async getStatus(): Promise<EmuStatus> { const r = await this.call(Op.Status); const s = r.readUInt32LE(0); return s === 0 ? "running" : s === 1 ? "paused" : s === 2 ? "shutdown" : "unknown"; } - src/pine.ts:283-286 (helper)The EmuStatus type and Op.Status constant used by getStatus()
async getStatus(): Promise<EmuStatus> { const r = await this.call(Op.Status); const s = r.readUInt32LE(0); return s === 0 ? "running" : s === 1 ? "paused" : s === 2 ? "shutdown" : "unknown";