SOURCE / PINNED RELEASE
Made of little things.
Funclet
- Release
- 0b497cfc2f66…
- Author-recorded commit
- 1e531b24f490…
- License
- LICENSE
- Author’s source reference
- nostr://npub182jczunncwe0jn6frpqwq3e0qjws7yqqnc3auccqv9nte2dnd63scjm4rf/wss%3A%2F%2Fgit.napplet.soy%2F/n-6b7a37cac1d
Archive hash verified: 71d97a89ed8c40c2…. The source-to-build association is the author’s claim; it has not been independently rebuilt.
// Real HTTP station discovery and HTTPS LINK handoff. Use an owned soyli dev URL.
import assert from 'node:assert/strict';
import { realpathSync, mkdirSync, writeFileSync } from 'node:fs';
import { createRequire } from 'node:module';
import { execFileSync } from 'node:child_process';
const url=process.argv[2];
assert.ok(url?.startsWith('http://127.0.0.1:'),'Pass the printed soyli dev URL');
const require=createRequire(`${realpathSync('node_modules/@napplet/conformance-cli')}/package.json`);
const {chromium}=require('playwright');
const bins=JSON.parse(execFileSync('soyli',['browser','path','--json'],{encoding:'utf8'}));
const browser=await chromium.launch({executablePath:bins.executables.find(x=>x.installed&&x.name.startsWith('chromium')).path});
mkdirSync('.napplet-space/testing',{recursive:true});
try {
const context=await browser.newContext({viewport:{width:1220,height:970},hasTouch:true});
const page=await context.newPage();const errors=[];page.on('pageerror',e=>errors.push(e.message));
await page.goto(url);const frame=page.frameLocator('iframe').first();
await frame.locator('#search').waitFor({timeout:20000});
await frame.locator('#search').fill('IDM Ambient');await frame.locator('#search-submit').tap();
await frame.getByRole('button',{name:'External stream options for IDM Ambient',exact:true}).tap();
const panel=frame.locator('#results .station-fallback');
assert.match(await panel.textContent(),/uses HTTP/);
const stream=await panel.getByRole('textbox').inputValue();assert.equal(stream,'http://213.141.131.10:8000/idmambient');
assert.equal(await frame.locator('#playback-label').textContent(),'OFF AIR');
const action=panel.getByRole('button',{name:'Open IDM Ambient in Wavefunc',exact:true});
await action.tap();const prompt=page.locator('#prompt');await prompt.waitFor({state:'visible'});
assert.match(await prompt.innerText(),/https:\/\/wavefunc.live\/station\/[a-f0-9]{64}/);
await prompt.getByRole('button',{name:'Cancel',exact:true}).tap();
await panel.getByRole('status').filter({hasText:'did not open'}).waitFor();
await prompt.waitFor({state:'hidden'});
await action.tap();await prompt.waitFor({state:'visible'});
const externalUrl=(await prompt.innerText()).match(/https:\/\/wavefunc.live\/station\/[a-f0-9]{64}/)[0];
const [destination]=await Promise.all([
context.waitForEvent('page'),
prompt.getByRole('link',{name:'Open link',exact:true}).tap(),
]);
await panel.getByRole('status').filter({hasText:'Opened in Wavefunc'}).waitFor();
await destination.waitForLoadState('domcontentloaded');
assert.equal(destination.url(),externalUrl);
await destination.getByText('IDM Ambient',{exact:true}).first().waitFor({timeout:30000});
await destination.close();
const sizes=[];
for(const [width,height] of [[200,160],[320,560],[900,600],[1440,900],[390,844],[360,640],[844,390]]) {
await page.setViewportSize({width:Math.max(width+20,400),height:height+220});
await page.locator('iframe').first().evaluate((el,size)=>{el.style.width=`${size[0]}px`;el.style.height=`${size[1]}px`;el.style.minHeight='0';el.style.flex='none';},[width,height]);
const actual=await frame.locator('body').evaluate(()=>({width:innerWidth,height:innerHeight,overflow:document.documentElement.scrollWidth>innerWidth}));
assert.equal(actual.width,width);assert.equal(actual.height,height);assert.equal(actual.overflow,false);
if(width!==200){await action.scrollIntoViewIfNeeded();const box=await action.boundingBox();assert.ok(box.height>=44);await panel.getByRole('textbox').scrollIntoViewIfNeeded();}
await page.locator('iframe').first().screenshot({path:`.napplet-space/testing/http-${width}x${height}.png`});sizes.push(actual);
}
assert.deepEqual(errors,[]);
writeFileSync('.napplet-space/testing/external-host-report.json',JSON.stringify({passed:true,stream,externalUrl,stationFound:true,sizes,errors},null,2));
console.log('PASS: live HTTP detection, host cancel/open, Wavefunc destination station and all responsive sizes');
} finally {await browser.close();}
