#!/usr/bin/env node /** * Verify v1.49 exposes Portal session-reconcile REST routes. */ import { createV149Client } from './goose-v149-sse.mjs'; const client = createV149Client(); const workingDir = process.env.GOOSE_V149_WORKING_DIR || process.cwd(); async function main() { const session = await client.apiJson('/agent/start', { working_dir: workingDir }); if (!session?.id) throw new Error('missing session id'); const getRes = await client.apiFetch(`/sessions/${session.id}`, { method: 'GET' }); if (!getRes.ok) { throw new Error(`GET /sessions/{id} ${getRes.status}`); } const addRes = await client.apiFetch('/agent/add_extension', { method: 'POST', body: JSON.stringify({ session_id: session.id, config: { type: 'platform', name: 'web', description: 'compat probe', display_name: 'web', bundled: false, available_tools: ['web_search'], }, }), }); if (!addRes.ok) { const text = await addRes.text(); throw new Error(`add_extension probe ${addRes.status}: ${text.slice(0, 200)}`); } console.log(`GOOSE_V149_SESSION_RECONCILE_OK: session=${session.id} routes=GET /sessions/{id}, POST /agent/add_extension`); } main().catch((error) => { console.error(`GOOSE_V149_SESSION_RECONCILE_FAIL: ${error.message}`); process.exit(1); });