#!/usr/bin/env node /** * Verify v1.49 exposes POST /config/read (Portal readConfig contract). */ import { createV149Client } from './goose-v149-sse.mjs'; const client = createV149Client(); async function readKey(key, isSecret = false) { const body = await client.apiJson('/config/read', { key, is_secret: isSecret }); return body; } async function main() { const provider = await readKey('GOOSE_PROVIDER'); const model = await readKey('GOOSE_MODEL'); const missing = await readKey('__goose_v149_config_read_missing_probe__'); if (missing !== null) { throw new Error(`missing key should return null, got ${JSON.stringify(missing)}`); } console.log( `GOOSE_V149_CONFIG_READ_OK: provider=${JSON.stringify(provider)} model=${JSON.stringify(model)}`, ); } main().catch((error) => { console.error(`GOOSE_V149_CONFIG_READ_FAIL: ${error.message}`); process.exit(1); });