@trusty-squire/mcp 1.1.13 → 1.1.14-rc.2

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.
Files changed (42) hide show
  1. package/README.md +19 -11
  2. package/dist/bot/browser-process-owner.d.ts +75 -0
  3. package/dist/bot/browser-process-owner.d.ts.map +1 -0
  4. package/dist/bot/browser-process-owner.js +931 -0
  5. package/dist/bot/browser-process-owner.js.map +1 -0
  6. package/dist/bot/browser-process-runtime.d.ts +159 -0
  7. package/dist/bot/browser-process-runtime.d.ts.map +1 -0
  8. package/dist/bot/browser-process-runtime.js +905 -0
  9. package/dist/bot/browser-process-runtime.js.map +1 -0
  10. package/dist/bot/browser.d.ts +45 -194
  11. package/dist/bot/browser.d.ts.map +1 -1
  12. package/dist/bot/browser.js +666 -2358
  13. package/dist/bot/browser.js.map +1 -1
  14. package/dist/bot/compact-observation-v2.d.ts +9 -0
  15. package/dist/bot/compact-observation-v2.d.ts.map +1 -1
  16. package/dist/bot/compact-observation-v2.js +141 -82
  17. package/dist/bot/compact-observation-v2.js.map +1 -1
  18. package/dist/bot/identity-runtime.d.ts +56 -0
  19. package/dist/bot/identity-runtime.d.ts.map +1 -0
  20. package/dist/bot/identity-runtime.js +141 -0
  21. package/dist/bot/identity-runtime.js.map +1 -0
  22. package/dist/bot/owned-pages.d.ts +16 -0
  23. package/dist/bot/owned-pages.d.ts.map +1 -0
  24. package/dist/bot/owned-pages.js +58 -0
  25. package/dist/bot/owned-pages.js.map +1 -0
  26. package/dist/bot/page-driver.d.ts +35 -0
  27. package/dist/bot/page-driver.d.ts.map +1 -0
  28. package/dist/bot/page-driver.js +302 -0
  29. package/dist/bot/page-driver.js.map +1 -0
  30. package/dist/bot/provision-session.d.ts +4 -0
  31. package/dist/bot/provision-session.d.ts.map +1 -1
  32. package/dist/bot/provision-session.js +122 -29
  33. package/dist/bot/provision-session.js.map +1 -1
  34. package/dist/bot/session/lifecycle.d.ts.map +1 -1
  35. package/dist/bot/session/lifecycle.js +218 -14
  36. package/dist/bot/session/lifecycle.js.map +1 -1
  37. package/dist/bot/session/multisession-flag.d.ts +2 -0
  38. package/dist/bot/session/multisession-flag.d.ts.map +1 -0
  39. package/dist/bot/session/multisession-flag.js +23 -0
  40. package/dist/bot/session/multisession-flag.js.map +1 -0
  41. package/dist/tools/provision-drive.d.ts +12 -12
  42. package/package.json +1 -1
package/README.md CHANGED
@@ -349,13 +349,16 @@ still return only a current handle. `detail:"full"` keeps the V2 format. Maintai
349
349
  live `text=…`/`css=…` locator; that one-off fallback is not replayable.
350
350
  Compact V2 accepts only a handle from its current sealed action map.
351
351
  When a `click` or `js_click` opens a new tab or popup (`target=_blank`, a
352
- `window.open` control), the operator follows it the way a person would: the
353
- newly opened page becomes the active page, so the next `operate_observe` or
354
- `operate_act` reads it. This is how an emailed verification or magic link is
355
- followed. Do not try to `extract` the link's href instead a single-use login
356
- token is sealed and is never returned as text; following the tab navigates the
357
- browser without exposing it. Payment is excluded: during a sealed card fill or
358
- a live place-order/3-D Secure approval the active page never changes.
352
+ `window.open` control), the operator follows it the way a person would only
353
+ when the browser attributes its creation to the session's active page. That
354
+ owned popup becomes the active page, so the next `operate_observe` or
355
+ `operate_act` reads it. An unrelated or no-opener page in the browser context
356
+ stays unassigned and cannot become the working page. This is how an emailed
357
+ verification or magic link is followed. Do not try to `extract` the link's href
358
+ instead — a single-use login token is sealed and is never returned as text;
359
+ following the tab navigates the browser without exposing it. Payment is
360
+ excluded: during a sealed card fill or a live place-order/3-D Secure approval
361
+ the active page never changes.
359
362
  In a live operator session, in-page XHR/fetch calls to merchant API sibling
360
363
  subdomains are automatically in scope only when they share the registrable
361
364
  domain of a host trusted at session start. Calls outside the session scope fail
@@ -387,10 +390,15 @@ still return only a current handle. `detail:"full"` keeps the V2 format. Maintai
387
390
  `detail` is `none`. Every `oauth_login` and legacy `oauth_click` is serialized
388
391
  from action start through completion and a short release cooldown; other
