Sign In

@panerelay/setup

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@panerelay/setup - npm Package Compare versions

Comparing version
0.6.0
to
0.7.0
+22
dist/interactive-setup-state.d.ts
import { readAgentBrowserIntegrationState } from '@panerelay/bridge/agent-browser-config';
import { readCliAdapterMode, readCliAdapterRegistration } from '@panerelay/cli';
export type SetupIntegration = 'agentBrowser' | 'browserUse' | 'playwright';
export type DefaultSetupIntegration = Exclude<SetupIntegration, 'playwright'>;
export interface InteractiveSetupState {
defaultIntegrations: DefaultSetupIntegration[];
globalDefault: boolean;
integrations: SetupIntegration[];
}
export interface InteractiveSetupStateOptions {
dataDirectory?: string;
environment?: NodeJS.ProcessEnv;
homeDirectory?: string;
platform?: NodeJS.Platform;
}
export interface InteractiveSetupStateDependencies {
readAdapterMode?: typeof readCliAdapterMode;
readAdapterRegistration?: typeof readCliAdapterRegistration;
readAgentBrowserState?: typeof readAgentBrowserIntegrationState;
}
export declare function readInteractiveSetupState(options?: InteractiveSetupStateOptions, dependencies?: InteractiveSetupStateDependencies): Promise<InteractiveSetupState>;
//# sourceMappingURL=interactive-setup-state.d.ts.map
{"version":3,"file":"interactive-setup-state.d.ts","sourceRoot":"","sources":["../src/interactive-setup-state.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,wCAAwC,CAAC;AAC1F,OAAO,EAAE,kBAAkB,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAC;AAEhF,MAAM,MAAM,gBAAgB,GAAG,cAAc,GAAG,YAAY,GAAG,YAAY,CAAC;AAC5E,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;AAE9E,MAAM,WAAW,qBAAqB;IACpC,mBAAmB,EAAE,uBAAuB,EAAE,CAAC;IAC/C,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,gBAAgB,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,4BAA4B;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;CAC5B;AAED,MAAM,WAAW,iCAAiC;IAChD,eAAe,CAAC,EAAE,OAAO,kBAAkB,CAAC;IAC5C,uBAAuB,CAAC,EAAE,OAAO,0BAA0B,CAAC;IAC5D,qBAAqB,CAAC,EAAE,OAAO,gCAAgC,CAAC;CACjE;AAeD,wBAAsB,yBAAyB,CAC7C,OAAO,GAAE,4BAAiC,EAC1C,YAAY,GAAE,iCAAsC,GACnD,OAAO,CAAC,qBAAqB,CAAC,CAmDhC"}
import { homedir } from 'node:os';
import { readAgentBrowserIntegrationState } from '@panerelay/bridge/agent-browser-config';
import { readCliAdapterMode, readCliAdapterRegistration } from '@panerelay/cli';
function resolveHomeDirectory(options) {
return (options.homeDirectory ??
options.environment?.HOME ??
options.environment?.USERPROFILE ??
homedir());
}
function settledValue(result) {
return result.status === 'fulfilled' ? result.value : undefined;
}
export async function readInteractiveSetupState(options = {}, dependencies = {}) {
const homeDirectory = resolveHomeDirectory(options);
const adapterOptions = {
dataDirectory: options.dataDirectory,
environment: options.environment,
homeDirectory,
platform: options.platform,
};
const [agentBrowser, browserUse, playwright, browserUseMode] = await Promise.allSettled([
(dependencies.readAgentBrowserState ?? readAgentBrowserIntegrationState)({ homeDirectory }),
(dependencies.readAdapterRegistration ?? readCliAdapterRegistration)('browser-use', adapterOptions),
(dependencies.readAdapterRegistration ?? readCliAdapterRegistration)('playwright', adapterOptions),
(dependencies.readAdapterMode ?? readCliAdapterMode)('browser-use', {
environment: options.environment,
homeDirectory,
}),
]);
const agentBrowserState = settledValue(agentBrowser);
const browserUseRegistration = settledValue(browserUse);
const playwrightRegistration = settledValue(playwright);
const integrations = [
...(agentBrowserState?.providerAvailable ? ['agentBrowser'] : []),
...(browserUseRegistration ? ['browserUse'] : []),
...(playwrightRegistration ? ['playwright'] : []),
];
const defaultStates = [
...(integrations.includes('agentBrowser')
? [agentBrowserState?.isPanerelayDefault === true]
: []),
...(integrations.includes('browserUse') ? [settledValue(browserUseMode) === 'extension'] : []),
];
const defaultIntegrations = [
...(integrations.includes('agentBrowser') && agentBrowserState?.isPanerelayDefault === true
? ['agentBrowser']
: []),
...(integrations.includes('browserUse') && settledValue(browserUseMode) === 'extension'
? ['browserUse']
: []),
];
return {
defaultIntegrations,
globalDefault: defaultStates.length > 0 && defaultStates.every(Boolean),
integrations,
};
}
+9
-1
#!/usr/bin/env node
import { doctorPanerelay } from './doctor.js';
import { type SupportedLocale } from './i18n.js';
import { readInteractiveSetupState, type SetupIntegration } from './interactive-setup-state.js';
import { setupPanerelay, uninstallPanerelay } from './lifecycle.js';

@@ -18,4 +19,4 @@ export type SetupOperation = 'setup' | 'doctor' | 'uninstall';

}
type SetupIntegration = 'agentBrowser' | 'browserUse' | 'playwright';
interface SetupIntegrationPrompt {
initialValues: readonly SetupIntegration[];
message: string;

@@ -36,2 +37,7 @@ options: ReadonlyArray<{

type SetupConfirm = (prompt: SetupConfirmationPrompt) => Promise<boolean | undefined>;
export interface SetupProgress {
error(message?: string): void;
start(message?: string): void;
stop(message?: string): void;
}
export declare function parseSetupArgs(argv: string[]): ParsedSetupArgs;

@@ -41,5 +47,7 @@ export interface CliDependencies {

confirmDefault?: SetupConfirm;
createSetupProgress?: () => SetupProgress;
doctor?: typeof doctorPanerelay;
environment?: NodeJS.ProcessEnv;
interactive?: () => boolean;
readInteractiveState?: typeof readInteractiveSetupState;
selectIntegrations?: SetupSelectIntegrations;

@@ -46,0 +54,0 @@ setup?: typeof setupPanerelay;

+1
-1

@@ -1,1 +0,1 @@

{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAaA,OAAO,EAAE,eAAe,EAAqB,M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C;IAChC,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC;IAC5B,oBAAoB,CAAC,EAAE,OAAO,yBAAyB,CAAC;IACxD,kBAAkB,CAAC,EAAE,uBAAuB,CAAC;IAC7C,KAAK,CAAC,EAAE,OAAO,cAAc,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,kBAAkB,CAAC;CACvC;AAoID,wBAAsB,IAAI,CACxB,IAAI,GAAE,MAAM,EAA0B,EACtC,YAAY,GAAE,eAAoB,GACjC,OAAO,CAAC,MAAM,CAAC,CAoOjB"}
#!/usr/bin/env node
import { confirm as confirmPrompt, isCancel, multiselect } from '@clack/prompts';
import { confirm as confirmPrompt, isCancel, multiselect, spinner as createSpinner, } from '@clack/prompts';
import { PANERELAY_EXTENSION_ID } from '@panerelay/protocol';

@@ -12,2 +12,3 @@ import { PANERELAY_BROWSER_USE_GATEWAY_URL, browserUseEnvironmentPath, } from '@panerelay/browser-use';

import { normalizeLocale, resolveLocale, translate } from './i18n.js';
import { readInteractiveSetupState, } from './interactive-setup-state.js';
import { setupPanerelay, uninstallPanerelay } from './lifecycle.js';

@@ -362,7 +363,7 @@ const PANERELAY_CHROME_WEB_STORE_URL = 'https://chromewebstore.google.com/detail/panerelay/panplnkjlkoceaonlmpdekjphgmbggmi';

}
function confirmationPrompt(locale, message) {
function confirmationPrompt(locale, message, initialValue = false) {
return {
active: translate(locale, 'confirmYes'),
inactive: translate(locale, 'confirmNo'),
initialValue: false,
initialValue,
message,

@@ -379,4 +380,10 @@ };

}
function terminalSetupProgress() {
if (!isInteractiveTerminal())
return undefined;
return createSpinner({ indicator: 'timer', output: stdout });
}
async function promptIntegrations(prompt) {
const selected = await multiselect({
initialValues: [...prompt.initialValues],
input: stdin,

@@ -390,4 +397,5 @@ message: prompt.message,

}
async function selectOptionalIntegrations(locale, selectIntegrations, confirmDefault) {
async function selectOptionalIntegrations(locale, currentState, selectIntegrations, confirmDefault) {
const selection = await selectIntegrations({
initialValues: currentState.integrations,
message: translate(locale, 'integrationSelectPrompt'),

@@ -417,3 +425,5 @@ options: [

if (selected.has('agentBrowser') || selected.has('browserUse')) {
const confirmed = await confirmDefault(confirmationPrompt(locale, translate(locale, 'defaultIntegrationsPrompt')));
const selectedDefaultIntegrations = ['agentBrowser', 'browserUse'].filter(integration => selected.has(integration));
const currentDefaults = new Set(currentState.defaultIntegrations);
const confirmed = await confirmDefault(confirmationPrompt(locale, translate(locale, 'defaultIntegrationsPrompt'), selectedDefaultIntegrations.every(integration => currentDefaults.has(integration))));
if (confirmed === undefined)

@@ -429,2 +439,3 @@ return undefined;

playwright: selected.has('playwright'),
reconcileIntegrations: true,
};

@@ -500,2 +511,3 @@ }

}
let setupProgress;
try {

@@ -543,2 +555,3 @@ if (parsed.operation === 'doctor') {

};
let interactiveSetup = false;
if (parsed.operation === 'setup' &&

@@ -550,3 +563,6 @@ !parsed.agentBrowser &&

(dependencies.interactive ?? isInteractiveTerminal)()) {
const selected = await selectOptionalIntegrations(locale, dependencies.selectIntegrations ?? promptIntegrations, dependencies.confirmDefault ?? promptConfirmation);
const currentState = await (dependencies.readInteractiveState ?? readInteractiveSetupState)({
environment: dependencies.environment,
});
const selected = await selectOptionalIntegrations(locale, currentState, dependencies.selectIntegrations ?? promptIntegrations, dependencies.confirmDefault ?? promptConfirmation);
if (!selected) {

@@ -557,2 +573,3 @@ console.error(translate(locale, 'setupCancelled'));

setupOptions = { ...setupOptions, ...selected };
interactiveSetup = true;
}

@@ -563,3 +580,9 @@ const selectedAgentBrowser = setupOptions.agentBrowser === true;

const selectedGlobalDefault = setupOptions.globalDefault === true;
if (interactiveSetup) {
setupProgress = dependencies.createSetupProgress?.() ?? terminalSetupProgress();
setupProgress?.start(translate(locale, 'setupProgress'));
}
const result = await (dependencies.setup ?? setupPanerelay)(setupOptions);
setupProgress?.stop(translate(locale, 'setupProgressComplete'));
setupProgress = undefined;
console.log(translate(locale, 'setupTitle'));

@@ -579,2 +602,5 @@ console.log('');

}
if (result.removedBrowserUseIntegration?.detachedDaemonMayRemain) {
console.log(translate(locale, 'browserUseDetachedDaemon'));
}
const agentBrowserReady = result.agentBrowserInstallation?.supported === true;

@@ -632,37 +658,2 @@ if (selectedAgentBrowser) {

}
const optionalChecks = [
result.host.codexPath
? {
label: translate(locale, 'setupCodex'),
detail: result.host.codexPath,
status: 'pass',
}
: {
label: translate(locale, 'setupCodex'),
detail: translate(locale, 'setupNotFound'),
status: 'warn',
},
result.host.opencodePath
? {
label: translate(locale, 'setupOpenCode'),
detail: `${result.host.opencodePath}${result.host.opencodeVersion ? ` (${result.host.opencodeVersion})` : ''}`,
status: 'pass',
}
: {
label: translate(locale, 'setupOpenCode'),
detail: translate(locale, 'setupNotFound'),
status: 'warn',
},
];
if (optionalChecks.length > 0) {
console.log('');
console.log(translate(locale, 'setupGroupOptional'));
for (const check of optionalChecks) {
printSetupCheck(check.status, check.label, check.detail);
}
if (!result.host.codexPath)
printSetupSubline(translate(locale, 'setupFix'), translate(locale, 'codexMissing'));
if (!result.host.opencodePath)
printSetupSubline(translate(locale, 'setupFix'), translate(locale, 'openCodeMissing'));
}
const setupReady = (!selectedAgentBrowser || agentBrowserReady) &&

@@ -676,2 +667,3 @@ (!selectedBrowserUse || result.browserUseReady === true) &&

catch (error) {
setupProgress?.error(translate(locale, 'setupProgressFailed'));
console.error(error instanceof Error ? error.message : String(error));

@@ -678,0 +670,0 @@ return 1;

@@ -21,2 +21,3 @@ import { userAgentBrowserConfigPath } from '@panerelay/bridge/agent-browser-config';

export declare function configureGlobalProvider(options?: ConfigPathOptions): Promise<string>;
export declare function clearGlobalProvider(options?: ConfigPathOptions): Promise<string>;
export declare function unregisterPanerelayProvider(options?: ConfigPathOptions): Promise<string>;

@@ -23,0 +24,0 @@ export declare function configureProjectProvider(options?: ConfigPathOptions): Promise<string>;

@@ -1,1 +0,1 @@

{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":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AO,CAAC,MAAM,CAAC,CAO5F;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ7E"}
import { constants } from 'node:fs';
import { access, mkdir, readFile, rename, rm, writeFile } from 'node:fs/promises';
import { setPanerelayUserDefaultProvider, userAgentBrowserConfigPath, } from '@panerelay/bridge/agent-browser-config';
import { clearPanerelayUserDefaultProvider, setPanerelayUserDefaultProvider, userAgentBrowserConfigPath, } from '@panerelay/bridge/agent-browser-config';
import { dirname, join } from 'node:path';

@@ -59,2 +59,5 @@ function asObject(value, path) {

}
export async function clearGlobalProvider(options = {}) {
return (await clearPanerelayUserDefaultProvider({ homeDirectory: options.homeDirectory })).path;
}
export async function unregisterPanerelayProvider(options = {}) {

@@ -61,0 +64,0 @@ const path = userAgentBrowserConfigPath(options.homeDirectory);

@@ -14,4 +14,2 @@ export type SupportedLocale = 'en' | 'zh-CN';

readonly playwrightMissing: "Warning: Playwright CLI 0.1.17 or newer was not found. Install or upgrade the upstream CLI, then run setup again with --playwright.";
readonly codexMissing: "Warning: Codex CLI was not found.";
readonly openCodeMissing: "Warning: OpenCode was not found. Install it or set PANERELAY_OPENCODE_PATH, then run setup again.";
readonly doctorAttention: "Panerelay needs attention.";

@@ -46,3 +44,3 @@ readonly doctorFailureCount: "Failed checks: {count}";

readonly extensionIdentity: "Extension ID: {id}";
readonly extensionStoreNextStep: "Extension: Install or open Panerelay in the Chrome Web Store: {url}";
readonly extensionStoreNextStep: "Extension: Install Panerelay in the Chrome Web Store: {url}";
readonly globalDefault: "Global default configuration: {path}";

@@ -56,4 +54,2 @@ readonly setupAgentBrowser: "agent-browser";

readonly setupPlaywrightCommand: "Playwright command:";
readonly setupCodex: "Codex";
readonly setupOpenCode: "OpenCode";
readonly setupExtensionId: "Extension ID";

@@ -63,5 +59,7 @@ readonly setupFix: "Fix";

readonly setupGroupLocal: "Local integration";
readonly setupGroupOptional: "Optional tools";
readonly setupNextStep: "Next step";
readonly setupNotFound: "Not found";
readonly setupProgress: "Applying Panerelay setup changes";
readonly setupProgressComplete: "Panerelay setup changes applied";
readonly setupProgressFailed: "Panerelay setup failed";
readonly setupReady: "Panerelay setup complete.";

@@ -75,3 +73,3 @@ readonly setupAttention: "Panerelay setup needs attention.";

readonly integrationPlaywrightHint: "Explicit CDP connection";
readonly integrationSelectPrompt: "Select optional automation integrations";
readonly integrationSelectPrompt: "Select integrations (checked: install/update; unchecked: remove Panerelay integration)";
readonly help: "Panerelay Setup\n\nUsage:\n npx --yes @panerelay/setup [--agent-browser] [--browser-use] [--playwright] [--global-default] [--extension-id <id>] [--lang <language>]\n npx --yes @panerelay/setup doctor [--agent-browser] [--browser-use] [--playwright] [--global-default] [--extension-id <id>] [--json] [--lang <language>]\n npx --yes @panerelay/setup uninstall [--yes] [--lang <language>]\n\nCommands:\n setup Install the Native Host for the Extension and side panel (default)\n doctor Diagnose the local Panerelay integration\n uninstall Remove Panerelay-managed local integration files\n\nOptions:\n --agent-browser Also install or diagnose the Panerelay agent-browser integration\n --browser-use Also install or diagnose the Panerelay Browser Use integration\n --playwright Also install or diagnose the Panerelay Playwright CLI integration\n --global-default\n Set selected automation integrations as user-level defaults\n --extension-id\n Use a custom 32-character Chrome Extension ID for this installation\n --json Print a machine-readable doctor report\n --lang Use en or zh-CN instead of the system language\n --yes, -y Confirm uninstall without a prompt\n --help, -h Show this help\n\nOptional automation integrations:\n npx --yes @panerelay/setup --agent-browser\n npx --yes @panerelay/setup --browser-use\n npx --yes @panerelay/setup --playwright";

@@ -78,0 +76,0 @@ readonly nativeHost: "Native Host: {path}";

@@ -1,1 +0,1 @@

{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../src/i18n.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,OAAO,CAAC;AAE7C,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GAClC,MAAM,CAGR"}

@@ -14,4 +14,2 @@ import { execFileSync } from 'node:child_process';

playwrightMissing: 'Warning: Playwright CLI 0.1.17 or newer was not found. Install or upgrade the upstream CLI, then run setup again with --playwright.',
codexMissing: 'Warning: Codex CLI was not found.',
openCodeMissing: 'Warning: OpenCode was not found. Install it or set PANERELAY_OPENCODE_PATH, then run setup again.',
doctorAttention: 'Panerelay needs attention.',

@@ -46,3 +44,3 @@ doctorFailureCount: 'Failed checks: {count}',

extensionIdentity: 'Extension ID: {id}',
extensionStoreNextStep: 'Extension: Install or open Panerelay in the Chrome Web Store: {url}',
extensionStoreNextStep: 'Extension: Install Panerelay in the Chrome Web Store: {url}',
globalDefault: 'Global default configuration: {path}',

@@ -56,4 +54,2 @@ setupAgentBrowser: 'agent-browser',

setupPlaywrightCommand: 'Playwright command:',
setupCodex: 'Codex',
setupOpenCode: 'OpenCode',
setupExtensionId: 'Extension ID',

@@ -63,5 +59,7 @@ setupFix: 'Fix',

setupGroupLocal: 'Local integration',
setupGroupOptional: 'Optional tools',
setupNextStep: 'Next step',
setupNotFound: 'Not found',
setupProgress: 'Applying Panerelay setup changes',
setupProgressComplete: 'Panerelay setup changes applied',
setupProgressFailed: 'Panerelay setup failed',
setupReady: 'Panerelay setup complete.',

@@ -75,3 +73,3 @@ setupAttention: 'Panerelay setup needs attention.',

integrationPlaywrightHint: 'Explicit CDP connection',
integrationSelectPrompt: 'Select optional automation integrations',
integrationSelectPrompt: 'Select integrations (checked: install/update; unchecked: remove Panerelay integration)',
help: `Panerelay Setup

@@ -125,4 +123,2 @@

defaultIntegrationsPrompt: '将 Panerelay 设为所选 agent-browser 和 Browser Use 集成的用户级默认吗?',
codexMissing: '警告:未找到 Codex CLI。',
openCodeMissing: '警告:未找到 OpenCode。请安装 OpenCode 或设置 PANERELAY_OPENCODE_PATH,然后重新运行 setup。',
doctorAttention: 'Panerelay 需要处理以下问题。',

@@ -167,4 +163,2 @@ doctorFailureCount: '失败项:{count}',

setupPlaywright: 'Playwright CLI',
setupCodex: 'Codex',
setupOpenCode: 'OpenCode',
setupExtensionId: '扩展 ID',

@@ -174,5 +168,7 @@ setupFix: '处理',

setupGroupLocal: '本地集成',
setupGroupOptional: '可选工具',
setupNextStep: '下一步',
setupNotFound: '未找到',
setupProgress: '正在应用 Panerelay 安装变更',
setupProgressComplete: 'Panerelay 安装变更已应用',
setupProgressFailed: 'Panerelay 安装失败',
setupReady: 'Panerelay 安装完成。',

@@ -186,3 +182,3 @@ setupAttention: 'Panerelay 安装需要处理。',

integrationPlaywrightHint: '显式 CDP 连接',
integrationSelectPrompt: '请选择可选自动化集成',
integrationSelectPrompt: '选择集成(勾选:安装或更新;未勾选:移除 Panerelay 集成)',
help: `Panerelay 安装工具

@@ -189,0 +185,0 @@

export { installBrowserUseIntegrationArtifacts, PANERELAY_BROWSER_USE_CONFIG_PROTOCOL, PANERELAY_BROWSER_USE_INTEGRATION_VERSION, posixNodeLauncherContent, resolveBrowserUseIntegrationPaths, windowsNodeLauncherContent, uninstallBrowserUseIntegrationArtifacts, } from './browser-use-integration.js';
export type { BrowserUseIntegrationConfig, BrowserUseIntegrationInstallation, BrowserUseIntegrationPathOptions, BrowserUseIntegrationPaths, InstallBrowserUseIntegrationOptions, BrowserUseIntegrationUninstallResult, UninstallBrowserUseIntegrationOptions, } from './browser-use-integration.js';
export { configureGlobalProvider, configureProjectProvider, projectAgentBrowserConfigPath, registerPanerelayProvider, removeProjectProvider, unregisterPanerelayProvider, userAgentBrowserConfigPath, } from './config.js';
export { clearGlobalProvider, configureGlobalProvider, configureProjectProvider, projectAgentBrowserConfigPath, registerPanerelayProvider, removeProjectProvider, unregisterPanerelayProvider, userAgentBrowserConfigPath, } from './config.js';
export { doctorPanerelay } from './doctor.js';

@@ -5,0 +5,0 @@ export type { DoctorCheck, DoctorOptions, DoctorReport, DoctorStatus } from './doctor.js';

@@ -1,1 +0,1 @@

{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,qCAAqC,EACrC,yCAAyC,EACzC,wBAAwB,EACxB,iCAAiC,EACjC,0BAA0B,EAC1B,uCAAuC,GACxC,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,2BAA2B,EAC3B,iCAAiC,EACjC,gCAAgC,EAChC,0BAA0B,EAC1B,mCAAmC,EACnC,oCAAoC,EACpC,qCAAqC,GACtC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,6BAA6B,EAC7B,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpE,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,4BAA4B,EAC5B,wCAAwC,EACxC,iCAAiC,EACjC,8BAA8B,GAC/B,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,iCAAiC,EACjC,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,6BAA6B,CAAC"}
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qCAAqC,EACrC,qCAAqC,EACrC,yCAAyC,EACzC,wBAAwB,EACxB,iCAAiC,EACjC,0BAA0B,EAC1B,uCAAuC,GACxC,MAAM,8BAA8B,CAAC;AACtC,YAAY,EACV,2BAA2B,EAC3B,iCAAiC,EACjC,gCAAgC,EAChC,0BAA0B,EAC1B,mCAAmC,EACnC,oCAAoC,EACpC,qCAAqC,GACtC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,wBAAwB,EACxB,6BAA6B,EAC7B,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC3B,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpE,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,4BAA4B,EAC5B,wCAAwC,EACxC,iCAAiC,EACjC,8BAA8B,GAC/B,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,iCAAiC,EACjC,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,6BAA6B,CAAC"}
export { installBrowserUseIntegrationArtifacts, PANERELAY_BROWSER_USE_CONFIG_PROTOCOL, PANERELAY_BROWSER_USE_INTEGRATION_VERSION, posixNodeLauncherContent, resolveBrowserUseIntegrationPaths, windowsNodeLauncherContent, uninstallBrowserUseIntegrationArtifacts, } from './browser-use-integration.js';
export { configureGlobalProvider, configureProjectProvider, projectAgentBrowserConfigPath, registerPanerelayProvider, removeProjectProvider, unregisterPanerelayProvider, userAgentBrowserConfigPath, } from './config.js';
export { clearGlobalProvider, configureGlobalProvider, configureProjectProvider, projectAgentBrowserConfigPath, registerPanerelayProvider, removeProjectProvider, unregisterPanerelayProvider, userAgentBrowserConfigPath, } from './config.js';
export { doctorPanerelay } from './doctor.js';
export { setupPanerelay, uninstallPanerelay } from './lifecycle.js';
export { installPlaywrightIntegration, PANERELAY_PLAYWRIGHT_INTEGRATION_VERSION, resolvePlaywrightIntegrationPaths, uninstallPlaywrightIntegration, } from './playwright-integration.js';
import { installNativeHost, uninstallNativeHost, type NativeHostInstallationResult } from '@panerelay/bridge/install';
import { configureGlobalProvider, configureProjectProvider, registerPanerelayProvider, removeProjectProvider, unregisterPanerelayProvider } from './config.js';
import { clearGlobalProvider, configureGlobalProvider, configureProjectProvider, registerPanerelayProvider, removeProjectProvider, unregisterPanerelayProvider } from './config.js';
import { installBrowserUseIntegrationArtifacts, uninstallBrowserUseIntegrationArtifacts, type BrowserUseIntegrationInstallation, type BrowserUseIntegrationUninstallResult } from './browser-use-integration.js';

@@ -20,2 +20,3 @@ import { probeBrowserUseVersions, type BrowserUseVersions } from '@panerelay/browser-use';

projectDirectory?: string;
reconcileIntegrations?: boolean;
}

@@ -33,2 +34,5 @@ export interface PanerelaySetupResult {

playwrightIntegration?: PlaywrightIntegrationInstallation;
removedAgentBrowserConfigPath?: string;
removedBrowserUseIntegration?: BrowserUseIntegrationUninstallResult;
removedPlaywrightIntegration?: Awaited<ReturnType<typeof uninstallPlaywrightIntegration>>;
projectConfigPath?: string;

@@ -43,2 +47,3 @@ }

export interface LifecycleDependencies {
clearGlobal?: typeof clearGlobalProvider;
configureGlobal?: typeof configureGlobalProvider;

@@ -45,0 +50,0 @@ configureProject?: typeof configureProjectProvider;

@@ -1,1 +0,1 @@

{"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../src/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,4BAA4B,EAClC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,qCAAqC,EACrC,uCAAuC,EACvC,KAAK,iCAAiC,EACtC,KAAK,oCAAoC,EAC1C,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,uBAAuB,EACvB,KAAK,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,CAAC,EAAE,OAAO,4BAA4B,CAAC;IACxD,eAAe,CAAC,EAAE,OAAO,2BAA2B,CAAC;IACrD,mBAAmB,CAAC,EAAE,OAAO,8BAA8B,CAAC;IAC5D,kBAAkB,CAAC,EAAE,OAAO,2BAA2B,CAAC;CACzD;AAED,wBAAsB,cAAc,CAClC,OAAO,GAAE,qBAA0B,EACnC,YAAY,GAAE,qBAA0B,GACvC,OAAO,CAAC,oBAAoB,CAAC,CA6I/B;AAED,wBAAsB,kBAAkB,CACtC,OAAO,GAAE,qBAA0B,EACnC,YAAY,GAAE,qBAA0B,GACvC,OAAO,CAAC,wBAAwB,CAAC,CAyCnC"}
import { installNativeHost, uninstallNativeHost, } from '@panerelay/bridge/install';
import { configureGlobalProvider, configureProjectProvider, registerPanerelayProvider, removeProjectProvider, unregisterPanerelayProvider, } from './config.js';
import { clearGlobalProvider, configureGlobalProvider, configureProjectProvider, registerPanerelayProvider, removeProjectProvider, unregisterPanerelayProvider, } from './config.js';
import { installBrowserUseIntegrationArtifacts, uninstallBrowserUseIntegrationArtifacts, } from './browser-use-integration.js';

@@ -12,5 +12,7 @@ import { isBrowserUseInstallationSupported, probeBrowserUseVersions, } from '@panerelay/browser-use';

const configureGlobal = dependencies.configureGlobal ?? configureGlobalProvider;
const clearGlobal = dependencies.clearGlobal ?? clearGlobalProvider;
const installBrowserUse = dependencies.installBrowserUse ?? installBrowserUseIntegrationArtifacts;
const configureProject = dependencies.configureProject ?? configureProjectProvider;
const installPlaywright = dependencies.installPlaywright ?? installPlaywrightIntegration;
const reconcileIntegrations = options.reconcileIntegrations === true;
if (options.globalDefault && !options.agentBrowser && !options.browserUse) {

@@ -42,2 +44,10 @@ throw new Error('--global-default requires agentBrowser or browserUse: true');

}
else if (reconcileIntegrations && options.agentBrowser) {
await clearGlobal({ homeDirectory: options.homeDirectory });
}
const removedAgentBrowserConfigPath = reconcileIntegrations && !options.agentBrowser
? await (dependencies.unregisterProvider ?? unregisterPanerelayProvider)({
homeDirectory: options.homeDirectory,
})
: undefined;
const browserUseVersions = options.browserUse

@@ -51,3 +61,4 @@ ? await (dependencies.probeBrowserUse ?? probeBrowserUseVersions)(options.environment, options.platform)

? await installBrowserUse({
browserUseDefault: options.browserUseDefault ?? (options.globalDefault ? 'extension' : undefined),
browserUseDefault: options.browserUseDefault ??
(options.globalDefault ? 'extension' : reconcileIntegrations ? 'direct' : undefined),
browserUseVersions,

@@ -59,2 +70,9 @@ environment: options.environment,

: undefined;
const removedBrowserUseIntegration = reconcileIntegrations && !options.browserUse
? await (dependencies.uninstallBrowserUse ?? uninstallBrowserUseIntegrationArtifacts)({
environment: options.environment,
homeDirectory: options.homeDirectory,
platform: options.platform,
})
: undefined;
const playwrightInstallation = options.playwright

@@ -73,2 +91,9 @@ ? await (dependencies.probePlaywright ?? probePlaywrightInstallation)(options.environment, options.platform)

: undefined;
const removedPlaywrightIntegration = reconcileIntegrations && !options.playwright
? await (dependencies.uninstallPlaywright ?? uninstallPlaywrightIntegration)({
environment: options.environment,
homeDirectory: options.homeDirectory,
platform: options.platform,
})
: undefined;
if (!options.project) {

@@ -89,2 +114,5 @@ return {

...(playwrightIntegration ? { playwrightIntegration } : {}),
...(removedAgentBrowserConfigPath ? { removedAgentBrowserConfigPath } : {}),
...(removedBrowserUseIntegration ? { removedBrowserUseIntegration } : {}),
...(removedPlaywrightIntegration ? { removedPlaywrightIntegration } : {}),
globalDefault: options.globalDefault === true,

@@ -110,2 +138,5 @@ };

...(playwrightIntegration ? { playwrightIntegration } : {}),
...(removedAgentBrowserConfigPath ? { removedAgentBrowserConfigPath } : {}),
...(removedBrowserUseIntegration ? { removedBrowserUseIntegration } : {}),
...(removedPlaywrightIntegration ? { removedPlaywrightIntegration } : {}),
globalDefault: options.globalDefault === true,

@@ -112,0 +143,0 @@ projectConfigPath,

@@ -81,2 +81,7 @@ #!/usr/bin/env node

// ../protocol/dist/conversation-target.js
var PANERELAY_CONVERSATION_TARGET_SESSION_PREFIX = "panerelay-tab-v1-";
var CANONICAL_UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
var TARGET_SESSION_PATTERN = new RegExp(`^${PANERELAY_CONVERSATION_TARGET_SESSION_PREFIX}(${CANONICAL_UUID_PATTERN.source.slice(1, -1)})-(${CANONICAL_UUID_PATTERN.source.slice(1, -1)})$`);
// ../protocol/dist/cdp-bootstrap.js

@@ -83,0 +88,0 @@ var CDP_BOOTSTRAP_MAX_REQUEST_BYTES = 16 * 1024;

@@ -86,2 +86,16 @@ #!/usr/bin/env node

// ../protocol/dist/conversation-target.js
var PANERELAY_CONVERSATION_TARGET_SESSION_PREFIX = "panerelay-tab-v1-";
var CANONICAL_UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/;
var TARGET_SESSION_PATTERN = new RegExp(`^${PANERELAY_CONVERSATION_TARGET_SESSION_PREFIX}(${CANONICAL_UUID_PATTERN.source.slice(1, -1)})-(${CANONICAL_UUID_PATTERN.source.slice(1, -1)})$`);
function isCanonicalUuid(value) {
return typeof value === "string" && CANONICAL_UUID_PATTERN.test(value);
}
function isConversationTargetHint(value) {
if (!value || typeof value !== "object" || Array.isArray(value))
return false;
const candidate = value;
return Object.keys(value).length === 2 && isCanonicalUuid(candidate.browserId) && isCanonicalUuid(candidate.targetId);
}
// ../protocol/dist/cdp-bootstrap.js

@@ -107,2 +121,8 @@ var CDP_BOOTSTRAP_MAX_REQUEST_BYTES = 16 * 1024;

}
function playwrightTargetGatewayUrl(selection) {
if (!isConversationTargetHint(selection)) {
throw new Error("Invalid Panerelay Playwright target selection");
}
return `${PANERELAY_PLAYWRIGHT_GATEWAY_URL}/target/${selectionToken(selection)}`;
}

@@ -286,4 +306,5 @@ // ../playwright/src/index.ts

playwrightGatewayUrl,
playwrightTargetGatewayUrl,
playwrightVersionInvocation,
probePlaywrightInstallation
};
{
"name": "@panerelay/setup",
"version": "0.6.0",
"version": "0.7.0",
"description": "Install and diagnose Panerelay's local integration and optional automation adapters.",

@@ -39,8 +39,8 @@ "type": "module",

"@clack/prompts": "1.2.0",
"@panerelay/browser-use": "0.6.0",
"@panerelay/bridge": "0.6.0",
"@panerelay/playwright": "0.6.0",
"@panerelay/cli": "0.6.0",
"@panerelay/protocol": "0.6.0",
"@panerelay/browser-registry": "0.6.0"
"@panerelay/browser-registry": "0.7.0",
"@panerelay/bridge": "0.7.0",
"@panerelay/cli": "0.7.0",
"@panerelay/protocol": "0.7.0",
"@panerelay/browser-use": "0.7.0",
"@panerelay/playwright": "0.7.0"
},

@@ -47,0 +47,0 @@ "devDependencies": {

@@ -18,3 +18,3 @@ # @panerelay/setup

The base command installs the Native Host and side-panel prerequisites. It does not probe an automation engine, register an agent-browser Provider, manage an Agent Skill, or change `PATH`.
The base command always installs the Native Host and side-panel prerequisites. In an interactive terminal it also offers one automation-integration selector; in non-interactive use it remains engine-neutral. Setup does not manage an Agent Skill or change `PATH`.

@@ -53,2 +53,4 @@ Agents in the side panel keep the selected project as their working directory and receive only bounded current-tab URL and title context. Browser MCP servers and Skills continue to come from the Agent's own configuration.

An unflagged interactive setup initializes its integration selector from the current protected Panerelay Provider and adapter configuration. Checked integrations are installed or updated, while unchecked integrations have only their Panerelay-owned Provider, adapter, configuration, and default artifacts removed. The upstream agent-browser, browser-use, Browser Harness, and Playwright CLI installations are never removed. The shared default answer is also initialized from current Panerelay defaults, so a later setup run reflects the state produced by the previous successful run without a separate selection cache. After the final answer, a localized timer shows that reconciliation is still running. Explicit integration flags retain additive behavior and do not remove omitted integrations.
### Explicit agent-browser integration

@@ -122,3 +124,3 @@

Omitting an action runs base `setup` and installs only the Native Messaging host and side-panel prerequisites. Add `--agent-browser`, `--browser-use`, and/or `--playwright` to install integrations explicitly.
Omitting an action runs `setup`. In an interactive terminal, the unflagged command presents the desired-state selector described above. In non-interactive use it installs only the Native Messaging host and side-panel prerequisites. Add `--agent-browser`, `--browser-use`, and/or `--playwright` to install integrations explicitly without removing omitted integrations.

@@ -125,0 +127,0 @@ ```bash