INNER CODE UNIT · TypeScript

$rpcId

AmrDab/clawdcursor · src/surface/cli.ts:993

        $rpcId = $rpcId + 1
        $body = @{
            jsonrpc = '2.0'
            id      = $rpcId
            method  = 'tools/call'
            params  = @{ name = 'submit_task'; arguments = @{ task = $task } }
        } | ConvertTo-Json -Depth 6 -Compress
        $response = Invoke-RestMethod -Uri http://127.0.0.1:${opts.port}/mcp -Method POST -Headers $headers -Body $body
        if ($response.error) {
            Write-Host ("MCP error: " + ($response.error.message)) -ForegroundColor Red
        } elseif ($response.result -and $response.result.content) {
            foreach ($block in $response.result.content) {
                if ($block.type -eq 'text') { Write-Host $block.text }
            }
        } else {
            $response | ConvertTo-Json -Depth 5
        }
    } catch {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…