@parall/daemon 1.32.1 → 1.34.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/bb-browser-daemon.js +15628 -0
- package/bundle/buildDomTree.js +1501 -0
- package/bundle/manifest.json +19 -11
- package/bundle/parall-claude-agent.js +185 -25
- package/bundle/parall-codex-agent.js +185 -25
- package/bundle/parall-daemon.js +4647 -2856
- package/bundle/parall-openclaw-agent.js +4 -3
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +8 -2
- package/dist/clip-runtime/browser-dependency.d.ts +20 -0
- package/dist/clip-runtime/browser-dependency.d.ts.map +1 -0
- package/dist/clip-runtime/browser-dependency.js +52 -0
- package/dist/clip-runtime/browser-profile-manager.d.ts +70 -0
- package/dist/clip-runtime/browser-profile-manager.d.ts.map +1 -0
- package/dist/clip-runtime/browser-profile-manager.js +608 -0
- package/dist/clip-runtime/clip-provider.d.ts +10 -1
- package/dist/clip-runtime/clip-provider.d.ts.map +1 -1
- package/dist/clip-runtime/clip-provider.js +63 -21
- package/dist/clip-runtime/hub-client.d.ts +79 -0
- package/dist/clip-runtime/hub-client.d.ts.map +1 -0
- package/dist/clip-runtime/hub-client.js +320 -0
- package/dist/clip-runtime/index.d.ts +2 -0
- package/dist/clip-runtime/index.d.ts.map +1 -1
- package/dist/clip-runtime/index.js +2 -0
- package/dist/clip-runtime/ipc.d.ts +6 -0
- package/dist/clip-runtime/ipc.d.ts.map +1 -1
- package/dist/clip-runtime/manifest.d.ts +16 -8
- package/dist/clip-runtime/manifest.d.ts.map +1 -1
- package/dist/clip-runtime/manifest.js +13 -0
- package/dist/clip-runtime/process-manager.d.ts +55 -3
- package/dist/clip-runtime/process-manager.d.ts.map +1 -1
- package/dist/clip-runtime/process-manager.js +226 -48
- package/dist/clip-runtime/process.d.ts +15 -1
- package/dist/clip-runtime/process.d.ts.map +1 -1
- package/dist/clip-runtime/process.js +73 -10
- package/dist/config.d.ts +9 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +12 -0
- package/dist/index.js +46 -5
- package/dist/runtime-bin-resolver.d.ts +7 -0
- package/dist/runtime-bin-resolver.d.ts.map +1 -0
- package/dist/runtime-bin-resolver.js +292 -0
- package/dist/supervisor.d.ts +53 -4
- package/dist/supervisor.d.ts.map +1 -1
- package/dist/supervisor.js +449 -117
- package/package.json +7 -6
|
@@ -26,6 +26,7 @@ var PRLL_ORG_ID = env("PRLL_ORG_ID");
|
|
|
26
26
|
var stateDir = env("PRLL_STATE_DIR");
|
|
27
27
|
var PRLL_WS_URL = process.env.PRLL_WS_URL?.trim() || "";
|
|
28
28
|
var PRLL_SWIMLANE_NAME = process.env.PRLL_SWIMLANE_NAME?.trim() || "";
|
|
29
|
+
var openclawBin = process.env.PRLL_OPENCLAW_BIN?.trim() || "openclaw";
|
|
29
30
|
var gatewayPort = process.env.OPENCLAW_GATEWAY_PORT?.trim() || "0";
|
|
30
31
|
var pluginArchive = process.env.PRLL_OPENCLAW_PLUGIN_ARCHIVE?.trim() || "/opt/parall-plugin/parall-plugin.tgz";
|
|
31
32
|
var openclawStateDir = path.join(stateDir, ".openclaw");
|
|
@@ -37,7 +38,7 @@ if (fs.existsSync(pluginArchive)) {
|
|
|
37
38
|
fs.rmSync(legacyExtDir, { recursive: true, force: true });
|
|
38
39
|
log.info(`Installing Parall plugin from ${pluginArchive}...`);
|
|
39
40
|
try {
|
|
40
|
-
execFileSync(
|
|
41
|
+
execFileSync(openclawBin, ["plugins", "install", pluginArchive, "--force", "--dangerously-force-unsafe-install"], {
|
|
41
42
|
env: { ...process.env, OPENCLAW_STATE_DIR: openclawStateDir },
|
|
42
43
|
stdio: "inherit",
|
|
43
44
|
timeout: 6e4
|
|
@@ -204,7 +205,7 @@ async function preseedPlatformConfig() {
|
|
|
204
205
|
}
|
|
205
206
|
}
|
|
206
207
|
try {
|
|
207
|
-
execFileSync(
|
|
208
|
+
execFileSync(openclawBin, ["doctor", "--fix"], {
|
|
208
209
|
env: { ...process.env, OPENCLAW_STATE_DIR: openclawStateDir },
|
|
209
210
|
stdio: "inherit",
|
|
210
211
|
timeout: 3e4
|
|
@@ -230,7 +231,7 @@ if (gatewayPort !== "0") {
|
|
|
230
231
|
}
|
|
231
232
|
var cwd = workspaceDir || path.join(openclawStateDir, "workspace");
|
|
232
233
|
fs.mkdirSync(cwd, { recursive: true });
|
|
233
|
-
var child = spawn(
|
|
234
|
+
var child = spawn(openclawBin, gatewayArgs, {
|
|
234
235
|
env: gatewayEnv,
|
|
235
236
|
cwd,
|
|
236
237
|
stdio: "inherit",
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAgTA,wBAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAuD9E"}
|
package/dist/cli.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { execSync, spawn } from 'node:child_process';
|
|
1
2
|
import * as fs from 'node:fs';
|
|
2
|
-
import * as path from 'node:path';
|
|
3
3
|
import * as os from 'node:os';
|
|
4
|
+
import * as path from 'node:path';
|
|
4
5
|
import * as readline from 'node:readline';
|
|
5
|
-
import { spawn, execSync } from 'node:child_process';
|
|
6
6
|
import { daemonConfigDir, daemonConfigPath } from './config.js';
|
|
7
7
|
const CONFIG_DIR = daemonConfigDir();
|
|
8
8
|
const CONFIG_PATH = daemonConfigPath();
|
|
@@ -65,6 +65,11 @@ function generatePlist(daemonBin) {
|
|
|
65
65
|
<string>-c</string>
|
|
66
66
|
<string>OVERLAY="$HOME/.parall-daemon/bundle/current/parall-daemon.js"; if [ -f "$OVERLAY" ]; then exec node "$OVERLAY"; else exec ${daemonBin}; fi</string>
|
|
67
67
|
</array>
|
|
68
|
+
<key>EnvironmentVariables</key>
|
|
69
|
+
<dict>
|
|
70
|
+
<key>PRLL_DAEMON_MANAGED</key>
|
|
71
|
+
<string>1</string>
|
|
72
|
+
</dict>
|
|
68
73
|
<key>RunAtLoad</key>
|
|
69
74
|
<true/>
|
|
70
75
|
<key>KeepAlive</key>
|
|
@@ -88,6 +93,7 @@ Wants=network-online.target
|
|
|
88
93
|
|
|
89
94
|
[Service]
|
|
90
95
|
Type=simple
|
|
96
|
+
Environment=PRLL_DAEMON_MANAGED=1
|
|
91
97
|
ExecStart=/bin/sh -c 'OVERLAY="$HOME/.parall-daemon/bundle/current/parall-daemon.js"; if [ -f "$OVERLAY" ]; then exec node "$OVERLAY"; else exec ${daemonBin}; fi'
|
|
92
98
|
Restart=always
|
|
93
99
|
RestartSec=5
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CommandDetail, ManifestCache } from './manifest.js';
|
|
2
|
+
/**
|
|
3
|
+
* Canonical browser dependency-slot / capability alias. The hub routes browser
|
|
4
|
+
* InvokeCommands to the host provider under this clip name, and the execution
|
|
5
|
+
* side reads its binding from GetBindings()[BROWSER_CAPABILITY_NAME].
|
|
6
|
+
*/
|
|
7
|
+
export declare const BROWSER_CAPABILITY_NAME = "browser";
|
|
8
|
+
/** Package name advertised for the host-side browser capability registration. */
|
|
9
|
+
export declare const BROWSER_CAPABILITY_PACKAGE = "@pinixai/bb-browser-pro";
|
|
10
|
+
export declare function isBrowserDependencyName(name: string | undefined): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Commands advertised for the host-side "browser" capability registration. The
|
|
13
|
+
* bb-browser `/command` surface is open-ended; this is a representative subset
|
|
14
|
+
* for discovery/observability — the host forwards any command to bb-browser, so
|
|
15
|
+
* this list does not gate invocation.
|
|
16
|
+
*/
|
|
17
|
+
export declare function browserCapabilityCommands(): CommandDetail[];
|
|
18
|
+
export declare function manifestDeclaresBrowserDependency(manifest: ManifestCache | null): boolean;
|
|
19
|
+
export declare function manifestMapsDependencyToBrowser(manifest: ManifestCache | null, dependencyName: string): boolean;
|
|
20
|
+
//# sourceMappingURL=browser-dependency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-dependency.d.ts","sourceRoot":"","sources":["../../src/clip-runtime/browser-dependency.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAiB,aAAa,EAAE,MAAM,eAAe,CAAC;AAEjF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,YAAY,CAAC;AAEjD,iFAAiF;AACjF,eAAO,MAAM,0BAA0B,4BAA4B,CAAC;AASpE,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAEzE;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,IAAI,aAAa,EAAE,CAQ3D;AAED,wBAAgB,iCAAiC,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI,GAAG,OAAO,CAMzF;AAED,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,aAAa,GAAG,IAAI,EAC9B,cAAc,EAAE,MAAM,GACrB,OAAO,CAcT"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical browser dependency-slot / capability alias. The hub routes browser
|
|
3
|
+
* InvokeCommands to the host provider under this clip name, and the execution
|
|
4
|
+
* side reads its binding from GetBindings()[BROWSER_CAPABILITY_NAME].
|
|
5
|
+
*/
|
|
6
|
+
export const BROWSER_CAPABILITY_NAME = 'browser';
|
|
7
|
+
/** Package name advertised for the host-side browser capability registration. */
|
|
8
|
+
export const BROWSER_CAPABILITY_PACKAGE = '@pinixai/bb-browser-pro';
|
|
9
|
+
const BROWSER_DEPENDENCY_NAMES = new Set([
|
|
10
|
+
BROWSER_CAPABILITY_NAME,
|
|
11
|
+
'@pinix/browser',
|
|
12
|
+
'@pinixai/bb-browser-pro',
|
|
13
|
+
'bb-browser',
|
|
14
|
+
]);
|
|
15
|
+
export function isBrowserDependencyName(name) {
|
|
16
|
+
return !!name && BROWSER_DEPENDENCY_NAMES.has(name);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Commands advertised for the host-side "browser" capability registration. The
|
|
20
|
+
* bb-browser `/command` surface is open-ended; this is a representative subset
|
|
21
|
+
* for discovery/observability — the host forwards any command to bb-browser, so
|
|
22
|
+
* this list does not gate invocation.
|
|
23
|
+
*/
|
|
24
|
+
export function browserCapabilityCommands() {
|
|
25
|
+
return [
|
|
26
|
+
{ name: 'eval', description: 'Run JavaScript in a page context' },
|
|
27
|
+
{ name: 'open', description: 'Open a URL in a new tab' },
|
|
28
|
+
{ name: 'snapshot', description: 'Capture the accessibility/DOM snapshot of a page' },
|
|
29
|
+
{ name: 'click', description: 'Click an element' },
|
|
30
|
+
{ name: 'type', description: 'Type text into an element' },
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
export function manifestDeclaresBrowserDependency(manifest) {
|
|
34
|
+
return dependencyMaps(manifest).some((deps) => Object.entries(deps).some(([name, dep]) => isBrowserDependencyName(name) || isBrowserDependencyName(dep?.package)));
|
|
35
|
+
}
|
|
36
|
+
export function manifestMapsDependencyToBrowser(manifest, dependencyName) {
|
|
37
|
+
const maps = dependencyMaps(manifest);
|
|
38
|
+
if (maps.length === 0)
|
|
39
|
+
return false;
|
|
40
|
+
for (const deps of maps) {
|
|
41
|
+
const declared = deps[dependencyName];
|
|
42
|
+
if (declared) {
|
|
43
|
+
return isBrowserDependencyName(dependencyName) || isBrowserDependencyName(declared.package);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Some IPC clients address dependencies by package/name instead of the manifest alias.
|
|
47
|
+
// Allow that only when the manifest has an explicit browser dependency slot.
|
|
48
|
+
return isBrowserDependencyName(dependencyName) && manifestDeclaresBrowserDependency(manifest);
|
|
49
|
+
}
|
|
50
|
+
function dependencyMaps(manifest) {
|
|
51
|
+
return [manifest?.dependencies, manifest?.dependencySlots].filter((deps) => !!deps);
|
|
52
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
type BrowserProfileStatus = 'running' | 'stopped' | 'error';
|
|
2
|
+
interface BrowserProfileManagerOptions {
|
|
3
|
+
homeDir: string;
|
|
4
|
+
log: {
|
|
5
|
+
info(msg: string): void;
|
|
6
|
+
warn(msg: string): void;
|
|
7
|
+
error(msg: string): void;
|
|
8
|
+
};
|
|
9
|
+
reportStatus?: (profileId: string, status: BrowserProfileStatus, errorMsg?: string) => void;
|
|
10
|
+
}
|
|
11
|
+
interface BrowserInvokeRequest {
|
|
12
|
+
profileId: string;
|
|
13
|
+
account: string;
|
|
14
|
+
command: string;
|
|
15
|
+
input: unknown;
|
|
16
|
+
}
|
|
17
|
+
export declare class BrowserProfileManager {
|
|
18
|
+
private readonly opts;
|
|
19
|
+
private daemon;
|
|
20
|
+
private starting;
|
|
21
|
+
private restarting;
|
|
22
|
+
private readonly ensuredAccounts;
|
|
23
|
+
private readonly ensuringAccounts;
|
|
24
|
+
private readonly reportedStatuses;
|
|
25
|
+
constructor(opts: BrowserProfileManagerOptions);
|
|
26
|
+
invoke({ profileId, account, command, input }: BrowserInvokeRequest): Promise<unknown>;
|
|
27
|
+
ensureRuntime(profileId: string): Promise<void>;
|
|
28
|
+
openProfile(profileId: string, startUrl?: string): Promise<void>;
|
|
29
|
+
stopProfile(profileId: string): Promise<void>;
|
|
30
|
+
resetProfile(profileId: string): Promise<void>;
|
|
31
|
+
stop(): Promise<void>;
|
|
32
|
+
private prepareOpenProfile;
|
|
33
|
+
private openProfileTabOnce;
|
|
34
|
+
private resetProfileOnce;
|
|
35
|
+
private prepareInvokeAccount;
|
|
36
|
+
private recoverInvokeAvailability;
|
|
37
|
+
private accountExists;
|
|
38
|
+
private buildCommandRequest;
|
|
39
|
+
/**
|
|
40
|
+
* Account-scoped version of bb-browser's `resolveTabByDomain` (which is
|
|
41
|
+
* account-blind — the reason for this daemon-side preselection workaround).
|
|
42
|
+
* Two properties the bare `tab_new` + eval approach lacked, both caught on
|
|
43
|
+
* the staging closed-loop E2E (2026-06-04):
|
|
44
|
+
*
|
|
45
|
+
* 1. Reuse: an existing account tab already on the domain is reused instead
|
|
46
|
+
* of opening a new tab per eval (upstream reuses matching tabs too).
|
|
47
|
+
* 2. Load wait: after creating a tab, wait for the navigation to commit
|
|
48
|
+
* before eval — upstream waits (~10s poll + settle); without it the clip
|
|
49
|
+
* script races `about:blank` and relative fetches fail
|
|
50
|
+
* ("Failed to parse URL from /hot.json").
|
|
51
|
+
*/
|
|
52
|
+
private resolveAccountDomainTab;
|
|
53
|
+
/** Find an account-owned tab whose URL host matches (optionally a specific tab). */
|
|
54
|
+
private findAccountTabOnHost;
|
|
55
|
+
private ensureAccount;
|
|
56
|
+
private ensureAccountOwnedTab;
|
|
57
|
+
private profileAlreadyHasOpenTab;
|
|
58
|
+
private hasAccountOwnedTab;
|
|
59
|
+
private findAccountTabMatchingUrl;
|
|
60
|
+
private reportStatus;
|
|
61
|
+
private sendCommand;
|
|
62
|
+
private ensureDaemon;
|
|
63
|
+
private withDaemonRecovery;
|
|
64
|
+
private restartDaemon;
|
|
65
|
+
private restartDaemonOnce;
|
|
66
|
+
private startDaemon;
|
|
67
|
+
private post;
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
70
|
+
//# sourceMappingURL=browser-profile-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-profile-manager.d.ts","sourceRoot":"","sources":["../../src/clip-runtime/browser-profile-manager.ts"],"names":[],"mappings":"AAQA,KAAK,oBAAoB,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AAE5D,UAAU,4BAA4B;IACpC,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,K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