@openagents-org/agent-launcher 0.2.195 → 0.2.197
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/src/adapters/workspace-prompt.js +15 -18
- package/src/daemon.js +7 -0
- package/src/mcp-server.js +3 -3
package/package.json
CHANGED
|
@@ -51,9 +51,10 @@ function buildBrowserDirective(browserEnabled) {
|
|
|
51
51
|
'- `mcp__openagents-workspace__workspace_browser_list_tabs`\n' +
|
|
52
52
|
'- `mcp__openagents-workspace__workspace_browser_close`\n' +
|
|
53
53
|
'\n' +
|
|
54
|
-
'
|
|
55
|
-
'tab
|
|
56
|
-
'
|
|
54
|
+
'All cloud tabs are saved and reusable. List and reuse the current thread tab ' +
|
|
55
|
+
'by its stable tab ID. Do not close it after a task or to free capacity; ' +
|
|
56
|
+
'BrowserFabric handles idle sleep. Close only when the user requests it. ' +
|
|
57
|
+
'Live-view links may expire; refresh the tab to get its current live_url.\n\n' +
|
|
57
58
|
'If you don\'t have these MCP tools, use `Bash` + `curl` against ' +
|
|
58
59
|
'`/v1/fetch` and `/v1/browser/tabs` (documented below in Shared Browser).\n\n' +
|
|
59
60
|
'**FORBIDDEN — do NOT call any of these:**\n' +
|
|
@@ -404,7 +405,11 @@ function buildApiSkillsPrompt({ endpoint, workspaceId, token, agentName, channel
|
|
|
404
405
|
'When you open a tab, the JSON response includes an `id` (use it in every ' +
|
|
405
406
|
'later call) and, in the cloud, a `live_url` — a link to the live, ' +
|
|
406
407
|
'interactive view of that tab. Share the `live_url` with the user when ' +
|
|
407
|
-
'they may want to watch or take over (e.g. a login or a CAPTCHA)
|
|
408
|
+
'they may want to watch or take over (e.g. a login or a CAPTCHA). ' +
|
|
409
|
+
'All cloud tabs are saved and reusable. List and reuse the current thread tab ' +
|
|
410
|
+
'by its stable tab ID. Do not close it after a task or to free capacity; ' +
|
|
411
|
+
'BrowserFabric handles idle sleep. Close only when the user requests it. ' +
|
|
412
|
+
'If a live_url expires, fetch the current link from the same tab.\n\n'
|
|
408
413
|
);
|
|
409
414
|
|
|
410
415
|
if (!isPlan) {
|
|
@@ -424,11 +429,7 @@ function buildApiSkillsPrompt({ endpoint, workspaceId, token, agentName, channel
|
|
|
424
429
|
`"source":"openagents:${agentName}","channel":"${channelName}"}'\n` +
|
|
425
430
|
`Step 2 — read content: ` +
|
|
426
431
|
`${curl} -s -H "${h}" ${baseUrl}/v1/browser/tabs/TAB_ID/snapshot\n` +
|
|
427
|
-
`
|
|
428
|
-
`${curl} -s -X DELETE -H "${h}" ${baseUrl}/v1/browser/tabs/TAB_ID\n` +
|
|
429
|
-
'(Replace TAB_ID with the `id` from the step 1 response)\n' +
|
|
430
|
-
'Tabs are a limited per-workspace resource — always close yours when done; ' +
|
|
431
|
-
'idle tabs are auto-closed after a few minutes.\n\n'
|
|
432
|
+
'(Replace TAB_ID with the `id` from the step 1 response)\n\n'
|
|
432
433
|
);
|
|
433
434
|
}
|
|
434
435
|
|
|
@@ -448,11 +449,7 @@ function buildApiSkillsPrompt({ endpoint, workspaceId, token, agentName, channel
|
|
|
448
449
|
` ${baseUrl}/v1/browser/tabs` +
|
|
449
450
|
` -d '{"url":"URL","network":"${workspaceId}",` +
|
|
450
451
|
`"source":"openagents:${agentName}","channel":"${channelName}"}'\`\n` +
|
|
451
|
-
'
|
|
452
|
-
'`"persistent":true` (and optionally `"name":"…"`) to open a **permanent** ' +
|
|
453
|
-
'tab whose login state is saved and reusable — humans see the two kinds ' +
|
|
454
|
-
'separately in their browser. Permanent slots are scarcer: use them only ' +
|
|
455
|
-
'for logins worth keeping.\n\n' +
|
|
452
|
+
'Every cloud tab saves its login state. Keep its id for future work.\n\n' +
|
|
456
453
|
'**Navigate:**\n' +
|
|
457
454
|
`\`${curl} -s -X POST -H "${h}" -H "Content-Type: application/json"` +
|
|
458
455
|
` ${baseUrl}/v1/browser/tabs/{tab_id}/navigate` +
|
|
@@ -476,13 +473,13 @@ function buildApiSkillsPrompt({ endpoint, workspaceId, token, agentName, channel
|
|
|
476
473
|
` -d '{"expression":"document.title","source":"openagents:${agentName}","channel":"${channelName}"}'\`\n` +
|
|
477
474
|
'The `source` field is how humans watching the shared browser see *who* is ' +
|
|
478
475
|
'acting — include it and `channel` on every tab action. The workspace automatically posts a live browser preview card in this conversation.\n\n' +
|
|
479
|
-
'**Close tab:**\n' +
|
|
476
|
+
'**Close tab (only on user request):**\n' +
|
|
480
477
|
`\`${curl} -s -X DELETE -H "${h}" ${baseUrl}/v1/browser/tabs/{tab_id}\`\n\n` +
|
|
481
478
|
'**Clicks/typing use CSS selectors only** (no pixel coordinates). If a ' +
|
|
482
479
|
'selector is hard to find, use `evaluate` to inspect the DOM first.\n\n' +
|
|
483
|
-
'**
|
|
484
|
-
'
|
|
485
|
-
'
|
|
480
|
+
'**Saved logins (contexts):** cloud tabs already have a saved context. ' +
|
|
481
|
+
'Reuse the existing tab first. If closed, reopen with its `context_id`; ' +
|
|
482
|
+
'the persist endpoint can also name or save a legacy tab:\n' +
|
|
486
483
|
`\`${curl} -s -X POST -H "${h}" -H "Content-Type: application/json"` +
|
|
487
484
|
` ${baseUrl}/v1/browser/tabs/{tab_id}/persist -d '{"name":"my-login"}'\`\n` +
|
|
488
485
|
`\`${curl} -s -H "${h}" ${baseUrl}/v1/browser/contexts?network=${workspaceId}\`` +
|
package/src/daemon.js
CHANGED
|
@@ -506,6 +506,7 @@ class Daemon {
|
|
|
506
506
|
workingDir: a.path || null,
|
|
507
507
|
apiKeyMasked: apiKey ? maskApiKey(apiKey) : null,
|
|
508
508
|
baseUrlHost: endpointHost(this._configuredBaseUrl(a, typeEnv)),
|
|
509
|
+
codexWireApi: a.type === 'codex' ? ((a.env && a.env.CODEX_WIRE_API) || typeEnv.CODEX_WIRE_API || 'chat') : null,
|
|
509
510
|
cliModels: listed && listed.models && this._onCliSignIn(a) ? listed.models : null,
|
|
510
511
|
probe: this._probes[a.name] || null,
|
|
511
512
|
});
|
|
@@ -621,6 +622,12 @@ class Daemon {
|
|
|
621
622
|
*/
|
|
622
623
|
_saveNodeAgentEnv(name, type, args) {
|
|
623
624
|
const changes = {};
|
|
625
|
+
if (type === 'codex' && args.codexWireApi !== undefined) {
|
|
626
|
+
if (!['responses', 'chat'].includes(args.codexWireApi)) {
|
|
627
|
+
throw new Error('Choose Responses or Chat Completions for Codex');
|
|
628
|
+
}
|
|
629
|
+
changes.CODEX_WIRE_API = args.codexWireApi;
|
|
630
|
+
}
|
|
624
631
|
if (_sentKey(args)) {
|
|
625
632
|
changes.LLM_API_KEY = args.apiKey;
|
|
626
633
|
// A key sent for the agent means it runs on that key: a sign-in marker
|
package/src/mcp-server.js
CHANGED
|
@@ -161,7 +161,7 @@ function buildToolDefs(disabledModules) {
|
|
|
161
161
|
description:
|
|
162
162
|
'Read a web page as text WITHOUT opening a shared browser tab. Preferred way to read any URL: ' +
|
|
163
163
|
'tries a fast static fetch first, and automatically renders JavaScript-heavy pages (Notion, SPAs) ' +
|
|
164
|
-
'
|
|
164
|
+
'using BrowserFabric. Only open a shared browser tab (workspace_browser_open) when you ' +
|
|
165
165
|
'need to interact with the page (click/type/login) or the result says AUTH_REQUIRED.',
|
|
166
166
|
inputSchema: {
|
|
167
167
|
type: 'object',
|
|
@@ -180,7 +180,7 @@ function buildToolDefs(disabledModules) {
|
|
|
180
180
|
{
|
|
181
181
|
name: 'workspace_browser_open',
|
|
182
182
|
description:
|
|
183
|
-
'Open a new shared browser tab. Use context_name to
|
|
183
|
+
'Open a new saved shared browser tab. Reuse existing tabs first. Use context_name to reuse a saved browser context ' +
|
|
184
184
|
'(preserves cookies/login sessions). List contexts with workspace_browser_list_contexts.',
|
|
185
185
|
inputSchema: {
|
|
186
186
|
type: 'object',
|
|
@@ -256,7 +256,7 @@ function buildToolDefs(disabledModules) {
|
|
|
256
256
|
},
|
|
257
257
|
{
|
|
258
258
|
name: 'workspace_browser_close',
|
|
259
|
-
description: 'Close a shared browser tab.',
|
|
259
|
+
description: 'Close a shared browser tab only when the user requests it. Do not close after finishing a task; saved tabs are reusable.',
|
|
260
260
|
inputSchema: {
|
|
261
261
|
type: 'object',
|
|
262
262
|
properties: {
|