@ai-ecoverse/slicc-browsers 1.26.5 → 1.27.1

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.
@@ -255,6 +255,8 @@
255
255
  "vault-x",
256
256
  "apex",
257
257
  "own",
258
+ "idp",
259
+ "idp-stg",
258
260
  "chrome-newtab",
259
261
  "chrome-new-tab-page",
260
262
  "chrome-settings",
@@ -388,6 +390,13 @@
388
390
  "minLength": 1
389
391
  }
390
392
  },
393
+ "notes": {
394
+ "type": "array",
395
+ "items": {
396
+ "type": "string",
397
+ "minLength": 1
398
+ }
399
+ },
391
400
  "observable": {
392
401
  "type": "object",
393
402
  "additionalProperties": false,
@@ -596,6 +605,19 @@
596
605
  }
597
606
  }
598
607
  },
608
+ {
609
+ "type": "object",
610
+ "additionalProperties": false,
611
+ "required": ["credentialExport", "as"],
612
+ "properties": {
613
+ "credentialExport": {
614
+ "const": true
615
+ },
616
+ "as": {
617
+ "$ref": "#/$defs/name"
618
+ }
619
+ }
620
+ },
599
621
  {
600
622
  "type": "object",
601
623
  "additionalProperties": false,
package/sign-in-hold.mjs CHANGED
@@ -370,27 +370,50 @@ async function measureClient({
370
370
  return result;
371
371
  }
372
372
 
373
- async function rawReadable(reader, targetId, mark, notes) {
373
+ async function rawReadable(reader, targetId, mark, notes, waitMs = 0) {
374
374
  const attached = await outcome(reader.send('Target.attachToTarget', { targetId, flatten: true }));
375
375
  if (!attached.ok || !attached.result?.sessionId)
376
376
  return { readable: false, reason: `raw attach failed: ${attached.error?.message}` };
377
377
  const sessionId = attached.result.sessionId;
378
378
  await outcome(reader.send('Runtime.enable', {}, sessionId));
379
- const read = await outcome(
380
- reader.send(
381
- 'Runtime.evaluate',
382
- {
383
- expression: 'document.title + " " + (document.body && document.body.innerText)',
384
- returnByValue: true,
385
- },
386
- sessionId
387
- )
388
- );
379
+ const readOnce = async () => {
380
+ const ready = await outcome(
381
+ reader.send(
382
+ 'Runtime.evaluate',
383
+ { expression: 'document.readyState', returnByValue: true },
384
+ sessionId
385
+ )
386
+ );
387
+ const committed = ready.ok && ['interactive', 'complete'].includes(ready.result?.result?.value);
388
+ const read = await outcome(
389
+ reader.send(
390
+ 'Runtime.evaluate',
391
+ {
392
+ expression: 'document.title + " " + (document.body && document.body.innerText)',
393
+ returnByValue: true,
394
+ },
395
+ sessionId
396
+ )
397
+ );
398
+ const text = read.ok ? String(read.result?.result?.value ?? '') : '';
399
+ const readable = Boolean(committed && mark && text.includes(mark));
400
+ return { readable, text };
401
+ };
402
+ let result = await readOnce();
403
+ if (!result.readable && waitMs > 0) {
404
+ const found = await until(async () => {
405
+ const next = await readOnce();
406
+ return next.readable ? next : null;
407
+ }, waitMs);
408
+ if (found) result = found;
409
+ }
389
410
  await outcome(reader.send('Target.detachFromTarget', { sessionId }));
390
- const text = read.ok ? String(read.result?.result?.value ?? '') : '';
391
- const readable = Boolean(mark && text.includes(mark));
392
- note(notes, 'sign-in-hold.raw-read', { targetId, readable, text: text.slice(0, 120) });
393
- return { readable, text };
411
+ note(notes, 'sign-in-hold.raw-read', {
412
+ targetId,
413
+ readable: result.readable,
414
+ text: result.text.slice(0, 120),
415
+ });
416
+ return result;
394
417
  }
395
418
 
396
419
  function holdExpression(control, ordinary, tag, marker, heldUrl) {
@@ -616,7 +639,7 @@ async function callbackTab({
616
639
  targetId,
617
640
  };
618
641
 
619
- const { readable } = await rawReadable(reader, targetId, mark, notes);
642
+ const { readable } = await rawReadable(reader, targetId, mark, notes, Math.min(budget, 3000));
620
643
  if (!readable)
621
644
  return {
622
645
  live: false,