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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user