mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-14 23:26:39 +03:00
Preserve experimental Live app-server workstream
Snapshot the current app-server implementation, shared Live optimizations, generated harness output, and in-progress site work before restoring polling as the primary runtime path. Prepared with Codex assistance under maintainer direction.
This commit is contained in:
@@ -1518,7 +1518,16 @@ async function publishSourceVariants({ tmp, wrapInfo, event, output }) {
|
||||
return published;
|
||||
}
|
||||
|
||||
async function publishVariantProgress({ base, token, event, wrapInfo, arrivedVariants, signal }) {
|
||||
async function publishVariantProgress({
|
||||
base,
|
||||
token,
|
||||
event,
|
||||
wrapInfo,
|
||||
arrivedVariants,
|
||||
signal,
|
||||
revision = 1,
|
||||
publicationKind = 'variants',
|
||||
}) {
|
||||
const previewMode = wrapInfo.previewMode || 'source';
|
||||
await fetch(`${base}/events`, {
|
||||
method: 'POST',
|
||||
@@ -1527,7 +1536,8 @@ async function publishVariantProgress({ base, token, event, wrapInfo, arrivedVar
|
||||
token,
|
||||
type: 'checkpoint',
|
||||
id: event.id,
|
||||
revision: 1,
|
||||
revision,
|
||||
revisionDomain: 'publication',
|
||||
phase: 'cycling',
|
||||
reason: 'variants_progress',
|
||||
arrivedVariants,
|
||||
@@ -1535,6 +1545,7 @@ async function publishVariantProgress({ base, token, event, wrapInfo, arrivedVar
|
||||
sourceFile: wrapInfo.sourceFile || wrapInfo.file,
|
||||
previewFile: wrapInfo.file,
|
||||
previewMode,
|
||||
publicationKind,
|
||||
}),
|
||||
signal,
|
||||
});
|
||||
@@ -1897,6 +1908,18 @@ export async function runAgentLoop({
|
||||
await spliceVariantsIntoWrapper({ tmp, wrapInfo, sessionId: event.id, output });
|
||||
}
|
||||
trace('agent.write.end', { id: event.id, file: wrapInfo.file });
|
||||
if (progressive) {
|
||||
await publishVariantProgress({
|
||||
base,
|
||||
token,
|
||||
event,
|
||||
wrapInfo,
|
||||
arrivedVariants: output.variants.length,
|
||||
signal,
|
||||
revision: 2,
|
||||
publicationKind: 'params',
|
||||
});
|
||||
}
|
||||
if (process.env.IMPECCABLE_E2E_DEBUG) {
|
||||
const post = await fs.readFile(path.join(tmp, wrapInfo.file), 'utf-8');
|
||||
log(`--- post-splice (variants written) ---\n${post}`);
|
||||
|
||||
@@ -432,7 +432,7 @@ export async function pickElement(page, selector, opts = {}) {
|
||||
const bar = query(barSel);
|
||||
const pick = query(pickSel);
|
||||
return {
|
||||
liveState: document.documentElement.dataset.impeccableLiveState || null,
|
||||
liveState: window.__IMPECCABLE_LIVE_STATE__ || null,
|
||||
target: target ? { tag: target.tagName, classes: target.className, rect: rect?.toJSON?.() || null } : null,
|
||||
hit: hit ? { tag: hit.tagName, classes: hit.className, text: (hit.textContent || '').slice(0, 80) } : null,
|
||||
pickActive: pick?.dataset.active || null,
|
||||
|
||||
Reference in New Issue
Block a user