@proagentstore/cli 0.4.71 → 0.4.73
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/dist/browser-runner/errors.js +6 -2
- package/dist/browser-runner/local-browser/bridge-stdio.js +75 -0
- package/dist/browser-runner/local-browser/bridge.js +312 -0
- package/dist/browser-runner/local-browser/contract.js +215 -0
- package/dist/browser-runner/local-browser/engine.js +150 -0
- package/dist/browser-runner/local-browser/runtime.js +449 -0
- package/dist/browser-runner/runner.js +21 -1
- package/dist/browser-runner/server.js +23 -0
- package/dist/browser-runner/task-types.js +3 -0
- package/package.json +1 -1
|
@@ -7,6 +7,15 @@ import { listGithubOrgs, listGithubRepos, searchGithubRepos, getGithubRepoDetail
|
|
|
7
7
|
export function createRunnerServer(runner) {
|
|
8
8
|
return createServer(async (req, res) => {
|
|
9
9
|
try {
|
|
10
|
+
// The research CLI's bridge forwarder (#944) holds a run-scoped token, not the runner's —
|
|
11
|
+
// accepted for this one path and that one run only, and still never from a browser origin.
|
|
12
|
+
if (!req.headers.origin && req.method === "POST" && (req.url || "").split("?")[0] === "/local-browser/bridge") {
|
|
13
|
+
const body = await readJson(req);
|
|
14
|
+
const token = String(req.headers["x-pags-bridge-token"] || "");
|
|
15
|
+
if (!runner.localBrowser.authorizeBridge(String(body.runId ?? ""), token))
|
|
16
|
+
return json(res, 401, { error: "Unauthorized" });
|
|
17
|
+
return json(res, 200, await runner.localBrowser.bridge(body));
|
|
18
|
+
}
|
|
10
19
|
if (!authorize(req, runner.config)) {
|
|
11
20
|
return json(res, 401, { error: "Unauthorized" });
|
|
12
21
|
}
|
|
@@ -28,6 +37,7 @@ export async function startRunnerServer(config) {
|
|
|
28
37
|
});
|
|
29
38
|
const address = server.address();
|
|
30
39
|
const actualPort = address.port;
|
|
40
|
+
runner.selfUrl = `http://${config.host}:${actualPort}`;
|
|
31
41
|
return {
|
|
32
42
|
runner,
|
|
33
43
|
url: `http://${config.host}:${actualPort}`,
|
|
@@ -154,6 +164,19 @@ async function route(runner, req, res) {
|
|
|
154
164
|
}
|
|
155
165
|
// ── Brain-driven coding control (remote LLM drives a tmux coding CLI) ────
|
|
156
166
|
// The tmux analogue of the /browser/* surface: start → capture → act → end.
|
|
167
|
+
// Local CLI browser research (#944). The API pulls state with /status — the runner never pushes.
|
|
168
|
+
if (req.method === "POST" && path === "/local-browser/run") {
|
|
169
|
+
return json(res, 202, runner.localBrowser.start(await readJson(req)));
|
|
170
|
+
}
|
|
171
|
+
if (req.method === "POST" && path === "/local-browser/status") {
|
|
172
|
+
return json(res, 200, runner.localBrowser.status(await readJson(req)));
|
|
173
|
+
}
|
|
174
|
+
if (req.method === "POST" && path === "/local-browser/resume") {
|
|
175
|
+
return json(res, 200, runner.localBrowser.resume(await readJson(req)));
|
|
176
|
+
}
|
|
177
|
+
if (req.method === "POST" && path === "/local-browser/cancel") {
|
|
178
|
+
return json(res, 200, runner.localBrowser.cancel(await readJson(req)));
|
|
179
|
+
}
|
|
157
180
|
if (req.method === "POST" && path === "/coding/start") {
|
|
158
181
|
const b = await readJson(req);
|
|
159
182
|
return json(res, 200, runner.coding.start(b));
|
|
@@ -19,4 +19,7 @@ export const WORKFLOW_DRIVEN_TASKS = new Set([
|
|
|
19
19
|
"browser.handoff",
|
|
20
20
|
// #841: local Claude/Codex authors an FWS draft; PAGS retains the audit and deployment gate.
|
|
21
21
|
"site_builder_runtime",
|
|
22
|
+
// #944: local CLI browser research. Its state is the LocalBrowserRuntime's run, not a task the
|
|
23
|
+
// runner executes from its task list, so a restart must not expire a card for it.
|
|
24
|
+
"local_browser.research",
|
|
22
25
|
]);
|