@agentproto/adapter-browser 0.1.0-alpha.0 → 0.1.1
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/LICENSE +202 -21
- package/dist/index.d.ts +22 -0
- package/dist/index.mjs +14 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/LICENSE
CHANGED
|
@@ -1,21 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/dist/index.d.ts
CHANGED
|
@@ -134,6 +134,20 @@ interface BrowserAdapterStartOptions {
|
|
|
134
134
|
* Required (and only used) when `location === "cloud"`.
|
|
135
135
|
*/
|
|
136
136
|
baseUrl?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Override the binary path used for the local spawn.
|
|
139
|
+
* When set, takes precedence over the adapter's own resolved binary path.
|
|
140
|
+
* Only used on the local path (`location !== "cloud"`).
|
|
141
|
+
*/
|
|
142
|
+
binPath?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Opt-in non-blocking cold start. When set, `ensure` waits only this many
|
|
145
|
+
* milliseconds for the freshly-spawned service to become healthy. If it does
|
|
146
|
+
* not, `ensure` returns promptly with `status: "starting"` while health
|
|
147
|
+
* convergence continues in the background. When unset (default), `ensure`
|
|
148
|
+
* blocks up to `timeoutMs` (existing behaviour).
|
|
149
|
+
*/
|
|
150
|
+
initialWaitMs?: number;
|
|
137
151
|
}
|
|
138
152
|
interface BrowserAdapterInstance {
|
|
139
153
|
id: string;
|
|
@@ -145,6 +159,14 @@ interface BrowserAdapterInstance {
|
|
|
145
159
|
*/
|
|
146
160
|
pid?: number;
|
|
147
161
|
wasAlreadyRunning: boolean;
|
|
162
|
+
/**
|
|
163
|
+
* Whether the service is confirmed healthy at return time. Always true on
|
|
164
|
+
* the warm path and on a blocking cold start. Only `false` when
|
|
165
|
+
* `opts.initialWaitMs` was set and the service had not converged within the
|
|
166
|
+
* bounded window — health-wait continues in the background and
|
|
167
|
+
* `browser_status` / `list_browsers` will flip it to running once up.
|
|
168
|
+
*/
|
|
169
|
+
healthy: boolean;
|
|
148
170
|
/**
|
|
149
171
|
* Best-effort stop. Sends SIGTERM to `pid` if known; otherwise a no-op
|
|
150
172
|
* (externally-managed services must be stopped via their own manager).
|
package/dist/index.mjs
CHANGED
|
@@ -59,7 +59,8 @@ async function resolveLaunch(cfg) {
|
|
|
59
59
|
launch: () => null,
|
|
60
60
|
timeoutMs,
|
|
61
61
|
intervalMs: 1e3,
|
|
62
|
-
log
|
|
62
|
+
log,
|
|
63
|
+
...opts.initialWaitMs !== void 0 ? { initialWaitMs: opts.initialWaitMs } : {}
|
|
63
64
|
});
|
|
64
65
|
return {
|
|
65
66
|
id: handle.id,
|
|
@@ -67,6 +68,7 @@ async function resolveLaunch(cfg) {
|
|
|
67
68
|
baseUrl: result2.baseUrl,
|
|
68
69
|
pid: void 0,
|
|
69
70
|
wasAlreadyRunning: result2.wasAlreadyRunning,
|
|
71
|
+
healthy: result2.healthy,
|
|
70
72
|
stop: async () => {
|
|
71
73
|
}
|
|
72
74
|
};
|
|
@@ -83,16 +85,17 @@ async function resolveLaunch(cfg) {
|
|
|
83
85
|
`[${label}] service is not running on :${port} and no launch command is available.${platformHint}`
|
|
84
86
|
);
|
|
85
87
|
}
|
|
86
|
-
|
|
88
|
+
const cmdFile = opts.binPath ?? cmd.file;
|
|
89
|
+
log?.(`[${label}] starting: ${[cmdFile, ...cmd.args].join(" ")}`);
|
|
87
90
|
if (cmd.isLaunchctl) {
|
|
88
|
-
spawn(
|
|
91
|
+
spawn(cmdFile, cmd.args, {
|
|
89
92
|
detached: true,
|
|
90
93
|
stdio: "ignore",
|
|
91
94
|
env: { ...process.env, ...persistedEnv, ...opts.env, ...resolvedExtraEnv }
|
|
92
95
|
}).unref();
|
|
93
96
|
return null;
|
|
94
97
|
}
|
|
95
|
-
const child = spawn(
|
|
98
|
+
const child = spawn(cmdFile, cmd.args, {
|
|
96
99
|
detached: true,
|
|
97
100
|
stdio: "ignore",
|
|
98
101
|
env: { ...process.env, ...persistedEnv, ...opts.env, ...resolvedExtraEnv },
|
|
@@ -103,7 +106,8 @@ async function resolveLaunch(cfg) {
|
|
|
103
106
|
},
|
|
104
107
|
timeoutMs,
|
|
105
108
|
intervalMs: 1e3,
|
|
106
|
-
log
|
|
109
|
+
log,
|
|
110
|
+
...opts.initialWaitMs !== void 0 ? { initialWaitMs: opts.initialWaitMs } : {}
|
|
107
111
|
});
|
|
108
112
|
return {
|
|
109
113
|
id: handle.id,
|
|
@@ -111,6 +115,7 @@ async function resolveLaunch(cfg) {
|
|
|
111
115
|
baseUrl: result.baseUrl,
|
|
112
116
|
pid: result.pid,
|
|
113
117
|
wasAlreadyRunning: result.wasAlreadyRunning,
|
|
118
|
+
healthy: result.healthy,
|
|
114
119
|
stop: makeStop(result.pid, cfg.killProcessGroup ?? false)
|
|
115
120
|
};
|
|
116
121
|
}
|
|
@@ -234,13 +239,13 @@ function resolveCmd2(launchCmd, env, log) {
|
|
|
234
239
|
const envCmd = env?.CHROMIUM_SERVE_CMD ?? process.env.CHROMIUM_SERVE_CMD;
|
|
235
240
|
if (envCmd) return { file: "/bin/sh", args: ["-c", envCmd] };
|
|
236
241
|
const cwd = resolveCwd(env, log);
|
|
237
|
-
return { file: "/bin/sh", args: ["-c", "pnpm --filter=@browser
|
|
242
|
+
return { file: "/bin/sh", args: ["-c", "pnpm --filter=@agstudio/browser-service start"], cwd };
|
|
238
243
|
}
|
|
239
244
|
function resolveCwd(env, log) {
|
|
240
245
|
const explicit = env?.CHROMIUM_SERVE_CWD ?? process.env.CHROMIUM_SERVE_CWD;
|
|
241
246
|
if (explicit) return explicit;
|
|
242
247
|
log?.(
|
|
243
|
-
"[chromium] warning: CHROMIUM_SERVE_CWD is not set; relying on daemon cwd for `pnpm --filter=@browser
|
|
248
|
+
"[chromium] warning: CHROMIUM_SERVE_CWD is not set; relying on daemon cwd for `pnpm --filter=@agstudio/browser-service start`. Set CHROMIUM_SERVE_CWD or run the daemon from the repo root, or override with CHROMIUM_SERVE_CMD."
|
|
244
249
|
);
|
|
245
250
|
return void 0;
|
|
246
251
|
}
|
|
@@ -254,7 +259,7 @@ var chromiumAdapter = {
|
|
|
254
259
|
install: [
|
|
255
260
|
{
|
|
256
261
|
method: "path"
|
|
257
|
-
// Local: `pnpm --filter=@browser
|
|
262
|
+
// Local: `pnpm --filter=@agstudio/browser-service start` from the monorepo root,
|
|
258
263
|
// or set CHROMIUM_SERVE_CMD / CHROMIUM_SERVE_CWD to point at a custom launcher.
|
|
259
264
|
// Cloud variant (future — not yet wired into ensure):
|
|
260
265
|
// method: "cloud", url: process.env.BROWSER_SERVICE_URL, secret: "BROWSER_SERVICE_KEY"
|
|
@@ -264,7 +269,7 @@ var chromiumAdapter = {
|
|
|
264
269
|
{
|
|
265
270
|
id: "chromium-serve-cmd",
|
|
266
271
|
kind: "prompt",
|
|
267
|
-
prompt: "Shell command to start the browser service (default: pnpm --filter=@browser
|
|
272
|
+
prompt: "Shell command to start the browser service (default: pnpm --filter=@agstudio/browser-service start)",
|
|
268
273
|
description: "Override CHROMIUM_SERVE_CMD. When blank, the default pnpm filter command is used and CHROMIUM_SERVE_CWD must point to the monorepo root.",
|
|
269
274
|
type: "text",
|
|
270
275
|
persist: { env: "CHROMIUM_SERVE_CMD" }
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/lib/resolve-launch.ts","../src/adapters/camofox.ts","../src/adapters/bureau.ts","../src/adapters/chromium.ts","../src/index.ts"],"names":["result","platform","resolveCmd"],"mappings":";;;;;;;;;;;AAgBA,eAAe,iBAAiB,SAAA,EAAoD;AAClF,EAAA,MAAM,IAAA,GAAO,QAAQ,GAAA,CAAI,iBAAiB,KAAK,IAAA,CAAK,OAAA,IAAW,aAAa,CAAA;AAC5E,EAAA,MAAM,aAAa,IAAA,CAAK,IAAA,EAAM,kBAAA,EAAoB,CAAA,EAAG,SAAS,CAAA,KAAA,CAAO,CAAA;AACrE,EAAA,IAAI;AACF,IAAA,MAAM,GAAA,GAAM,MAAM,QAAA,CAAS,UAAA,EAAY,MAAM,CAAA;AAC7C,IAAA,MAAM,MAAA,GAAS,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA;AAC7B,IAAA,OAAO,MAAA,CAAO,aAAa,EAAC;AAAA,EAC9B,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,EAAC;AAAA,EACV;AACF;AA2CA,SAAS,QAAA,CAAS,KAAyB,YAAA,EAA4C;AACrF,EAAA,OAAO,YAAY;AACjB,IAAA,IAAI,CAAC,GAAA,EAAK;AACV,IAAA,IAAI,YAAA,EAAc;AAChB,MAAA,IAAI;AACF,QAAA,OAAA,CAAQ,IAAA,CAAK,CAAC,GAAA,EAAK,SAAS,CAAA;AAC5B,QAAA;AAAA,MACF,CAAA,CAAA,MAAQ;AAAA,MAER;AAAA,IACF;AACA,IAAA,IAAI;AACF,MAAA,OAAA,CAAQ,IAAA,CAAK,KAAK,SAAS,CAAA;AAAA,IAC7B,CAAA,CAAA,MAAQ;AAAA,IAER;AAAA,EACF,CAAA;AACF;AAYA,eAAsB,cAAc,GAAA,EAA2D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","sourcesContent":["import { spawn } from \"node:child_process\"\nimport { platform, homedir } from \"node:os\"\nimport { join } from \"node:path\"\nimport { readFile } from \"node:fs/promises\"\nimport { ensureBrowserProcess } from \"@agentproto/browser-process\"\nimport type { BrowserAdapterHandle, BrowserAdapterStartOptions, BrowserAdapterInstance } from \"../types.js\"\n\n// ── Persisted config ledger ───────────────────────────────────────────────────\n\n/**\n * Best-effort read of the persisted env values written by\n * `agentproto browser install`. Returns `{}` on any read/parse failure.\n *\n * Path: `$AGENTPROTO_HOME/browser-adapters/<adapterId>.json`\n * (same convention as the CLI's `browserAdapterLedgerPath()`).\n */\nasync function loadPersistedEnv(adapterId: string): Promise<Record<string, string>> {\n const base = process.env[\"AGENTPROTO_HOME\"] ?? join(homedir(), \".agentproto\")\n const ledgerPath = join(base, \"browser-adapters\", `${adapterId}.json`)\n try {\n const raw = await readFile(ledgerPath, \"utf8\")\n const parsed = JSON.parse(raw) as { envValues?: Record<string, string> }\n return parsed.envValues ?? {}\n } catch {\n return {}\n }\n}\n\n// ─── Config ───────────────────────────────────────────────────────────────────\n\nexport interface ResolveLaunchConfig {\n handle: Pick<BrowserAdapterHandle, \"id\" | \"defaultPort\" | \"healthPath\" | \"location\" | \"requires\">\n opts: BrowserAdapterStartOptions\n /**\n * Short label used in log and error messages (e.g. \"camofox\", \"bureau\").\n * Typically matches `handle.id`.\n */\n label: string\n /**\n * Returns the local launch command, or `null` when no command is resolvable.\n * The returned object may carry `isLaunchctl: true` for launchers (like\n * launchctl) that exit immediately and are not the real managed process — in\n * that case the child is spawned for its side-effect only and `pid` stays\n * undefined in the resulting instance.\n * `cwd` is forwarded to the spawned child when present.\n */\n resolveLocalCmd(): {\n file: string\n args: string[]\n isLaunchctl?: boolean\n cwd?: string\n } | null\n /**\n * Extra env vars merged into the spawned process env (after `opts.env`).\n * Accepts either a plain record or a factory that receives the resolved port\n * (useful when the port must be baked into an env var like `PORT`).\n */\n extraEnv?: Record<string, string> | ((port: number) => Record<string, string>)\n /**\n * When `true`, stop() sends SIGTERM to the whole process group (`-pid`),\n * falling back to the direct pid on failure. Use for adapters that spawn\n * through `sh -c` and need to terminate pnpm-forked child processes.\n * Default: false (direct-pid SIGTERM only).\n */\n killProcessGroup?: boolean\n}\n\n// ─── Helpers ──────────────────────────────────────────────────────────────────\n\nfunction makeStop(pid: number | undefined, processGroup: boolean): () => Promise<void> {\n return async () => {\n if (!pid) return\n if (processGroup) {\n try {\n process.kill(-pid, \"SIGTERM\")\n return\n } catch {\n // group already gone — fall through to direct pid\n }\n }\n try {\n process.kill(pid, \"SIGTERM\")\n } catch {\n // process may have already exited — ignore\n }\n }\n}\n\n// ─── Core ─────────────────────────────────────────────────────────────────────\n\n/**\n * Shared launch/health-check logic for all three browser adapters.\n *\n * Two execution paths:\n * - **local** — resolves a launch command and spawns a detached child process,\n * then polls health (existing behaviour, unchanged).\n * - **cloud** — health-checks `opts.baseUrl` directly; no process is spawned.\n */\nexport async function resolveLaunch(cfg: ResolveLaunchConfig): Promise<BrowserAdapterInstance> {\n const { handle, opts, label } = cfg\n const port = opts.port ?? handle.defaultPort\n const timeoutMs = opts.timeoutMs ?? 60_000\n const log = opts.log\n const location = opts.location ?? handle.location ?? \"local\"\n\n // Persisted config from `agentproto browser install` — merged as lowest-priority\n // env so that opts.env (explicit caller overrides) always wins.\n const persistedEnv = await loadPersistedEnv(handle.id)\n\n const resolvedExtraEnv =\n typeof cfg.extraEnv === \"function\" ? cfg.extraEnv(port) : cfg.extraEnv\n\n // ── Cloud path ──────────────────────────────────────────────────────────────\n if (location === \"cloud\") {\n const cloudBase = opts.baseUrl\n if (!cloudBase) {\n throw new Error(\n `[${label}] location=\"cloud\" requires opts.baseUrl (the remote service base URL).`\n )\n }\n const healthUrl = cloudBase.replace(/\\/$/, \"\") + handle.healthPath\n log?.(`[${label}] cloud mode — health-checking ${healthUrl}`)\n const result = await ensureBrowserProcess({\n kind: handle.id,\n healthUrl,\n launch: () => null,\n timeoutMs,\n intervalMs: 1000,\n log,\n })\n return {\n id: handle.id,\n port,\n baseUrl: result.baseUrl,\n pid: undefined,\n wasAlreadyRunning: result.wasAlreadyRunning,\n stop: async () => {},\n }\n }\n\n // ── Local path ──────────────────────────────────────────────────────────────\n const result = await ensureBrowserProcess({\n kind: handle.id,\n healthUrl: `http://127.0.0.1:${port}${handle.healthPath}`,\n launch() {\n const cmd = cfg.resolveLocalCmd()\n if (!cmd) {\n const nativePlatforms = handle.requires?.nativeLaunchOs\n const platformHint =\n nativePlatforms && !nativePlatforms.includes(platform())\n ? ` (native launcher only available on ${nativePlatforms.join(\", \")}; ` +\n `set the relevant SERVE_CMD env var on ${platform()} or pass opts.launchCmd)`\n : \"\"\n throw new Error(\n `[${label}] service is not running on :${port} and no launch command is available.${platformHint}`\n )\n }\n log?.(`[${label}] starting: ${[cmd.file, ...cmd.args].join(\" \")}`)\n if (cmd.isLaunchctl) {\n // Launcher exits immediately — spawn for side-effect only; pid stays undefined.\n spawn(cmd.file, cmd.args, {\n detached: true,\n stdio: \"ignore\",\n env: { ...process.env, ...persistedEnv, ...opts.env, ...resolvedExtraEnv },\n }).unref()\n return null\n }\n const child = spawn(cmd.file, cmd.args, {\n detached: true,\n stdio: \"ignore\",\n env: { ...process.env, ...persistedEnv, ...opts.env, ...resolvedExtraEnv },\n ...(cmd.cwd ? { cwd: cmd.cwd } : {}),\n })\n child.unref()\n return child\n },\n timeoutMs,\n intervalMs: 1000,\n log,\n })\n\n return {\n id: handle.id,\n port,\n baseUrl: result.baseUrl,\n pid: result.pid,\n wasAlreadyRunning: result.wasAlreadyRunning,\n stop: makeStop(result.pid, cfg.killProcessGroup ?? false),\n }\n}\n","import { platform } from \"node:os\"\nimport type { BrowserAdapterHandle, BrowserAdapterStartOptions, BrowserAdapterInstance } from \"../types.js\"\nimport { resolveLaunch } from \"../lib/resolve-launch.js\"\n\nfunction resolveCmd(\n launchCmd: string | undefined,\n env: Record<string, string> | undefined\n): { file: string; args: string[]; isLaunchctl?: boolean } | null {\n if (launchCmd) return { file: \"/bin/sh\", args: [\"-c\", launchCmd] }\n const envCmd = env?.CAMOFOX_SERVE_CMD ?? process.env.CAMOFOX_SERVE_CMD\n if (envCmd) return { file: \"/bin/sh\", args: [\"-c\", envCmd] }\n if (platform() === \"darwin\")\n return { file: \"launchctl\", args: [\"start\", \"com.agentik.camofox\"], isLaunchctl: true }\n return null\n}\n\nexport const camofoxAdapter: BrowserAdapterHandle = {\n id: \"camofox\",\n name: \"Camofox (stealth Firefox headless)\",\n description:\n \"Camofox headless stealth Firefox REST API on :9377. Exposes /sessions, /tabs, and /health. Required dependency for the bureau adapter.\",\n defaultPort: 9377,\n healthPath: \"/health\",\n\n location: \"local\",\n\n install: [\n {\n method: \"vendored\",\n // Shipped via the agentik launchd plist on macOS; on other platforms\n // install camofox separately and point CAMOFOX_SERVE_CMD at it.\n },\n ],\n\n requires: {\n // nativeLaunchOs ≠ hard constraint: the adapter is available on all\n // platforms. This field only signals that the built-in launchd path\n // (com.agentik.camofox) exists on macOS; elsewhere CAMOFOX_SERVE_CMD\n // or opts.launchCmd must be provided.\n nativeLaunchOs: [\"darwin\"],\n },\n\n config: [\n {\n id: \"camofox-serve-cmd\",\n kind: \"prompt\",\n prompt: \"Shell command to start camofox (leave blank on macOS when using the com.agentik.camofox launchd plist)\",\n description:\n \"Required on non-macOS hosts. On macOS this overrides the default `launchctl start com.agentik.camofox` path.\",\n type: \"text\",\n persist: { env: \"CAMOFOX_SERVE_CMD\" },\n },\n ],\n\n async ensure(opts: BrowserAdapterStartOptions): Promise<BrowserAdapterInstance> {\n return resolveLaunch({\n handle: this,\n opts,\n label: \"camofox\",\n resolveLocalCmd: () => resolveCmd(opts.launchCmd, opts.env),\n })\n },\n}\n","import type { BrowserAdapterHandle, BrowserAdapterStartOptions, BrowserAdapterInstance } from \"../types.js\"\nimport { resolveLaunch } from \"../lib/resolve-launch.js\"\nimport { camofoxAdapter } from \"./camofox.js\"\n\nfunction resolveBureauCmd(\n launchCmd: string | undefined,\n env: Record<string, string> | undefined\n): { file: string; args: string[] } {\n const cmd = launchCmd ?? env?.BUREAU_SERVE_CMD ?? process.env.BUREAU_SERVE_CMD\n if (cmd) return { file: \"/bin/sh\", args: [\"-c\", cmd] }\n // Default: `bureau serve` assumed on PATH (installed globally or via the workspace bin).\n return { file: \"bureau\", args: [\"serve\"] }\n}\n\nexport const bureauAdapter: BrowserAdapterHandle = {\n id: \"bureau\",\n name: \"Bureau (Camofox + MCP capability server)\",\n description:\n \"Bureau capability server on :8830. Orchestrates Camofox headless first, then \" +\n \"spawns bureau serve which exposes browser tools as MCP-over-HTTP.\",\n defaultPort: 8830,\n healthPath: \"/health\",\n\n location: \"local\",\n\n install: [\n {\n method: \"path\",\n // `bureau` CLI must be on PATH (e.g. installed via `npm i -g @agentik/bureau`\n // or linked from the monorepo workspace bin).\n },\n ],\n\n config: [\n // bureau inherits camofox's CAMOFOX_SERVE_CMD implicitly — camofoxAdapter.ensure\n // is called first inside `ensure` and reads that env var itself.\n {\n id: \"bureau-serve-cmd\",\n kind: \"prompt\",\n prompt: \"Shell command to start bureau (leave blank to use `bureau serve` on PATH)\",\n type: \"text\",\n persist: { env: \"BUREAU_SERVE_CMD\" },\n },\n {\n id: \"bureau-port\",\n kind: \"prompt\",\n prompt: \"Port bureau should listen on\",\n type: \"text\",\n default: \"8830\",\n persist: { env: \"BUREAU_PORT\" },\n },\n ],\n\n async ensure(opts: BrowserAdapterStartOptions): Promise<BrowserAdapterInstance> {\n const timeoutMs = opts.timeoutMs ?? 60_000\n const log = opts.log\n\n // Camofox must be up before bureau serve can start.\n const cam = await camofoxAdapter.ensure({\n port: opts.camofoxPort ?? 9377,\n launchCmd: undefined,\n env: opts.env,\n timeoutMs,\n log,\n })\n\n return resolveLaunch({\n handle: this,\n opts,\n label: \"bureau\",\n resolveLocalCmd: () => resolveBureauCmd(opts.launchCmd, opts.env),\n // PORT must reflect the resolved port — extraEnv receives it as a factory arg.\n extraEnv: (port) => ({\n CAMOFOX_URL: cam.baseUrl,\n PORT: String(port),\n }),\n })\n },\n}\n","import type { BrowserAdapterHandle, BrowserAdapterStartOptions, BrowserAdapterInstance } from \"../types.js\"\nimport { resolveLaunch } from \"../lib/resolve-launch.js\"\n\nfunction resolveCmd(\n launchCmd: string | undefined,\n env: Record<string, string> | undefined,\n log: ((s: string) => void) | undefined\n): { file: string; args: string[]; cwd?: string } {\n if (launchCmd) return { file: \"/bin/sh\", args: [\"-c\", launchCmd] }\n const envCmd = env?.CHROMIUM_SERVE_CMD ?? process.env.CHROMIUM_SERVE_CMD\n if (envCmd) return { file: \"/bin/sh\", args: [\"-c\", envCmd] }\n\n // Default pnpm filter command — requires the workspace root as cwd.\n const cwd = resolveCwd(env, log)\n return { file: \"/bin/sh\", args: [\"-c\", \"pnpm --filter=@browser/service start\"], cwd }\n}\n\n/**\n * Resolve the working directory for the spawned browser-service process.\n *\n * Priority: CHROMIUM_SERVE_CWD from caller env > same var from process env >\n * undefined (spawn inherits the daemon's own cwd, which is the pnpm workspace\n * root when the daemon was started normally). When the default pnpm --filter\n * command is used and no cwd is resolvable, a warning is emitted — pnpm needs\n * the workspace root to match the filter.\n */\nfunction resolveCwd(\n env: Record<string, string> | undefined,\n log: ((s: string) => void) | undefined\n): string | undefined {\n const explicit = env?.CHROMIUM_SERVE_CWD ?? process.env.CHROMIUM_SERVE_CWD\n if (explicit) return explicit\n log?.(\n \"[chromium] warning: CHROMIUM_SERVE_CWD is not set; relying on daemon cwd for \" +\n \"`pnpm --filter=@browser/service start`. Set CHROMIUM_SERVE_CWD or run the daemon \" +\n \"from the repo root, or override with CHROMIUM_SERVE_CMD.\"\n )\n return undefined\n}\n\nexport const chromiumAdapter: BrowserAdapterHandle = {\n id: \"chromium\",\n name: \"Chromium Browser Service\",\n description:\n \"Heavy Chromium webservice (projects/browser/apps/service) on :3200. Exposes /healthz, /readyz, REST session routes, and a CDP WebSocket proxy.\",\n defaultPort: 3200,\n healthPath: \"/healthz\",\n\n location: \"local\",\n\n install: [\n {\n method: \"path\",\n // Local: `pnpm --filter=@browser/service start` from the monorepo root,\n // or set CHROMIUM_SERVE_CMD / CHROMIUM_SERVE_CWD to point at a custom launcher.\n // Cloud variant (future — not yet wired into ensure):\n // method: \"cloud\", url: process.env.BROWSER_SERVICE_URL, secret: \"BROWSER_SERVICE_KEY\"\n },\n ],\n\n config: [\n {\n id: \"chromium-serve-cmd\",\n kind: \"prompt\",\n prompt: \"Shell command to start the browser service (default: pnpm --filter=@browser/service start)\",\n description:\n \"Override CHROMIUM_SERVE_CMD. When blank, the default pnpm filter command is used and \" +\n \"CHROMIUM_SERVE_CWD must point to the monorepo root.\",\n type: \"text\",\n persist: { env: \"CHROMIUM_SERVE_CMD\" },\n },\n {\n id: \"chromium-serve-cwd\",\n kind: \"prompt\",\n prompt: \"Working directory for the browser service (monorepo root required for the pnpm filter command)\",\n type: \"text\",\n persist: { env: \"CHROMIUM_SERVE_CWD\" },\n },\n // Future cloud step (T9+):\n // { id: \"chromium-cloud-url\", kind: \"prompt\", prompt: \"Remote browser-service URL\", type: \"text\", persist: { env: \"BROWSER_SERVICE_URL\" } },\n // { id: \"chromium-cloud-token\", kind: \"prompt\", prompt: \"X-Internal-Key token\", type: \"secret\", persist: { env: \"BROWSER_SERVICE_KEY\" } },\n ],\n\n async ensure(opts: BrowserAdapterStartOptions): Promise<BrowserAdapterInstance> {\n return resolveLaunch({\n handle: this,\n opts,\n label: \"chromium\",\n resolveLocalCmd: () => resolveCmd(opts.launchCmd, opts.env, opts.log),\n // Kill the whole process group so the pnpm-forked node child is not orphaned.\n killProcessGroup: true,\n })\n },\n}\n","export type {\n BrowserAdapterHandle,\n BrowserAdapterStartOptions,\n BrowserAdapterInstance,\n} from \"./types.js\"\n\nexport { camofoxAdapter } from \"./adapters/camofox.js\"\nexport { bureauAdapter } from \"./adapters/bureau.js\"\nexport { chromiumAdapter } from \"./adapters/chromium.js\"\n\nimport { camofoxAdapter } from \"./adapters/camofox.js\"\nimport { bureauAdapter } from \"./adapters/bureau.js\"\nimport { chromiumAdapter } from \"./adapters/chromium.js\"\nimport type { BrowserAdapterHandle } from \"./types.js\"\n\nexport const browserAdapters: Record<string, BrowserAdapterHandle> = {\n camofox: camofoxAdapter,\n bureau: bureauAdapter,\n chromium: chromiumAdapter,\n}\n\nexport function getBrowserAdapter(id: string): BrowserAdapterHandle | undefined {\n return browserAdapters[id]\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/lib/resolve-launch.ts","../src/adapters/camofox.ts","../src/adapters/bureau.ts","../src/adapters/chromium.ts","../src/index.ts"],"names":["result","platform","resolveCmd"],"mappings":";;;;;;;;;;;AAgBA,eAAe,iBAAiB,SAAA,EAAoD;AAClF,EAAA,MAAM,IAAA,GAAO,QAAQ,GAAA,CAAI,iBAAiB,KAAK,IAAA,CAAK,OAAA,IAAW,aAAa,CAAA;AAC5E,EAAA,MAAM,aAAa,IAAA,CAAK,IAAA,EAAM,kBAAA,EAAoB,CAAA,EAAG,SAAS,CAAA,KAAA,CAAO,CAAA;AACrE,EAAA,IAAI;AACF,IAAA,MAAM,GAAA,GAAM,MAAM,QAAA,CAAS,UAAA,EAAY,MAAM,CAAA;AAC7C,IAAA,MAAM,MAAA,GAAS,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA;AAC7B,IAAA,OAAO,MAAA,CAAO,aAAa,EAAC;AAAA,EAC9B,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,EAAC;AAAA,EACV;AACF;AA2CA,SAAS,QAAA,CAAS,KAAyB,YAAA,EAA4C;AACrF,EAAA,OAAO,YAAY;AACjB,IAAA,IAAI,CAAC,GAAA,EAAK;AACV,IAAA,IAAI,YAAA,EAAc;AAChB,MAAA,IAAI;AACF,QAAA,OAAA,CAAQ,IAAA,CAAK,CAAC,GAAA,EAAK,SAAS,CAAA;AAC5B,QAAA;AAAA,MACF,CAAA,CAAA,MAAQ;AAAA,MAER;AAAA,IACF;AACA,IAAA,IAAI;AACF,MAAA,OAAA,CAAQ,IAAA,CA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Q,IAAA;AAAA,MACR,IAAA;AAAA,MACA,KAAA,EAAO,UAAA;AAAA,MACP,eAAA,EAAiB,MAAMA,WAAAA,CAAW,IAAA,CAAK,WAAW,IAAA,CAAK,GAAA,EAAK,KAAK,GAAG,CAAA;AAAA;AAAA,MAEpE,gBAAA,EAAkB;AAAA,KACnB,CAAA;AAAA,EACH;AACF;;;AC9EO,IAAM,eAAA,GAAwD;AAAA,EACnE,OAAA,EAAS,cAAA;AAAA,EACT,MAAA,EAAQ,aAAA;AAAA,EACR,QAAA,EAAU;AACZ;AAEO,SAAS,kBAAkB,EAAA,EAA8C;AAC9E,EAAA,OAAO,gBAAgB,EAAE,CAAA;AAC3B","file":"index.mjs","sourcesContent":["import { spawn } from \"node:child_process\"\nimport { platform, homedir } from \"node:os\"\nimport { join } from \"node:path\"\nimport { readFile } from \"node:fs/promises\"\nimport { ensureBrowserProcess } from \"@agentproto/browser-process\"\nimport type { BrowserAdapterHandle, BrowserAdapterStartOptions, BrowserAdapterInstance } from \"../types.js\"\n\n// ── Persisted config ledger ───────────────────────────────────────────────────\n\n/**\n * Best-effort read of the persisted env values written by\n * `agentproto browser install`. Returns `{}` on any read/parse failure.\n *\n * Path: `$AGENTPROTO_HOME/browser-adapters/<adapterId>.json`\n * (same convention as the CLI's `browserAdapterLedgerPath()`).\n */\nasync function loadPersistedEnv(adapterId: string): Promise<Record<string, string>> {\n const base = process.env[\"AGENTPROTO_HOME\"] ?? join(homedir(), \".agentproto\")\n const ledgerPath = join(base, \"browser-adapters\", `${adapterId}.json`)\n try {\n const raw = await readFile(ledgerPath, \"utf8\")\n const parsed = JSON.parse(raw) as { envValues?: Record<string, string> }\n return parsed.envValues ?? {}\n } catch {\n return {}\n }\n}\n\n// ─── Config ───────────────────────────────────────────────────────────────────\n\nexport interface ResolveLaunchConfig {\n handle: Pick<BrowserAdapterHandle, \"id\" | \"defaultPort\" | \"healthPath\" | \"location\" | \"requires\">\n opts: BrowserAdapterStartOptions\n /**\n * Short label used in log and error messages (e.g. \"camofox\", \"bureau\").\n * Typically matches `handle.id`.\n */\n label: string\n /**\n * Returns the local launch command, or `null` when no command is resolvable.\n * The returned object may carry `isLaunchctl: true` for launchers (like\n * launchctl) that exit immediately and are not the real managed process — in\n * that case the child is spawned for its side-effect only and `pid` stays\n * undefined in the resulting instance.\n * `cwd` is forwarded to the spawned child when present.\n */\n resolveLocalCmd(): {\n file: string\n args: string[]\n isLaunchctl?: boolean\n cwd?: string\n } | null\n /**\n * Extra env vars merged into the spawned process env (after `opts.env`).\n * Accepts either a plain record or a factory that receives the resolved port\n * (useful when the port must be baked into an env var like `PORT`).\n */\n extraEnv?: Record<string, string> | ((port: number) => Record<string, string>)\n /**\n * When `true`, stop() sends SIGTERM to the whole process group (`-pid`),\n * falling back to the direct pid on failure. Use for adapters that spawn\n * through `sh -c` and need to terminate pnpm-forked child processes.\n * Default: false (direct-pid SIGTERM only).\n */\n killProcessGroup?: boolean\n}\n\n// ─── Helpers ──────────────────────────────────────────────────────────────────\n\nfunction makeStop(pid: number | undefined, processGroup: boolean): () => Promise<void> {\n return async () => {\n if (!pid) return\n if (processGroup) {\n try {\n process.kill(-pid, \"SIGTERM\")\n return\n } catch {\n // group already gone — fall through to direct pid\n }\n }\n try {\n process.kill(pid, \"SIGTERM\")\n } catch {\n // process may have already exited — ignore\n }\n }\n}\n\n// ─── Core ─────────────────────────────────────────────────────────────────────\n\n/**\n * Shared launch/health-check logic for all three browser adapters.\n *\n * Two execution paths:\n * - **local** — resolves a launch command and spawns a detached child process,\n * then polls health (existing behaviour, unchanged).\n * - **cloud** — health-checks `opts.baseUrl` directly; no process is spawned.\n */\nexport async function resolveLaunch(cfg: ResolveLaunchConfig): Promise<BrowserAdapterInstance> {\n const { handle, opts, label } = cfg\n const port = opts.port ?? handle.defaultPort\n const timeoutMs = opts.timeoutMs ?? 60_000\n const log = opts.log\n const location = opts.location ?? handle.location ?? \"local\"\n\n // Persisted config from `agentproto browser install` — merged as lowest-priority\n // env so that opts.env (explicit caller overrides) always wins.\n const persistedEnv = await loadPersistedEnv(handle.id)\n\n const resolvedExtraEnv =\n typeof cfg.extraEnv === \"function\" ? cfg.extraEnv(port) : cfg.extraEnv\n\n // ── Cloud path ──────────────────────────────────────────────────────────────\n if (location === \"cloud\") {\n const cloudBase = opts.baseUrl\n if (!cloudBase) {\n throw new Error(\n `[${label}] location=\"cloud\" requires opts.baseUrl (the remote service base URL).`\n )\n }\n const healthUrl = cloudBase.replace(/\\/$/, \"\") + handle.healthPath\n log?.(`[${label}] cloud mode — health-checking ${healthUrl}`)\n const result = await ensureBrowserProcess({\n kind: handle.id,\n healthUrl,\n launch: () => null,\n timeoutMs,\n intervalMs: 1000,\n log,\n ...(opts.initialWaitMs !== undefined ? { initialWaitMs: opts.initialWaitMs } : {}),\n })\n return {\n id: handle.id,\n port,\n baseUrl: result.baseUrl,\n pid: undefined,\n wasAlreadyRunning: result.wasAlreadyRunning,\n healthy: result.healthy,\n stop: async () => {},\n }\n }\n\n // ── Local path ──────────────────────────────────────────────────────────────\n const result = await ensureBrowserProcess({\n kind: handle.id,\n healthUrl: `http://127.0.0.1:${port}${handle.healthPath}`,\n launch() {\n const cmd = cfg.resolveLocalCmd()\n if (!cmd) {\n const nativePlatforms = handle.requires?.nativeLaunchOs\n const platformHint =\n nativePlatforms && !nativePlatforms.includes(platform())\n ? ` (native launcher only available on ${nativePlatforms.join(\", \")}; ` +\n `set the relevant SERVE_CMD env var on ${platform()} or pass opts.launchCmd)`\n : \"\"\n throw new Error(\n `[${label}] service is not running on :${port} and no launch command is available.${platformHint}`\n )\n }\n const cmdFile = opts.binPath ?? cmd.file\n log?.(`[${label}] starting: ${[cmdFile, ...cmd.args].join(\" \")}`)\n if (cmd.isLaunchctl) {\n // Launcher exits immediately — spawn for side-effect only; pid stays undefined.\n spawn(cmdFile, cmd.args, {\n detached: true,\n stdio: \"ignore\",\n env: { ...process.env, ...persistedEnv, ...opts.env, ...resolvedExtraEnv },\n }).unref()\n return null\n }\n const child = spawn(cmdFile, cmd.args, {\n detached: true,\n stdio: \"ignore\",\n env: { ...process.env, ...persistedEnv, ...opts.env, ...resolvedExtraEnv },\n ...(cmd.cwd ? { cwd: cmd.cwd } : {}),\n })\n child.unref()\n return child\n },\n timeoutMs,\n intervalMs: 1000,\n log,\n ...(opts.initialWaitMs !== undefined ? { initialWaitMs: opts.initialWaitMs } : {}),\n })\n\n return {\n id: handle.id,\n port,\n baseUrl: result.baseUrl,\n pid: result.pid,\n wasAlreadyRunning: result.wasAlreadyRunning,\n healthy: result.healthy,\n stop: makeStop(result.pid, cfg.killProcessGroup ?? false),\n }\n}\n","import { platform } from \"node:os\"\nimport type { BrowserAdapterHandle, BrowserAdapterStartOptions, BrowserAdapterInstance } from \"../types.js\"\nimport { resolveLaunch } from \"../lib/resolve-launch.js\"\n\nfunction resolveCmd(\n launchCmd: string | undefined,\n env: Record<string, string> | undefined\n): { file: string; args: string[]; isLaunchctl?: boolean } | null {\n if (launchCmd) return { file: \"/bin/sh\", args: [\"-c\", launchCmd] }\n const envCmd = env?.CAMOFOX_SERVE_CMD ?? process.env.CAMOFOX_SERVE_CMD\n if (envCmd) return { file: \"/bin/sh\", args: [\"-c\", envCmd] }\n if (platform() === \"darwin\")\n return { file: \"launchctl\", args: [\"start\", \"com.agentik.camofox\"], isLaunchctl: true }\n return null\n}\n\nexport const camofoxAdapter: BrowserAdapterHandle = {\n id: \"camofox\",\n name: \"Camofox (stealth Firefox headless)\",\n description:\n \"Camofox headless stealth Firefox REST API on :9377. Exposes /sessions, /tabs, and /health. Required dependency for the bureau adapter.\",\n defaultPort: 9377,\n healthPath: \"/health\",\n\n location: \"local\",\n\n install: [\n {\n method: \"vendored\",\n // Shipped via the agentik launchd plist on macOS; on other platforms\n // install camofox separately and point CAMOFOX_SERVE_CMD at it.\n },\n ],\n\n requires: {\n // nativeLaunchOs ≠ hard constraint: the adapter is available on all\n // platforms. This field only signals that the built-in launchd path\n // (com.agentik.camofox) exists on macOS; elsewhere CAMOFOX_SERVE_CMD\n // or opts.launchCmd must be provided.\n nativeLaunchOs: [\"darwin\"],\n },\n\n config: [\n {\n id: \"camofox-serve-cmd\",\n kind: \"prompt\",\n prompt: \"Shell command to start camofox (leave blank on macOS when using the com.agentik.camofox launchd plist)\",\n description:\n \"Required on non-macOS hosts. On macOS this overrides the default `launchctl start com.agentik.camofox` path.\",\n type: \"text\",\n persist: { env: \"CAMOFOX_SERVE_CMD\" },\n },\n ],\n\n async ensure(opts: BrowserAdapterStartOptions): Promise<BrowserAdapterInstance> {\n return resolveLaunch({\n handle: this,\n opts,\n label: \"camofox\",\n resolveLocalCmd: () => resolveCmd(opts.launchCmd, opts.env),\n })\n },\n}\n","import type { BrowserAdapterHandle, BrowserAdapterStartOptions, BrowserAdapterInstance } from \"../types.js\"\nimport { resolveLaunch } from \"../lib/resolve-launch.js\"\nimport { camofoxAdapter } from \"./camofox.js\"\n\nfunction resolveBureauCmd(\n launchCmd: string | undefined,\n env: Record<string, string> | undefined\n): { file: string; args: string[] } {\n const cmd = launchCmd ?? env?.BUREAU_SERVE_CMD ?? process.env.BUREAU_SERVE_CMD\n if (cmd) return { file: \"/bin/sh\", args: [\"-c\", cmd] }\n // Default: `bureau serve` assumed on PATH (installed globally or via the workspace bin).\n return { file: \"bureau\", args: [\"serve\"] }\n}\n\nexport const bureauAdapter: BrowserAdapterHandle = {\n id: \"bureau\",\n name: \"Bureau (Camofox + MCP capability server)\",\n description:\n \"Bureau capability server on :8830. Orchestrates Camofox headless first, then \" +\n \"spawns bureau serve which exposes browser tools as MCP-over-HTTP.\",\n defaultPort: 8830,\n healthPath: \"/health\",\n\n location: \"local\",\n\n install: [\n {\n method: \"path\",\n // `bureau` CLI must be on PATH (e.g. installed via `npm i -g @agentik/bureau`\n // or linked from the monorepo workspace bin).\n },\n ],\n\n config: [\n // bureau inherits camofox's CAMOFOX_SERVE_CMD implicitly — camofoxAdapter.ensure\n // is called first inside `ensure` and reads that env var itself.\n {\n id: \"bureau-serve-cmd\",\n kind: \"prompt\",\n prompt: \"Shell command to start bureau (leave blank to use `bureau serve` on PATH)\",\n type: \"text\",\n persist: { env: \"BUREAU_SERVE_CMD\" },\n },\n {\n id: \"bureau-port\",\n kind: \"prompt\",\n prompt: \"Port bureau should listen on\",\n type: \"text\",\n default: \"8830\",\n persist: { env: \"BUREAU_PORT\" },\n },\n ],\n\n async ensure(opts: BrowserAdapterStartOptions): Promise<BrowserAdapterInstance> {\n const timeoutMs = opts.timeoutMs ?? 60_000\n const log = opts.log\n\n // Camofox must be up before bureau serve can start.\n const cam = await camofoxAdapter.ensure({\n port: opts.camofoxPort ?? 9377,\n launchCmd: undefined,\n env: opts.env,\n timeoutMs,\n log,\n })\n\n return resolveLaunch({\n handle: this,\n opts,\n label: \"bureau\",\n resolveLocalCmd: () => resolveBureauCmd(opts.launchCmd, opts.env),\n // PORT must reflect the resolved port — extraEnv receives it as a factory arg.\n extraEnv: (port) => ({\n CAMOFOX_URL: cam.baseUrl,\n PORT: String(port),\n }),\n })\n },\n}\n","import type { BrowserAdapterHandle, BrowserAdapterStartOptions, BrowserAdapterInstance } from \"../types.js\"\nimport { resolveLaunch } from \"../lib/resolve-launch.js\"\n\nexport function resolveCmd(\n launchCmd: string | undefined,\n env: Record<string, string> | undefined,\n log: ((s: string) => void) | undefined\n): { file: string; args: string[]; cwd?: string } {\n if (launchCmd) return { file: \"/bin/sh\", args: [\"-c\", launchCmd] }\n const envCmd = env?.CHROMIUM_SERVE_CMD ?? process.env.CHROMIUM_SERVE_CMD\n if (envCmd) return { file: \"/bin/sh\", args: [\"-c\", envCmd] }\n\n // Default pnpm filter command — requires the workspace root as cwd.\n const cwd = resolveCwd(env, log)\n return { file: \"/bin/sh\", args: [\"-c\", \"pnpm --filter=@agstudio/browser-service start\"], cwd }\n}\n\n/**\n * Resolve the working directory for the spawned browser-service process.\n *\n * Priority: CHROMIUM_SERVE_CWD from caller env > same var from process env >\n * undefined (spawn inherits the daemon's own cwd, which is the pnpm workspace\n * root when the daemon was started normally). When the default pnpm --filter\n * command is used and no cwd is resolvable, a warning is emitted — pnpm needs\n * the workspace root to match the filter.\n */\nfunction resolveCwd(\n env: Record<string, string> | undefined,\n log: ((s: string) => void) | undefined\n): string | undefined {\n const explicit = env?.CHROMIUM_SERVE_CWD ?? process.env.CHROMIUM_SERVE_CWD\n if (explicit) return explicit\n log?.(\n \"[chromium] warning: CHROMIUM_SERVE_CWD is not set; relying on daemon cwd for \" +\n \"`pnpm --filter=@agstudio/browser-service start`. Set CHROMIUM_SERVE_CWD or run the daemon \" +\n \"from the repo root, or override with CHROMIUM_SERVE_CMD.\"\n )\n return undefined\n}\n\nexport const chromiumAdapter: BrowserAdapterHandle = {\n id: \"chromium\",\n name: \"Chromium Browser Service\",\n description:\n \"Heavy Chromium webservice (projects/browser/apps/service) on :3200. Exposes /healthz, /readyz, REST session routes, and a CDP WebSocket proxy.\",\n defaultPort: 3200,\n healthPath: \"/healthz\",\n\n location: \"local\",\n\n install: [\n {\n method: \"path\",\n // Local: `pnpm --filter=@agstudio/browser-service start` from the monorepo root,\n // or set CHROMIUM_SERVE_CMD / CHROMIUM_SERVE_CWD to point at a custom launcher.\n // Cloud variant (future — not yet wired into ensure):\n // method: \"cloud\", url: process.env.BROWSER_SERVICE_URL, secret: \"BROWSER_SERVICE_KEY\"\n },\n ],\n\n config: [\n {\n id: \"chromium-serve-cmd\",\n kind: \"prompt\",\n prompt: \"Shell command to start the browser service (default: pnpm --filter=@agstudio/browser-service start)\",\n description:\n \"Override CHROMIUM_SERVE_CMD. When blank, the default pnpm filter command is used and \" +\n \"CHROMIUM_SERVE_CWD must point to the monorepo root.\",\n type: \"text\",\n persist: { env: \"CHROMIUM_SERVE_CMD\" },\n },\n {\n id: \"chromium-serve-cwd\",\n kind: \"prompt\",\n prompt: \"Working directory for the browser service (monorepo root required for the pnpm filter command)\",\n type: \"text\",\n persist: { env: \"CHROMIUM_SERVE_CWD\" },\n },\n // Future cloud step (T9+):\n // { id: \"chromium-cloud-url\", kind: \"prompt\", prompt: \"Remote browser-service URL\", type: \"text\", persist: { env: \"BROWSER_SERVICE_URL\" } },\n // { id: \"chromium-cloud-token\", kind: \"prompt\", prompt: \"X-Internal-Key token\", type: \"secret\", persist: { env: \"BROWSER_SERVICE_KEY\" } },\n ],\n\n async ensure(opts: BrowserAdapterStartOptions): Promise<BrowserAdapterInstance> {\n return resolveLaunch({\n handle: this,\n opts,\n label: \"chromium\",\n resolveLocalCmd: () => resolveCmd(opts.launchCmd, opts.env, opts.log),\n // Kill the whole process group so the pnpm-forked node child is not orphaned.\n killProcessGroup: true,\n })\n },\n}\n","export type {\n BrowserAdapterHandle,\n BrowserAdapterStartOptions,\n BrowserAdapterInstance,\n} from \"./types.js\"\n\nexport { camofoxAdapter } from \"./adapters/camofox.js\"\nexport { bureauAdapter } from \"./adapters/bureau.js\"\nexport { chromiumAdapter } from \"./adapters/chromium.js\"\n\nimport { camofoxAdapter } from \"./adapters/camofox.js\"\nimport { bureauAdapter } from \"./adapters/bureau.js\"\nimport { chromiumAdapter } from \"./adapters/chromium.js\"\nimport type { BrowserAdapterHandle } from \"./types.js\"\n\nexport const browserAdapters: Record<string, BrowserAdapterHandle> = {\n camofox: camofoxAdapter,\n bureau: bureauAdapter,\n chromium: chromiumAdapter,\n}\n\nexport function getBrowserAdapter(id: string): BrowserAdapterHandle | undefined {\n return browserAdapters[id]\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentproto/adapter-browser",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "@agentproto/adapter-browser — browser service adapters for agentproto. Manages Camofox (stealth Firefox) and Bureau (Camofox + MCP capability server) as first-class process handles: health-check, idempotent launch, structured stop.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agentproto",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"bugs": {
|
|
19
19
|
"url": "https://github.com/agentproto/ts/issues"
|
|
20
20
|
},
|
|
21
|
-
"license": "
|
|
21
|
+
"license": "Apache-2.0",
|
|
22
22
|
"type": "module",
|
|
23
23
|
"main": "dist/index.mjs",
|
|
24
24
|
"module": "dist/index.mjs",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@agentproto/browser-process": "0.1.
|
|
43
|
+
"@agentproto/browser-process": "0.1.1"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^25.6.2",
|