import assert from "node:assert/strict" import {assertOwnedBandwidthSql,prepareOwnedBandwidthState} from "../../services/bandwidth-admission-process.sql-helper.js" assertOwnedBandwidthSql();await prepareOwnedBandwidthState() const {pool,closePool}=await import("../../db/index.js") const {applySqlMigrations}=await import("../../db/migrate.js") const ownIds:number[]=[] try{ await applySqlMigrations(pool) for(let index=0;index<3;index++)ownIds.push(Number((await pool.query("INSERT INTO public.servers(name,host,enabled) VALUES('owned-service-origin','127.0.0.1',false) RETURNING id")).rows[0].id)) const {acceptBandwidthServiceContextSql}=await import("./bandwidth-service-context.sql-helper.js") const result=await acceptBandwidthServiceContextSql(ownIds) assert.equal(result.flows,2);assert.equal(result.verifiedServiceSteps,4);assert.equal(result.currentPlanChecks,12);assert.equal(result.rejectedPlanChanges,8) console.log("Owned MCP service origin: "+JSON.stringify(result)) }finally{ try{if(ownIds.length)await pool.query("DELETE FROM public.servers WHERE id=ANY($1::bigint[])",[ownIds])} finally{await closePool()} }