@openagents-org/agent-launcher 0.2.93 → 0.2.95
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/registry.json +9 -0
- package/src/mcp-server.js +38 -4
- package/src/registry.js +28 -6
- package/src/workspace-client.js +13 -4
package/package.json
CHANGED
package/registry.json
CHANGED
|
@@ -44,6 +44,9 @@
|
|
|
44
44
|
"cli",
|
|
45
45
|
"anthropic"
|
|
46
46
|
],
|
|
47
|
+
"featured": true,
|
|
48
|
+
"order": 1,
|
|
49
|
+
"support": { "install": true, "workspace": true, "collaboration": true },
|
|
47
50
|
"builtin": true,
|
|
48
51
|
"install": {
|
|
49
52
|
"binary": "claude",
|
|
@@ -107,6 +110,9 @@
|
|
|
107
110
|
"openai",
|
|
108
111
|
"cli"
|
|
109
112
|
],
|
|
113
|
+
"featured": true,
|
|
114
|
+
"order": 3,
|
|
115
|
+
"support": { "install": true, "workspace": true, "collaboration": true },
|
|
110
116
|
"builtin": true,
|
|
111
117
|
"install": {
|
|
112
118
|
"binary": "codex",
|
|
@@ -352,6 +358,9 @@
|
|
|
352
358
|
"coding",
|
|
353
359
|
"open-source"
|
|
354
360
|
],
|
|
361
|
+
"featured": true,
|
|
362
|
+
"order": 2,
|
|
363
|
+
"support": { "install": true, "workspace": true, "collaboration": true },
|
|
355
364
|
"builtin": true,
|
|
356
365
|
"install": {
|
|
357
366
|
"binary": "openclaw",
|
package/src/mcp-server.js
CHANGED
|
@@ -104,11 +104,14 @@ function buildToolDefs(disabledModules) {
|
|
|
104
104
|
tools.push(
|
|
105
105
|
{
|
|
106
106
|
name: 'workspace_browser_open',
|
|
107
|
-
description:
|
|
107
|
+
description:
|
|
108
|
+
'Open a new shared browser tab. Use context_name to open in a persistent browser context ' +
|
|
109
|
+
'(preserves cookies/login sessions). List contexts with workspace_browser_list_contexts.',
|
|
108
110
|
inputSchema: {
|
|
109
111
|
type: 'object',
|
|
110
112
|
properties: {
|
|
111
113
|
url: { type: 'string', description: 'URL to open (default: about:blank)' },
|
|
114
|
+
context_name: { type: 'string', description: 'Name of a persistent browser context (e.g. "Hackernews"). Preserves login cookies across sessions.' },
|
|
112
115
|
},
|
|
113
116
|
},
|
|
114
117
|
},
|
|
@@ -187,6 +190,11 @@ function buildToolDefs(disabledModules) {
|
|
|
187
190
|
required: ['tab_id'],
|
|
188
191
|
},
|
|
189
192
|
},
|
|
193
|
+
{
|
|
194
|
+
name: 'workspace_browser_list_contexts',
|
|
195
|
+
description: 'List available persistent browser contexts (saved login sessions).',
|
|
196
|
+
inputSchema: { type: 'object', properties: {} },
|
|
197
|
+
},
|
|
190
198
|
);
|
|
191
199
|
}
|
|
192
200
|
|
|
@@ -416,12 +424,28 @@ class McpServer {
|
|
|
416
424
|
// ── Browser ──
|
|
417
425
|
|
|
418
426
|
case 'workspace_browser_open': {
|
|
419
|
-
const
|
|
427
|
+
const opts = {
|
|
420
428
|
url: args.url || 'about:blank',
|
|
421
429
|
source: `openagents:${this.agentName}`,
|
|
422
|
-
}
|
|
430
|
+
};
|
|
431
|
+
// Resolve context_name to context_id
|
|
432
|
+
if (args.context_name) {
|
|
433
|
+
const ctxData = await this.ws.browserListContexts(this.workspaceId, this.token);
|
|
434
|
+
const contexts = (ctxData && ctxData.contexts) || [];
|
|
435
|
+
const match = contexts.find(
|
|
436
|
+
(c) => c.name.toLowerCase() === args.context_name.toLowerCase(),
|
|
437
|
+
);
|
|
438
|
+
if (match) {
|
|
439
|
+
opts.context_id = match.id;
|
|
440
|
+
} else {
|
|
441
|
+
const names = contexts.map((c) => c.name).join(', ') || '(none)';
|
|
442
|
+
return text(`Context "${args.context_name}" not found. Available: ${names}`);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
const result = await this.ws.browserOpenTab(this.workspaceId, this.token, opts);
|
|
423
446
|
const tabId = result.tab_id || result.id || 'unknown';
|
|
424
|
-
|
|
447
|
+
const persistent = result.persistent ? ' (persistent)' : '';
|
|
448
|
+
return text(`Browser tab opened${persistent}: ${tabId} → ${args.url || 'about:blank'}`);
|
|
425
449
|
}
|
|
426
450
|
|
|
427
451
|
case 'workspace_browser_navigate': {
|
|
@@ -466,6 +490,16 @@ class McpServer {
|
|
|
466
490
|
return text(`Browser tab closed: ${args.tab_id}`);
|
|
467
491
|
}
|
|
468
492
|
|
|
493
|
+
case 'workspace_browser_list_contexts': {
|
|
494
|
+
const data = await this.ws.browserListContexts(this.workspaceId, this.token);
|
|
495
|
+
const contexts = (data && data.contexts) || [];
|
|
496
|
+
if (!contexts.length) return text('No persistent browser contexts.');
|
|
497
|
+
const lines = contexts.map((c) =>
|
|
498
|
+
`- ${c.name} (domain: ${c.domain || 'any'}, id: ${c.id})`
|
|
499
|
+
);
|
|
500
|
+
return text(lines.join('\n'));
|
|
501
|
+
}
|
|
502
|
+
|
|
469
503
|
// ── Tunnel ──
|
|
470
504
|
|
|
471
505
|
case 'tunnel_expose': {
|
package/src/registry.js
CHANGED
|
@@ -7,6 +7,28 @@ const DEFAULT_REGISTRY_URL = 'https://endpoint.openagents.org/v1/agent-registry'
|
|
|
7
7
|
const CACHE_FILE = 'agent_catalog.json';
|
|
8
8
|
const CACHE_TTL_MS = 24 * 60 * 60 * 1000; // 24 hours
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Default support status — install only.
|
|
12
|
+
*/
|
|
13
|
+
const DEFAULT_SUPPORT = { install: true, workspace: false, collaboration: false };
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Sort catalog: featured entries first (by order), then the rest alphabetically.
|
|
17
|
+
* Also ensures every entry has a support field.
|
|
18
|
+
*/
|
|
19
|
+
function _sortCatalog(catalog) {
|
|
20
|
+
for (const entry of catalog) {
|
|
21
|
+
if (!entry.support) entry.support = { ...DEFAULT_SUPPORT };
|
|
22
|
+
}
|
|
23
|
+
return catalog.sort((a, b) => {
|
|
24
|
+
const af = a.featured ? 1 : 0;
|
|
25
|
+
const bf = b.featured ? 1 : 0;
|
|
26
|
+
if (af !== bf) return bf - af; // featured first
|
|
27
|
+
if (af && bf) return (a.order || 999) - (b.order || 999); // by order within featured
|
|
28
|
+
return (a.label || a.name).localeCompare(b.label || b.name); // alphabetical for the rest
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
10
32
|
/**
|
|
11
33
|
* Agent registry — fetches the catalog of available agent types.
|
|
12
34
|
*
|
|
@@ -30,7 +52,7 @@ class Registry {
|
|
|
30
52
|
// Try cache first (avoids network on every call)
|
|
31
53
|
const cached = this._loadCache();
|
|
32
54
|
if (cached) {
|
|
33
|
-
this._catalog = this._mergeBundled(cached);
|
|
55
|
+
this._catalog = _sortCatalog(this._mergeBundled(cached));
|
|
34
56
|
this._refreshInBackground();
|
|
35
57
|
return this._catalog;
|
|
36
58
|
}
|
|
@@ -38,12 +60,12 @@ class Registry {
|
|
|
38
60
|
// No cache — try remote
|
|
39
61
|
const remote = await this._fetchRemote();
|
|
40
62
|
if (remote) {
|
|
41
|
-
this._catalog = this._mergeBundled(remote);
|
|
63
|
+
this._catalog = _sortCatalog(this._mergeBundled(remote));
|
|
42
64
|
return this._catalog;
|
|
43
65
|
}
|
|
44
66
|
|
|
45
67
|
// Fallback to bundled
|
|
46
|
-
this._catalog = this._loadBundled();
|
|
68
|
+
this._catalog = _sortCatalog(this._loadBundled());
|
|
47
69
|
return this._catalog;
|
|
48
70
|
}
|
|
49
71
|
|
|
@@ -54,10 +76,10 @@ class Registry {
|
|
|
54
76
|
if (this._catalog) return this._catalog;
|
|
55
77
|
const cached = this._loadCache();
|
|
56
78
|
if (cached) {
|
|
57
|
-
this._catalog = this._mergeBundled(cached);
|
|
79
|
+
this._catalog = _sortCatalog(this._mergeBundled(cached));
|
|
58
80
|
return this._catalog;
|
|
59
81
|
}
|
|
60
|
-
this._catalog = this._loadBundled();
|
|
82
|
+
this._catalog = _sortCatalog(this._loadBundled());
|
|
61
83
|
return this._catalog;
|
|
62
84
|
}
|
|
63
85
|
|
|
@@ -127,7 +149,7 @@ class Registry {
|
|
|
127
149
|
*/
|
|
128
150
|
async refresh() {
|
|
129
151
|
const remote = await this._fetchRemote();
|
|
130
|
-
if (remote) this._catalog = this._mergeBundled(remote);
|
|
152
|
+
if (remote) this._catalog = _sortCatalog(this._mergeBundled(remote));
|
|
131
153
|
return this._catalog || this.getCatalogSync();
|
|
132
154
|
}
|
|
133
155
|
|
package/src/workspace-client.js
CHANGED
|
@@ -347,10 +347,10 @@ class WorkspaceClient {
|
|
|
347
347
|
/**
|
|
348
348
|
* Open a new browser tab via POST /v1/browser/tabs.
|
|
349
349
|
*/
|
|
350
|
-
async browserOpenTab(workspaceId, token, { url = 'about:blank', source = 'human:user' } = {}) {
|
|
351
|
-
const
|
|
352
|
-
|
|
353
|
-
|
|
350
|
+
async browserOpenTab(workspaceId, token, { url = 'about:blank', source = 'human:user', context_id } = {}) {
|
|
351
|
+
const body = { url, network: workspaceId, source };
|
|
352
|
+
if (context_id) body.context_id = context_id;
|
|
353
|
+
const data = await this._post('/v1/browser/tabs', body, this._wsHeaders(token));
|
|
354
354
|
return data.data || data;
|
|
355
355
|
}
|
|
356
356
|
|
|
@@ -412,6 +412,15 @@ class WorkspaceClient {
|
|
|
412
412
|
return data.data || data;
|
|
413
413
|
}
|
|
414
414
|
|
|
415
|
+
/**
|
|
416
|
+
* List persistent browser contexts via GET /v1/browser/contexts.
|
|
417
|
+
*/
|
|
418
|
+
async browserListContexts(workspaceId, token) {
|
|
419
|
+
const params = new URLSearchParams({ network: workspaceId });
|
|
420
|
+
const data = await this._get(`/v1/browser/contexts?${params}`, this._wsHeaders(token));
|
|
421
|
+
return data.data || data;
|
|
422
|
+
}
|
|
423
|
+
|
|
415
424
|
// ── Internal helpers ──
|
|
416
425
|
|
|
417
426
|
/**
|