@redplanethq/corebrain 2.5.11 → 2.5.12
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/package.json +1 -1
- package/dist/assets/assets/AppIcon.icns +0 -0
- package/dist/server/tools/healthkit-tools.d.ts +0 -29
- package/dist/server/tools/healthkit-tools.d.ts.map +0 -1
- package/dist/server/tools/healthkit-tools.js +0 -192
- package/dist/server/tools/healthkit-tools.js.map +0 -1
- package/dist/utils/browser-use.d.ts +0 -57
- package/dist/utils/browser-use.d.ts.map +0 -1
- package/dist/utils/browser-use.js +0 -212
- package/dist/utils/browser-use.js.map +0 -1
package/package.json
CHANGED
|
Binary file
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import zod from 'zod';
|
|
2
|
-
import type { GatewayTool } from '../../server/tools/browser-tools.js';
|
|
3
|
-
export declare function isHealthKitBinaryInstalled(): boolean;
|
|
4
|
-
export declare const HealthKitWorkoutsSchema: zod.ZodObject<{
|
|
5
|
-
limit: zod.ZodDefault<zod.ZodOptional<zod.ZodNumber>>;
|
|
6
|
-
start: zod.ZodOptional<zod.ZodString>;
|
|
7
|
-
end: zod.ZodOptional<zod.ZodString>;
|
|
8
|
-
}, zod.core.$strip>;
|
|
9
|
-
export declare const HealthKitHeartRateSchema: zod.ZodObject<{
|
|
10
|
-
limit: zod.ZodDefault<zod.ZodOptional<zod.ZodNumber>>;
|
|
11
|
-
start: zod.ZodOptional<zod.ZodString>;
|
|
12
|
-
end: zod.ZodOptional<zod.ZodString>;
|
|
13
|
-
}, zod.core.$strip>;
|
|
14
|
-
export declare const HealthKitStepsSchema: zod.ZodObject<{
|
|
15
|
-
start: zod.ZodOptional<zod.ZodString>;
|
|
16
|
-
end: zod.ZodOptional<zod.ZodString>;
|
|
17
|
-
}, zod.core.$strip>;
|
|
18
|
-
export declare const HealthKitSleepSchema: zod.ZodObject<{
|
|
19
|
-
limit: zod.ZodDefault<zod.ZodOptional<zod.ZodNumber>>;
|
|
20
|
-
start: zod.ZodOptional<zod.ZodString>;
|
|
21
|
-
end: zod.ZodOptional<zod.ZodString>;
|
|
22
|
-
}, zod.core.$strip>;
|
|
23
|
-
export declare const healthkitTools: GatewayTool[];
|
|
24
|
-
export declare function executeHealthKitTool(toolName: string, params: Record<string, unknown>): Promise<{
|
|
25
|
-
success: boolean;
|
|
26
|
-
result?: unknown;
|
|
27
|
-
error?: string;
|
|
28
|
-
}>;
|
|
29
|
-
//# sourceMappingURL=healthkit-tools.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"healthkit-tools.d.ts","sourceRoot":"","sources":["../../../src/server/tools/healthkit-tools.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AAItB,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAY9D,wBAAgB,0BAA0B,IAAI,OAAO,CAEpD;AAID,eAAO,MAAM,uBAAuB;;;;mBAIlC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;mBAInC,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;mBAG/B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;mBAI/B,CAAC;AA4CH,eAAO,MAAM,cAAc,EAAE,WAAW,EAqBvC,CAAC;AAuDF,wBAAsB,oBAAoB,CACzC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC7B,OAAO,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAC,CAAC,CAmD/D"}
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import zod from 'zod';
|
|
2
|
-
import { spawn } from 'node:child_process';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { existsSync } from 'node:fs';
|
|
5
|
-
// ============ Binary path ============
|
|
6
|
-
const BINARY_PATH = join('/Applications', 'CoreBrainGateway.app', 'Contents', 'MacOS', 'CoreBrainHealthKit');
|
|
7
|
-
export function isHealthKitBinaryInstalled() {
|
|
8
|
-
return existsSync(BINARY_PATH);
|
|
9
|
-
}
|
|
10
|
-
// ============ Zod Schemas ============
|
|
11
|
-
export const HealthKitWorkoutsSchema = zod.object({
|
|
12
|
-
limit: zod.number().optional().default(10).describe('Number of workouts to return (default: 10)'),
|
|
13
|
-
start: zod.string().optional().describe('Start date filter (ISO 8601 or YYYY-MM-DD)'),
|
|
14
|
-
end: zod.string().optional().describe('End date filter (ISO 8601 or YYYY-MM-DD)'),
|
|
15
|
-
});
|
|
16
|
-
export const HealthKitHeartRateSchema = zod.object({
|
|
17
|
-
limit: zod.number().optional().default(50).describe('Number of readings to return (default: 50)'),
|
|
18
|
-
start: zod.string().optional().describe('Start date filter (ISO 8601 or YYYY-MM-DD)'),
|
|
19
|
-
end: zod.string().optional().describe('End date filter (ISO 8601 or YYYY-MM-DD)'),
|
|
20
|
-
});
|
|
21
|
-
export const HealthKitStepsSchema = zod.object({
|
|
22
|
-
start: zod.string().optional().describe('Start date (ISO 8601 or YYYY-MM-DD, default: 7 days ago)'),
|
|
23
|
-
end: zod.string().optional().describe('End date (ISO 8601 or YYYY-MM-DD, default: now)'),
|
|
24
|
-
});
|
|
25
|
-
export const HealthKitSleepSchema = zod.object({
|
|
26
|
-
limit: zod.number().optional().default(50).describe('Number of sleep records to return (default: 50)'),
|
|
27
|
-
start: zod.string().optional().describe('Start date filter (ISO 8601 or YYYY-MM-DD)'),
|
|
28
|
-
end: zod.string().optional().describe('End date filter (ISO 8601 or YYYY-MM-DD)'),
|
|
29
|
-
});
|
|
30
|
-
// ============ JSON Schemas ============
|
|
31
|
-
const jsonSchemas = {
|
|
32
|
-
healthkit_workouts: {
|
|
33
|
-
type: 'object',
|
|
34
|
-
properties: {
|
|
35
|
-
limit: { type: 'number', description: 'Number of workouts to return (default: 10)' },
|
|
36
|
-
start: { type: 'string', description: 'Start date filter (ISO 8601 or YYYY-MM-DD)' },
|
|
37
|
-
end: { type: 'string', description: 'End date filter (ISO 8601 or YYYY-MM-DD)' },
|
|
38
|
-
},
|
|
39
|
-
required: [],
|
|
40
|
-
},
|
|
41
|
-
healthkit_heart_rate: {
|
|
42
|
-
type: 'object',
|
|
43
|
-
properties: {
|
|
44
|
-
limit: { type: 'number', description: 'Number of readings to return (default: 50)' },
|
|
45
|
-
start: { type: 'string', description: 'Start date filter (ISO 8601 or YYYY-MM-DD)' },
|
|
46
|
-
end: { type: 'string', description: 'End date filter (ISO 8601 or YYYY-MM-DD)' },
|
|
47
|
-
},
|
|
48
|
-
required: [],
|
|
49
|
-
},
|
|
50
|
-
healthkit_steps: {
|
|
51
|
-
type: 'object',
|
|
52
|
-
properties: {
|
|
53
|
-
start: { type: 'string', description: 'Start date (default: 7 days ago)' },
|
|
54
|
-
end: { type: 'string', description: 'End date (default: now)' },
|
|
55
|
-
},
|
|
56
|
-
required: [],
|
|
57
|
-
},
|
|
58
|
-
healthkit_sleep: {
|
|
59
|
-
type: 'object',
|
|
60
|
-
properties: {
|
|
61
|
-
limit: { type: 'number', description: 'Number of sleep records to return (default: 50)' },
|
|
62
|
-
start: { type: 'string', description: 'Start date filter (ISO 8601 or YYYY-MM-DD)' },
|
|
63
|
-
end: { type: 'string', description: 'End date filter (ISO 8601 or YYYY-MM-DD)' },
|
|
64
|
-
},
|
|
65
|
-
required: [],
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
// ============ Tool Definitions ============
|
|
69
|
-
export const healthkitTools = [
|
|
70
|
-
{
|
|
71
|
-
name: 'healthkit_workouts',
|
|
72
|
-
description: 'Get recent workouts/fitness sessions from HealthKit. Returns type, duration, calories, distance.',
|
|
73
|
-
inputSchema: jsonSchemas.healthkit_workouts,
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
name: 'healthkit_heart_rate',
|
|
77
|
-
description: 'Get heart rate readings from HealthKit.',
|
|
78
|
-
inputSchema: jsonSchemas.healthkit_heart_rate,
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
name: 'healthkit_steps',
|
|
82
|
-
description: 'Get step count for a date range from HealthKit.',
|
|
83
|
-
inputSchema: jsonSchemas.healthkit_steps,
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
name: 'healthkit_sleep',
|
|
87
|
-
description: 'Get sleep analysis records from HealthKit (inBed, core, deep, rem, awake).',
|
|
88
|
-
inputSchema: jsonSchemas.healthkit_sleep,
|
|
89
|
-
},
|
|
90
|
-
];
|
|
91
|
-
// ============ Binary runner ============
|
|
92
|
-
function runBinary(command, args) {
|
|
93
|
-
return new Promise((resolve, reject) => {
|
|
94
|
-
if (!isHealthKitBinaryInstalled()) {
|
|
95
|
-
reject(new Error('CoreBrainHealthKit binary not found. Run: cd packages/cli/src/swift && ./build-healthkit.sh YOUR_TEAM_ID'));
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
const proc = spawn(BINARY_PATH, [command, ...args], {
|
|
99
|
-
stdio: ['ignore', 'pipe', 'pipe'],
|
|
100
|
-
});
|
|
101
|
-
let stdout = '';
|
|
102
|
-
let stderr = '';
|
|
103
|
-
proc.stdout.on('data', (d) => { stdout += d.toString(); });
|
|
104
|
-
proc.stderr.on('data', (d) => { stderr += d.toString(); });
|
|
105
|
-
proc.on('close', (code, signal) => {
|
|
106
|
-
if (stdout.trim()) {
|
|
107
|
-
try {
|
|
108
|
-
const parsed = JSON.parse(stdout.trim());
|
|
109
|
-
if (parsed.error) {
|
|
110
|
-
reject(new Error(parsed.error));
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
resolve(parsed);
|
|
114
|
-
}
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
catch {
|
|
118
|
-
reject(new Error(`Failed to parse HealthKit output: ${stdout}`));
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
if (code !== 0 || signal) {
|
|
123
|
-
reject(new Error(`HealthKit binary exited with code ${code} signal ${signal}: ${stderr}`));
|
|
124
|
-
}
|
|
125
|
-
else {
|
|
126
|
-
resolve({});
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
proc.on('error', (err) => {
|
|
130
|
-
reject(new Error(`Failed to spawn HealthKit binary: ${err.message}`));
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
}
|
|
134
|
-
// ============ Tool Execution ============
|
|
135
|
-
export async function executeHealthKitTool(toolName, params) {
|
|
136
|
-
try {
|
|
137
|
-
switch (toolName) {
|
|
138
|
-
case 'healthkit_workouts': {
|
|
139
|
-
const p = HealthKitWorkoutsSchema.parse(params);
|
|
140
|
-
const args = ['--limit', String(p.limit)];
|
|
141
|
-
if (p.start)
|
|
142
|
-
args.push('--start', p.start);
|
|
143
|
-
if (p.end)
|
|
144
|
-
args.push('--end', p.end);
|
|
145
|
-
const result = await runBinary('workouts', args);
|
|
146
|
-
return { success: true, result };
|
|
147
|
-
}
|
|
148
|
-
case 'healthkit_heart_rate': {
|
|
149
|
-
const p = HealthKitHeartRateSchema.parse(params);
|
|
150
|
-
const args = ['--limit', String(p.limit)];
|
|
151
|
-
if (p.start)
|
|
152
|
-
args.push('--start', p.start);
|
|
153
|
-
if (p.end)
|
|
154
|
-
args.push('--end', p.end);
|
|
155
|
-
const result = await runBinary('heart_rate', args);
|
|
156
|
-
return { success: true, result };
|
|
157
|
-
}
|
|
158
|
-
case 'healthkit_steps': {
|
|
159
|
-
const p = HealthKitStepsSchema.parse(params);
|
|
160
|
-
const args = [];
|
|
161
|
-
if (p.start)
|
|
162
|
-
args.push('--start', p.start);
|
|
163
|
-
if (p.end)
|
|
164
|
-
args.push('--end', p.end);
|
|
165
|
-
const result = await runBinary('steps', args);
|
|
166
|
-
return { success: true, result };
|
|
167
|
-
}
|
|
168
|
-
case 'healthkit_sleep': {
|
|
169
|
-
const p = HealthKitSleepSchema.parse(params);
|
|
170
|
-
const args = ['--limit', String(p.limit)];
|
|
171
|
-
if (p.start)
|
|
172
|
-
args.push('--start', p.start);
|
|
173
|
-
if (p.end)
|
|
174
|
-
args.push('--end', p.end);
|
|
175
|
-
const result = await runBinary('sleep', args);
|
|
176
|
-
return { success: true, result };
|
|
177
|
-
}
|
|
178
|
-
default:
|
|
179
|
-
return { success: false, error: `Unknown tool: ${toolName}` };
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
catch (err) {
|
|
183
|
-
if (err instanceof zod.ZodError) {
|
|
184
|
-
return { success: false, error: `Invalid parameters: ${err.message}` };
|
|
185
|
-
}
|
|
186
|
-
return {
|
|
187
|
-
success: false,
|
|
188
|
-
error: err instanceof Error ? err.message : 'Unknown error',
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
//# sourceMappingURL=healthkit-tools.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"healthkit-tools.js","sourceRoot":"","sources":["../../../src/server/tools/healthkit-tools.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAC,KAAK,EAAC,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAGnC,wCAAwC;AAExC,MAAM,WAAW,GAAG,IAAI,CACvB,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,OAAO,EACP,oBAAoB,CACpB,CAAC;AAEF,MAAM,UAAU,0BAA0B;IACzC,OAAO,UAAU,CAAC,WAAW,CAAC,CAAC;AAChC,CAAC;AAED,wCAAwC;AAExC,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC,MAAM,CAAC;IACjD,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,4CAA4C,CAAC;IACjG,KAA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KAAK,EAAE,KAAK,EAAE,uBAAuB,GAAG,CAAC,OAAO,EAAE,EAAC,CAAC;QACtE,CAAC;QACD,OAAO;YACN,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;SAC3D,CAAC;IACH,CAAC;AACF,CAAC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
export interface CommandResult {
|
|
2
|
-
stdout: string;
|
|
3
|
-
stderr: string;
|
|
4
|
-
code: number;
|
|
5
|
-
}
|
|
6
|
-
export declare function clearBinaryPathCache(): void;
|
|
7
|
-
export declare function isBrowserUseInstalled(): Promise<boolean>;
|
|
8
|
-
/**
|
|
9
|
-
* Install browser-use using the official installer
|
|
10
|
-
*/
|
|
11
|
-
export declare function installBrowserUse(): Promise<CommandResult>;
|
|
12
|
-
/**
|
|
13
|
-
* Run browser-use doctor to validate installation
|
|
14
|
-
*/
|
|
15
|
-
export declare function runBrowserUseDoctor(): Promise<CommandResult>;
|
|
16
|
-
export interface SessionInfo {
|
|
17
|
-
name: string;
|
|
18
|
-
status?: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* List all available sessions using browser-use sessions command
|
|
22
|
-
*/
|
|
23
|
-
export declare function listSessions(): Promise<string[]>;
|
|
24
|
-
/**
|
|
25
|
-
* Check if a session exists
|
|
26
|
-
*/
|
|
27
|
-
export declare function sessionExists(name: string): Promise<boolean>;
|
|
28
|
-
/**
|
|
29
|
-
* Open a browser with URL using the specified session
|
|
30
|
-
*/
|
|
31
|
-
export declare function browserOpen(url: string, sessionName?: string, headed?: boolean): Promise<CommandResult>;
|
|
32
|
-
/**
|
|
33
|
-
* Close a browser for the specified session
|
|
34
|
-
*/
|
|
35
|
-
export declare function browserClose(sessionName: string): Promise<CommandResult>;
|
|
36
|
-
/**
|
|
37
|
-
* Close all browser sessions
|
|
38
|
-
*/
|
|
39
|
-
export declare function browserCloseAll(): Promise<CommandResult>;
|
|
40
|
-
/**
|
|
41
|
-
* Check if a command is blocked
|
|
42
|
-
*/
|
|
43
|
-
export declare function isBlockedCommand(command: string): boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Execute a generic browser command on a session
|
|
46
|
-
* Blocks: open, close, cookies, storage, network, download, run, session, task, tunnel
|
|
47
|
-
*/
|
|
48
|
-
export declare function browserCommand(sessionName: string, command: string, args?: string[]): Promise<CommandResult>;
|
|
49
|
-
/**
|
|
50
|
-
* Get all available sessions
|
|
51
|
-
*/
|
|
52
|
-
export declare function browserGetSessions(): Promise<string[]>;
|
|
53
|
-
/**
|
|
54
|
-
* Get server status
|
|
55
|
-
*/
|
|
56
|
-
export declare function getServerStatus(): Promise<CommandResult>;
|
|
57
|
-
//# sourceMappingURL=browser-use.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser-use.d.ts","sourceRoot":"","sources":["../../src/utils/browser-use.ts"],"names":[],"mappings":"AAoBA,MAAM,WAAW,aAAa;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACb;AAgCD,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,CAE9D;AAED;;GAEG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,aAAa,CAAC,CAahE;AAED;;GAEG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,aAAa,CAAC,CAElE;AAsFD,MAAM,WAAW,WAAW;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,wBAAsB,YAAY,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBtD;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGlE;AAID;;GAEG;AACH,wBAAsB,WAAW,CAChC,GAAG,EAAE,MAAM,EACX,WAAW,GAAE,MAAkB,EAC/B,MAAM,GAAE,OAAe,GACrB,OAAO,CAAC,aAAa,CAAC,CAGxB;AAED;;GAEG;AACH,wBAAsB,YAAY,CACjC,WAAW,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC,CAExB;AAED;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,aAAa,CAAC,CAE9D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGzD;AAED;;;GAGG;AACH,wBAAsB,cAAc,CACnC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,MAAM,EAAO,GACjB,OAAO,CAAC,aAAa,CAAC,CAaxB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAE5D;AAED;;GAEG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,aAAa,CAAC,CAE9D"}
|
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
import { spawn, execSync } from 'node:child_process';
|
|
2
|
-
// Constants
|
|
3
|
-
const BINARY_NAME = 'browser-use';
|
|
4
|
-
// Blocked commands that cannot be run via browser_command
|
|
5
|
-
// Updated for browser-use CLI
|
|
6
|
-
const BLOCKED_COMMANDS = [
|
|
7
|
-
'open',
|
|
8
|
-
'close',
|
|
9
|
-
'cookies',
|
|
10
|
-
'storage',
|
|
11
|
-
'network',
|
|
12
|
-
'download',
|
|
13
|
-
'run', // agent tasks
|
|
14
|
-
'session', // session management
|
|
15
|
-
'task', // task commands
|
|
16
|
-
'tunnel', // tunneling
|
|
17
|
-
];
|
|
18
|
-
// ============ Installation ============
|
|
19
|
-
/**
|
|
20
|
-
* Get the browser-use binary path (cross-platform)
|
|
21
|
-
*/
|
|
22
|
-
function getBrowserUsePath() {
|
|
23
|
-
try {
|
|
24
|
-
const command = process.platform === 'win32'
|
|
25
|
-
? `where ${BINARY_NAME}`
|
|
26
|
-
: `which ${BINARY_NAME}`;
|
|
27
|
-
const result = execSync(command, { stdio: 'pipe', encoding: 'utf-8' });
|
|
28
|
-
const path = result.trim().split('\n')[0]; // Take first result on Windows (where can return multiple)
|
|
29
|
-
return path || null;
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
// Cache the binary path
|
|
36
|
-
let cachedBinaryPath;
|
|
37
|
-
function getBinaryPath() {
|
|
38
|
-
if (cachedBinaryPath === undefined) {
|
|
39
|
-
cachedBinaryPath = getBrowserUsePath();
|
|
40
|
-
}
|
|
41
|
-
return cachedBinaryPath;
|
|
42
|
-
}
|
|
43
|
-
// Clear cache (useful after installation)
|
|
44
|
-
export function clearBinaryPathCache() {
|
|
45
|
-
cachedBinaryPath = undefined;
|
|
46
|
-
}
|
|
47
|
-
export async function isBrowserUseInstalled() {
|
|
48
|
-
return getBinaryPath() !== null;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Install browser-use using the official installer
|
|
52
|
-
*/
|
|
53
|
-
export async function installBrowserUse() {
|
|
54
|
-
const isWindows = process.platform === 'win32';
|
|
55
|
-
// Use the official browser-use installer
|
|
56
|
-
const installCommand = isWindows
|
|
57
|
-
? `& "C:\Program Files\Git\bin\bash.exe" -c 'curl -fsSL https://browser-use.com/cli/install.sh | bash -s -- --full'`
|
|
58
|
-
: 'curl -fsSL https://browser-use.com/cli/install.sh | bash -s -- --full # All modes';
|
|
59
|
-
const result = await runShellCommand(installCommand);
|
|
60
|
-
// Clear cache so next check finds the newly installed binary
|
|
61
|
-
clearBinaryPathCache();
|
|
62
|
-
return result;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Run browser-use doctor to validate installation
|
|
66
|
-
*/
|
|
67
|
-
export async function runBrowserUseDoctor() {
|
|
68
|
-
return runBrowserUseRawCommand(['doctor']);
|
|
69
|
-
}
|
|
70
|
-
function runShellCommand(command) {
|
|
71
|
-
return new Promise(resolve => {
|
|
72
|
-
const proc = spawn(command, [], {
|
|
73
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
74
|
-
shell: true,
|
|
75
|
-
});
|
|
76
|
-
let stdout = '';
|
|
77
|
-
let stderr = '';
|
|
78
|
-
proc.stdout?.on('data', data => {
|
|
79
|
-
stdout += data.toString();
|
|
80
|
-
});
|
|
81
|
-
proc.stderr?.on('data', data => {
|
|
82
|
-
stderr += data.toString();
|
|
83
|
-
});
|
|
84
|
-
proc.on('close', code => {
|
|
85
|
-
resolve({ stdout, stderr, code: code ?? 0 });
|
|
86
|
-
});
|
|
87
|
-
proc.on('error', err => {
|
|
88
|
-
resolve({ stdout, stderr: err.message, code: 1 });
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
// ============ Core Browser Command Runner ============
|
|
93
|
-
/**
|
|
94
|
-
* Run a raw browser-use command without session
|
|
95
|
-
*/
|
|
96
|
-
async function runBrowserUseRawCommand(args) {
|
|
97
|
-
const binaryPath = getBinaryPath();
|
|
98
|
-
if (!binaryPath) {
|
|
99
|
-
return {
|
|
100
|
-
stdout: '',
|
|
101
|
-
stderr: 'browser-use not found. Run: corebrain browser install',
|
|
102
|
-
code: 1,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
return new Promise(resolve => {
|
|
106
|
-
const proc = spawn(binaryPath, args, {
|
|
107
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
108
|
-
});
|
|
109
|
-
let stdout = '';
|
|
110
|
-
let stderr = '';
|
|
111
|
-
proc.stdout?.on('data', data => {
|
|
112
|
-
stdout += data.toString();
|
|
113
|
-
});
|
|
114
|
-
proc.stderr?.on('data', data => {
|
|
115
|
-
stderr += data.toString();
|
|
116
|
-
});
|
|
117
|
-
proc.on('close', code => {
|
|
118
|
-
resolve({ stdout, stderr, code: code ?? 0 });
|
|
119
|
-
});
|
|
120
|
-
proc.on('error', err => {
|
|
121
|
-
resolve({ stdout, stderr: err.message, code: 1 });
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* Run a browser-use command with session
|
|
127
|
-
* browser-use --session <name> <command> <args>
|
|
128
|
-
*/
|
|
129
|
-
async function runBrowserUseCommand(sessionName, args) {
|
|
130
|
-
// Use --session for persistent session state
|
|
131
|
-
const fullArgs = ['--session', sessionName, ...args];
|
|
132
|
-
return runBrowserUseRawCommand(fullArgs);
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* List all available sessions using browser-use sessions command
|
|
136
|
-
*/
|
|
137
|
-
export async function listSessions() {
|
|
138
|
-
const result = await runBrowserUseRawCommand(['sessions']);
|
|
139
|
-
if (result.code !== 0) {
|
|
140
|
-
return [];
|
|
141
|
-
}
|
|
142
|
-
// Parse output - each line is a session name
|
|
143
|
-
// browser-use sessions outputs one session per line
|
|
144
|
-
const sessions = result.stdout
|
|
145
|
-
.trim()
|
|
146
|
-
.split('\n')
|
|
147
|
-
.map(line => line.trim())
|
|
148
|
-
.filter(line => line.length > 0 && !line.startsWith('No '));
|
|
149
|
-
return sessions;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Check if a session exists
|
|
153
|
-
*/
|
|
154
|
-
export async function sessionExists(name) {
|
|
155
|
-
const sessions = await listSessions();
|
|
156
|
-
return sessions.includes(name);
|
|
157
|
-
}
|
|
158
|
-
// ============ Browser Operations ============
|
|
159
|
-
/**
|
|
160
|
-
* Open a browser with URL using the specified session
|
|
161
|
-
*/
|
|
162
|
-
export async function browserOpen(url, sessionName = 'default', headed = false) {
|
|
163
|
-
const args = headed ? ['--headed', 'open', url] : ['open', url];
|
|
164
|
-
return runBrowserUseCommand(sessionName, args);
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Close a browser for the specified session
|
|
168
|
-
*/
|
|
169
|
-
export async function browserClose(sessionName) {
|
|
170
|
-
return runBrowserUseCommand(sessionName, ['close']);
|
|
171
|
-
}
|
|
172
|
-
/**
|
|
173
|
-
* Close all browser sessions
|
|
174
|
-
*/
|
|
175
|
-
export async function browserCloseAll() {
|
|
176
|
-
return runBrowserUseRawCommand(['close', '--all']);
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Check if a command is blocked
|
|
180
|
-
*/
|
|
181
|
-
export function isBlockedCommand(command) {
|
|
182
|
-
const cmd = command.toLowerCase().trim();
|
|
183
|
-
return BLOCKED_COMMANDS.includes(cmd);
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Execute a generic browser command on a session
|
|
187
|
-
* Blocks: open, close, cookies, storage, network, download, run, session, task, tunnel
|
|
188
|
-
*/
|
|
189
|
-
export async function browserCommand(sessionName, command, args = []) {
|
|
190
|
-
// Check if command is blocked
|
|
191
|
-
if (isBlockedCommand(command)) {
|
|
192
|
-
return {
|
|
193
|
-
stdout: '',
|
|
194
|
-
stderr: `Command "${command}" is blocked. Blocked commands: ${BLOCKED_COMMANDS.join(', ')}`,
|
|
195
|
-
code: 1,
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
return runBrowserUseCommand(sessionName, [command, ...args]);
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Get all available sessions
|
|
202
|
-
*/
|
|
203
|
-
export async function browserGetSessions() {
|
|
204
|
-
return listSessions();
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Get server status
|
|
208
|
-
*/
|
|
209
|
-
export async function getServerStatus() {
|
|
210
|
-
return runBrowserUseRawCommand(['server', 'status']);
|
|
211
|
-
}
|
|
212
|
-
//# sourceMappingURL=browser-use.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"browser-use.js","sourceRoot":"","sources":["../../src/utils/browser-use.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,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