@parall/daemon 1.44.0 → 1.46.0
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/bundle/manifest.json +15 -15
- package/bundle/parall-browser-pod.js +29726 -375
- package/bundle/parall-channel-exec.js +2 -0
- package/bundle/parall-claude-agent.js +26446 -384
- package/bundle/parall-codex-agent.js +27490 -1549
- package/bundle/parall-daemon.js +31558 -1617
- package/bundle/parall-openclaw-agent.js +1 -0
- package/dist/browser-pod.d.ts +23 -1
- package/dist/browser-pod.d.ts.map +1 -1
- package/dist/browser-pod.js +104 -34
- package/dist/browser-profile-reconcile.d.ts +21 -0
- package/dist/browser-profile-reconcile.d.ts.map +1 -0
- package/dist/browser-profile-reconcile.js +188 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +229 -2
- package/dist/clip-runtime/browser-cdp.d.ts +40 -0
- package/dist/clip-runtime/browser-cdp.d.ts.map +1 -0
- package/dist/clip-runtime/browser-cdp.js +218 -0
- package/dist/clip-runtime/browser-profile-manager.d.ts +97 -24
- package/dist/clip-runtime/browser-profile-manager.d.ts.map +1 -1
- package/dist/clip-runtime/browser-profile-manager.js +316 -182
- package/dist/clip-runtime/browser-profile-pool.d.ts +3 -0
- package/dist/clip-runtime/browser-profile-pool.d.ts.map +1 -1
- package/dist/clip-runtime/browser-profile-pool.js +18 -1
- package/dist/clip-runtime/browser-proxy-reconcile.d.ts +77 -0
- package/dist/clip-runtime/browser-proxy-reconcile.d.ts.map +1 -0
- package/dist/clip-runtime/browser-proxy-reconcile.js +139 -0
- package/dist/clip-runtime/browser-proxy-state.d.ts +55 -0
- package/dist/clip-runtime/browser-proxy-state.d.ts.map +1 -0
- package/dist/clip-runtime/browser-proxy-state.js +149 -0
- package/dist/clip-runtime/browser-quiescence.d.ts +71 -0
- package/dist/clip-runtime/browser-quiescence.d.ts.map +1 -0
- package/dist/clip-runtime/browser-quiescence.js +136 -0
- package/dist/clip-runtime/browser-readiness.d.ts +64 -0
- package/dist/clip-runtime/browser-readiness.d.ts.map +1 -0
- package/dist/clip-runtime/browser-readiness.js +161 -0
- package/dist/clip-runtime/browser-state-store.d.ts +13 -2
- package/dist/clip-runtime/browser-state-store.d.ts.map +1 -1
- package/dist/clip-runtime/browser-state-store.js +15 -6
- package/dist/clip-runtime/browser-target-registry.d.ts +143 -0
- package/dist/clip-runtime/browser-target-registry.d.ts.map +1 -0
- package/dist/clip-runtime/browser-target-registry.js +297 -0
- package/dist/clip-runtime/browser-viewer-streamer.d.ts +13 -14
- package/dist/clip-runtime/browser-viewer-streamer.d.ts.map +1 -1
- package/dist/clip-runtime/browser-viewer-streamer.js +11 -63
- package/dist/config.d.ts.map +1 -1
- package/dist/daemon-main.d.ts.map +1 -1
- package/dist/daemon-main.js +3 -1
- package/dist/runtime-bin-resolver.d.ts +7 -1
- package/dist/runtime-bin-resolver.d.ts.map +1 -1
- package/dist/runtime-bin-resolver.js +57 -22
- package/dist/runtimes.d.ts +15 -4
- package/dist/runtimes.d.ts.map +1 -1
- package/dist/runtimes.js +60 -5
- package/dist/supervisor.d.ts +6 -0
- package/dist/supervisor.d.ts.map +1 -1
- package/dist/supervisor.js +52 -188
- package/dist/win-lifecycle.d.ts +96 -0
- package/dist/win-lifecycle.d.ts.map +1 -0
- package/dist/win-lifecycle.js +229 -0
- package/dist/win-service.d.ts +119 -0
- package/dist/win-service.d.ts.map +1 -0
- package/dist/win-service.js +226 -0
- package/package.json +8 -6
|
@@ -17,13 +17,19 @@ export interface BrowserProfileManagerOptions {
|
|
|
17
17
|
error(msg: string): void;
|
|
18
18
|
};
|
|
19
19
|
reportStatus?: (profileId: string, status: BrowserProfileStatus, errorMsg?: string) => void;
|
|
20
|
-
/** Resolve the profile's outbound proxy
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
20
|
+
/** Resolve the profile's DESIRED outbound proxy — Parall's stored config is the
|
|
21
|
+
* sole source of truth. Consulted at account creation AND at every open/first
|
|
22
|
+
* ensure, where the applied config is reconciled against it (cookie-preserving
|
|
23
|
+
* context rebuild — see browser-proxy-reconcile.ts); bb-browser's own persisted
|
|
24
|
+
* account proxy never wins over this. Returning null = direct egress. A thrown
|
|
25
|
+
* error fails the operation closed (better than egressing from the real IP for
|
|
26
|
+
* a proxy-configured profile). */
|
|
26
27
|
resolveProxy?: (profileId: string) => Promise<BrowserProxyConfig | null> | BrowserProxyConfig | null;
|
|
28
|
+
/** Proxy readiness probe endpoint (~zero-byte Parall-owned URL). When a profile
|
|
29
|
+
* has a proxy, open/first-ensure navigates the owned tab here and requires a
|
|
30
|
+
* transport-error-free round trip before reporting `running`
|
|
31
|
+
* (PRLL_BROWSER_PROXY_PROBE_URL override; see browser-readiness.ts). */
|
|
32
|
+
proxyProbeUrl?: string;
|
|
27
33
|
}
|
|
28
34
|
export interface BrowserInvokeRequest {
|
|
29
35
|
profileId: string;
|
|
@@ -48,8 +54,11 @@ export declare class BrowserProfileManager {
|
|
|
48
54
|
private restarting;
|
|
49
55
|
private stopping;
|
|
50
56
|
private readonly ensuredAccounts;
|
|
57
|
+
private readonly preparedAccounts;
|
|
51
58
|
private readonly ensuringAccounts;
|
|
59
|
+
private readonly preparingAccounts;
|
|
52
60
|
private readonly reportedStatuses;
|
|
61
|
+
private readonly targets;
|
|
53
62
|
private readonly viewer;
|
|
54
63
|
constructor(opts: BrowserProfileManagerOptions);
|
|
55
64
|
invoke({ profileId, account, command, input }: BrowserInvokeRequest): Promise<unknown>;
|
|
@@ -57,6 +66,10 @@ export declare class BrowserProfileManager {
|
|
|
57
66
|
forceStatusReport?: boolean;
|
|
58
67
|
}): Promise<void>;
|
|
59
68
|
openProfile(profileId: string, startUrl?: string): Promise<void>;
|
|
69
|
+
/** Resolve + normalize/validate the desired proxy (fail closed on legacy-invalid
|
|
70
|
+
* configs — see browser-proxy-state.ts). null = direct egress. */
|
|
71
|
+
private resolveDesiredProxy;
|
|
72
|
+
private assertReady;
|
|
60
73
|
stopProfile(profileId: string): Promise<void>;
|
|
61
74
|
resetProfile(profileId: string): Promise<void>;
|
|
62
75
|
stop(): Promise<void>;
|
|
@@ -68,34 +81,94 @@ export declare class BrowserProfileManager {
|
|
|
68
81
|
handleViewerCommand(profileId: string, sessionId: string, command: string, input?: Record<string, unknown>, turn?: ViewerTurnConfig): Promise<Record<string, unknown>>;
|
|
69
82
|
/** Read cdpHost/cdpPort from the bb-browser daemon `GET /status`. */
|
|
70
83
|
private cdpEndpoint;
|
|
71
|
-
private
|
|
84
|
+
private lastCdpEndpoint;
|
|
85
|
+
/** Process-group id of the last spawned bb-browser tree (the detached child's
|
|
86
|
+
* pid). Survives the child's exit — quiescence probes it AFTER stop() to
|
|
87
|
+
* confirm the orphaned Chrome is gone too. null = never spawned. */
|
|
88
|
+
private lastPgid;
|
|
89
|
+
/** The browser tree's process-group id for the quiescence barrier. */
|
|
90
|
+
lastKnownProcessGroup(): number | null;
|
|
91
|
+
/** Peek the last known Chrome CDP endpoint WITHOUT starting anything. */
|
|
92
|
+
lastKnownCdpEndpoint(): {
|
|
93
|
+
host: string;
|
|
94
|
+
port: number;
|
|
95
|
+
} | null;
|
|
96
|
+
/**
|
|
97
|
+
* Land the profile on its start URL, idempotently, always inside its own
|
|
98
|
+
* context. A fresh account already opened `url` via `account_create`
|
|
99
|
+
* (accountCreated) — just bind it. Otherwise: reuse an owned tab already on
|
|
100
|
+
* the URL if any (repeated Open is a no-op), else NAVIGATE the profile's
|
|
101
|
+
* primary owned tab (`open {tabId}`) — never stack a new tab per Open.
|
|
102
|
+
*/
|
|
72
103
|
private openProfileTabOnce;
|
|
73
104
|
private resetProfileOnce;
|
|
74
|
-
private prepareInvokeAccount;
|
|
75
105
|
private recoverInvokeAvailability;
|
|
76
106
|
private accountExists;
|
|
107
|
+
/** One account_info round trip: existence + whether bb-browser holds a proxy for
|
|
108
|
+
* the account (server/username only — bb-browser never returns the password). */
|
|
109
|
+
private getAccountInfo;
|
|
110
|
+
/**
|
|
111
|
+
* Build the wire request for a forwarded browser command, binding it to a
|
|
112
|
+
* page the profile's account OWNS. bb-browser's own routing is account-blind
|
|
113
|
+
* (tab-less → global current tab → `targets[0]`, which is the default-context
|
|
114
|
+
* `about:blank` Chrome launches with — no cookies, NO PROXY), so:
|
|
115
|
+
*
|
|
116
|
+
* - a caller-supplied `tabId`/`tab` must resolve to one of the profile's own
|
|
117
|
+
* tabs (numeric global indices are rejected outright);
|
|
118
|
+
* - every other tab-addressed command gets the profile's primary owned tab
|
|
119
|
+
* stamped in (recreated inside the profile's BrowserContext if its pages
|
|
120
|
+
* were closed — never silently retargeted at another page);
|
|
121
|
+
* - only genuinely tab-less commands (TABLESS_COMMANDS) go unpinned.
|
|
122
|
+
*/
|
|
77
123
|
private buildCommandRequest;
|
|
78
124
|
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
125
|
+
* The domain bb-browser's adapter metadata declares for `siteName` (via
|
|
126
|
+
* site_info), or '' when the adapter genuinely has no domain / does not exist.
|
|
127
|
+
* This is the ONLY trustworthy domain source for site_run routing — a
|
|
128
|
+
* caller-supplied request.domain is ignored by upstream site_run, so it can never
|
|
129
|
+
* gate account-safe routing.
|
|
130
|
+
*
|
|
131
|
+
* Error handling is deliberately split: ONLY a genuine application-level answer
|
|
132
|
+
* from bb-browser ("no such site") yields '' → the caller fails closed. A
|
|
133
|
+
* RECOVERABLE daemon/CDP failure (or any transport error) RETHROWS, so
|
|
134
|
+
* buildCommandRequest's existing `isRecoverableBrowserDaemonError` →
|
|
135
|
+
* `recoverInvokeAvailability` restart+retry path handles it. Masking those as a
|
|
136
|
+
* domain-less adapter would turn a transient hiccup into a permanent
|
|
137
|
+
* BROWSER_TARGET_UNAVAILABLE. Note a BrowserCommandError can itself carry a
|
|
138
|
+
* recoverable message ("Chrome not connected"), so the recoverable check wins.
|
|
139
|
+
*/
|
|
140
|
+
private siteAdapterDomain;
|
|
141
|
+
/**
|
|
142
|
+
* First-use preparation — the SINGLE invariant shared by invoke, viewer, open,
|
|
143
|
+
* and ensureRuntime (fix #4). Runs ONCE per account per session:
|
|
144
|
+
* 1. resolve Parall's desired proxy (fail closed on invalid config);
|
|
145
|
+
* 2. ensure the account exists AND its applied proxy matches desired
|
|
146
|
+
* (cookie-preserving reconcile if it drifted — e.g. a hydrated hosted
|
|
147
|
+
* account created under an old proxy);
|
|
148
|
+
* 3. verify readiness (owned target answers; when proxied, a real request
|
|
149
|
+
* traverses the proxy without a transport error).
|
|
150
|
+
* Subsequent calls take the steady fast path — no config fetch, no probe —
|
|
151
|
+
* unless `force` is set (explicit lifecycle open / pending-row recovery). A
|
|
152
|
+
* daemon restart, reset, or proxy reconcile clears the prepared marker so the
|
|
153
|
+
* next use re-prepares. Deduped so concurrent first-uses share one run.
|
|
154
|
+
*/
|
|
155
|
+
private prepareForUse;
|
|
156
|
+
/**
|
|
157
|
+
* Ensure the profile's bb-browser account exists and honors the DESIRED proxy.
|
|
83
158
|
*
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
*
|
|
159
|
+
* `desiredProxy` semantics:
|
|
160
|
+
* - undefined (invoke fast path): don't fetch/reconcile — create-only proxy
|
|
161
|
+
* resolution via opts.resolveProxy when the account is missing. A proxy
|
|
162
|
+
* change applies at the next open / first ensure.
|
|
163
|
+
* - null / config (open + first ensure): Parall's config is the SSOT. A
|
|
164
|
+
* missing account is created with it; an existing account whose APPLIED
|
|
165
|
+
* fingerprint (Parall-owned sidecar) differs is rebuilt with cookies
|
|
166
|
+
* preserved (reconcileAccountProxy) — bb-browser's persisted account proxy
|
|
167
|
+
* never wins.
|
|
90
168
|
*/
|
|
91
|
-
private resolveAccountDomainTab;
|
|
92
|
-
/** Find an account-owned tab whose URL host matches (optionally a specific tab). */
|
|
93
|
-
private findAccountTabOnHost;
|
|
94
169
|
private ensureAccount;
|
|
170
|
+
private reconcileHost;
|
|
95
171
|
private ensureAccountOwnedTab;
|
|
96
|
-
private profileAlreadyHasOpenTab;
|
|
97
|
-
private hasAccountOwnedTab;
|
|
98
|
-
private findAccountTabMatchingUrl;
|
|
99
172
|
private reportStatus;
|
|
100
173
|
private sendCommand;
|
|
101
174
|
private ensureDaemon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-profile-manager.d.ts","sourceRoot":"","sources":["../../src/clip-runtime/browser-profile-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser-profile-manager.d.ts","sourceRoot":"","sources":["../../src/clip-runtime/browser-profile-manager.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAyB,KAAK,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAG5F,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAEnE;;;kFAGkF;AAClF,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE;QAAE,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IACpF,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,EAAE,QAAQ,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5F;;;;;;uCAMmC;IACnC,YAAY,CAAC,EAAE,CACb,SAAS,EAAE,MAAM,KACd,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,GAAG,kBAAkB,GAAG,IAAI,CAAC;IACpE;;;6EAG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