skopix 2.0.102 → 2.0.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cli/commands/agent.js
CHANGED
|
@@ -383,8 +383,9 @@ export async function agentCommand(options) {
|
|
|
383
383
|
|
|
384
384
|
// ── DEBUG-RECORD JOB ────────────────────────────────────────────────────────
|
|
385
385
|
async function handleDebugRecord(msg) {
|
|
386
|
-
const { runId, recordingId, replaySteps
|
|
387
|
-
|
|
386
|
+
const { runId, recordingId, replaySteps } = msg;
|
|
387
|
+
const startUrl = (msg.startUrl && msg.startUrl.startsWith('http')) ? msg.startUrl : null;
|
|
388
|
+
console.log(chalk.cyan(' ⏸ Debug replay: ') + chalk.white(replaySteps.length + ' steps to debug point') + (startUrl ? chalk.dim(' @ ' + startUrl) : ''));
|
|
388
389
|
|
|
389
390
|
const sendRun = (data) => { try { ws.send(JSON.stringify({ type: 'runUpdate', runId, data })); } catch {} };
|
|
390
391
|
const sendRec = (data) => { try { ws.send(JSON.stringify({ type: 'recordingUpdate', recordingId, data })); } catch {} };
|
|
@@ -411,7 +412,7 @@ export async function agentCommand(options) {
|
|
|
411
412
|
sendRun({ type: 'stdout', text: ' [' + stepNum + '/' + replaySteps.length + '] ' + (step.action || '').toUpperCase() + ' — ' + (step.description || step.stableSelector || step.selector || '') });
|
|
412
413
|
try {
|
|
413
414
|
const sel = step.stableSelector || step.selector;
|
|
414
|
-
await executeStep(step, sel, page, { url: startUrl });
|
|
415
|
+
await executeStep(step, sel, page, { url: startUrl || '' });
|
|
415
416
|
} catch (err) {
|
|
416
417
|
sendRun({ type: 'stdout', text: ' ✖ FAILED at step ' + stepNum + ': ' + err.message });
|
|
417
418
|
sendRun({ type: 'done', exitCode: 1, status: 'failed' });
|
|
@@ -430,7 +431,7 @@ export async function agentCommand(options) {
|
|
|
430
431
|
await fs.ensureDir(screenshotDir);
|
|
431
432
|
|
|
432
433
|
const { RecordingSession } = await import('../../core/recorder.js');
|
|
433
|
-
const session = new RecordingSession({ url: startUrl || '', sessionId: recordingId, screenshotDir });
|
|
434
|
+
const session = new RecordingSession({ url: startUrl || msg.startUrl || '', sessionId: recordingId, screenshotDir });
|
|
434
435
|
|
|
435
436
|
// Override emit to forward over WebSocket
|
|
436
437
|
session.emit = (obj) => {
|
|
@@ -1267,7 +1267,7 @@ export async function dashboardCommand(options) {
|
|
|
1267
1267
|
runId,
|
|
1268
1268
|
recordingId,
|
|
1269
1269
|
replaySteps,
|
|
1270
|
-
startUrl: test.url,
|
|
1270
|
+
startUrl: test.url || (replaySteps.find(s => s.url && s.url.startsWith('http'))?.url) || '',
|
|
1271
1271
|
env: { ...process.env, ...(await resolveUserSecretsEnv(currentUser?.id, teamMode) || {}) },
|
|
1272
1272
|
});
|
|
1273
1273
|
sendJSON(res, 200, { runId, recordingId, agent: { id: headedAgent.id, name: headedAgent.name } });
|
package/package.json
CHANGED