refactor(observer): v7 step-aware AG Native DOM parser with data-testid/data-step-index based content extraction

- Replace CSS class-based scanning with [data-testid='conversation-view'] + [data-step-index] traversal
- New extractCleanStepText(): clone-and-strip buttons/SVG/icons before text extraction
- New extractStepContext(): step-container-aware context with header + code block
- NOISE_RE: block Material icon names, button labels, UI artifacts
- Auto DOM structure dump on first conversation-view detection
- Enhanced deep-inspect with step element + button inventory
- known-issues: document AG Native SDK API incompatibility
This commit is contained in:
Variet Worker
2026-04-12 06:14:46 +09:00
parent 70dc301dca
commit a4d7286bce
7 changed files with 766 additions and 472 deletions

View File

@@ -151,6 +151,25 @@ export function startHttpBridge(ctx: HttpBridgeContext, sdk: any): Promise<numbe
return;
}
// GET /status — diagnostic endpoint
if (req.method === 'GET' && url.pathname === '/status') {
const { getStepProbeContext } = require('./step-probe');
const probeCtx = getStepProbeContext();
const status = {
projectName: ctx.projectName,
activeSessionId: probeCtx.activeSessionId || ctx.activeSessionId,
lastPendingStepIndex: probeCtx.lastPendingStepIndex,
sessionStalled: probeCtx.sessionStalled,
wsConnected: ctx.wsBridge?.isConnected() ?? false,
clickTrigger: clickTrigger ? { ...clickTrigger, ageMs: Date.now() - clickTrigger.timestamp } : null,
uptime: Math.round(process.uptime()),
timestamp: new Date().toISOString(),
};
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify(status, null, 2));
return;
}
// GET /ping — health check
if (url.pathname === '/ping') {
res.writeHead(200); res.end('pong');