389
392
  session work remains parallel. The whole serialized action has a 30-second
390
- deadline. If Google does not complete in time, the call returns
391
- `google_session` re-login guidance and closes that operator session without
392
- replacing the saved identity; start a fresh session after reconnecting.
393
- `oauth_click` and `oauth_settle` remain for
393
+ deadline. If the provider has not handed control back in time, the call does
394
+ not error and does not close the session: it returns a normal observation
395
+ with `oauth.state: "awaiting_human"`, a `reason` naming only what was
396
+ observed, and `next_action: "operate_observe"`. A consent screen or a
397
+ 2FA/verification challenge is usually still showing, so re-observe and drive
398
+ it; the session stays open and usable. A denial the provider actually
399
+ reported (an OAuth `error=` code on the return URL) is the one case that
400
+ fails the action, with that code in the message. `oauth_click` and
401
+ `oauth_settle` remain for
394
402
  legacy replay compatibility. If an observation races that legacy transition,
395
403
  the response reports `oauth.state: "in_progress"` and directs the host to
396
404
  observe again.
@@ -0,0 +1,75 @@
1
+ import type { BrowserContext } from "playwright";
2
+ import { type ProfileCloseState } from "./profile.js";
3
+ import { type StealthProfile } from "./browser-process-runtime.js";
4
+ import type { PageDriver } from "./page-driver.js";
5
+ /** Exclusive Chrome custody. Page setup is awaited at the original startup boundary. */
6
+ export declare class BrowserProcessOwner {
7
+ private readonly pages;
8
+ private readonly initializePages;
9
+ context: BrowserContext | null;
10
+ private childChrome;
11
+ private childChromeIdentity;
12
+ private childChromeProcessGroup;
13
+ private ownedDisplayRig;
14
+ private ownedChromeProcessTreeProof;
15
+ private operatorProcessMarker;
16
+ private ownerLaunchTracked;
17
+ private cdpBrowser;
18
+ private launchedContext;
19
+ private launchedProfileHolderIdentity;
20
+ private startPromise;
21
+ private closePromise;
22
+ private startCancellationRequested;
23
+ private startLaunchCommitted;
24
+ private startSettled;
25
+ private persistentFallbackLaunchInFlight;
26
+ private persistentFallbackOwnershipMonitor;
27
+ private persistentFallbackCancellationState;
28
+ private resolveStartCancellation;
29
+ private readonly startCancellation;
30
+ private cancelledStartReaper;
31
+ private launchedChannel;
32
+ private proxyServer;
33
+ private readonly profileDir;
34
+ private readonly proxyOverride;
35
+ launchedMode: "headed" | "headless" | "remote" | "unknown";
36
+ constructor(opts: {
37
+ profileDir?: string;
38
+ proxyUrl?: string;
39
+ }, pages: PageDriver, initializePages: (context: BrowserContext, hardened: boolean, remoteMode: boolean) => Promise<void>);
40
+ operatorBrowserMarker(): string;
41
+ private ownedHeadedBrowserEnvironment;
42
+ private teardownOwnedDisplay;
43
+ private adoptOwnedChromeProcessTree;
44
+ private signalCurrentSelfManagedChrome;
45
+ isConnected(): boolean;
46
+ get channel(): string | null;
47
+ get proxied(): string | null;
48
+ get stealthProfile(): StealthProfile;
49
+ get launchMode(): "headed" | "headless" | "remote" | "unknown";
50
+ private launchSelfManagedContext;
51
+ private cancelSpawnedSelfManagedChrome;
52
+ start(): Promise<void>;
53
+ private startOnce;
54
+ private throwIfStartCancelled;
55
+ private commitProfileLaunch;
56
+ private startBrowser;
57
+ private probeEgressGeo;
58
+ private resolveProxy;
59
+ close(options?: {
60
+ cancelStart?: boolean;
61
+ }): Promise<ProfileCloseState>;
62
+ waitForCancelledStartQuiescence(): Promise<void>;
63
+ forceCloseOwnedProcessTree(): Promise<ProfileCloseState>;
64
+ private closeCancelledStart;
65
+ private reapCancelledStartProcess;
66
+ private monitorCancelledStartProcess;
67
+ private currentOwnedProfileIdentity;
68
+ private waitForPersistentFallbackIdentity;
69
+ private requirePersistentFallbackOwnership;
70
+ private startPersistentFallbackOwnershipMonitor;
71
+ private waitForOwnedProfileExit;
72
+ private closeAfterStart;
73
+ private closeBrowser;
74
+ }
75
+ //# sourceMappingURL=browser-process-owner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-process-owner.d.ts","sourceRoot":"","sources":["../../src/bot/browser-process-owner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAW,cAAc,EAAE,MAAM,YAAY,CAAC;AAI1D,OAAO,EAQL,KAAK,iBAAiB,EAEvB,MAAM,cAAc,CAAC;AAatB,OAAO,EAiCL,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EA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