archgraph-argo-beta 0.30.0-beta.1 → 0.30.0-beta.3
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/argo/scripts/cloud-client.js +1 -1
- package/argo/scripts/thin-mcp-server.js +40 -6
- package/install-argo.ps1 +10 -16
- package/package.json +1 -1
|
@@ -78,7 +78,7 @@ function createCloudClient({ url, token, fetchImpl } = {}) {
|
|
|
78
78
|
try { payload = JSON.parse(result.content[0].text); } catch { /* keep */ }
|
|
79
79
|
}
|
|
80
80
|
const isError = Boolean(result.isError) || Boolean(payload && payload.status === 'failed');
|
|
81
|
-
return { isError, payload };
|
|
81
|
+
return { isError, payload, structuredContent: result && result.structuredContent };
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
async function callTool(name, args) {
|
|
@@ -20,6 +20,7 @@ const readline = require('node:readline');
|
|
|
20
20
|
const binding = require('./workspace-binding.js');
|
|
21
21
|
const credentials = require('./cloud-credentials.js');
|
|
22
22
|
const argoMode = require('./argo-mode.js');
|
|
23
|
+
const argoPaths = require('./argo-paths.js');
|
|
23
24
|
const cloudClient = require('./cloud-client.js');
|
|
24
25
|
|
|
25
26
|
const WRITE_TOOLS = new Set([
|
|
@@ -94,12 +95,14 @@ function unwrapHandleResult(response) {
|
|
|
94
95
|
try { payload = JSON.parse(payload.content[0].text); } catch { /* keep */ }
|
|
95
96
|
}
|
|
96
97
|
const isError = Boolean(response && response.result && response.result.isError) || Boolean(payload && payload.status === 'failed');
|
|
97
|
-
|
|
98
|
+
const structuredContent = response && response.result && response.result.structuredContent;
|
|
99
|
+
return { isError, payload, structuredContent };
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
function createThinRouter({ mode, client, workspaceRoot, fullServer, projectId }) {
|
|
101
103
|
async function localHandle(name, args) {
|
|
102
|
-
const
|
|
104
|
+
const merged = { ...(args || {}), workspaceRoot };
|
|
105
|
+
const response = await fullServer.handleRequest({ jsonrpc: '2.0', id: 1, method: 'tools/call', params: { name, arguments: merged } });
|
|
103
106
|
return unwrapHandleResult(response);
|
|
104
107
|
}
|
|
105
108
|
return async function handleToolCall(name, args) {
|
|
@@ -115,7 +118,7 @@ function createThinRouter({ mode, client, workspaceRoot, fullServer, projectId }
|
|
|
115
118
|
|
|
116
119
|
function buildSession({ workspaceRoot, cfg, env }) {
|
|
117
120
|
const projectId = cfg && typeof cfg.projectId === 'string' && cfg.projectId.trim() ? cfg.projectId.trim() : null;
|
|
118
|
-
const mode = cfg && (cfg.mode === 'offline' || cfg.mode === 'online') ? cfg.mode : (env.ARGO_MODE === '
|
|
121
|
+
const mode = cfg && (cfg.mode === 'offline' || cfg.mode === 'online') ? cfg.mode : (env.ARGO_MODE === 'online' ? 'online' : 'offline');
|
|
119
122
|
const cloudCfg = cfg && cfg.cloud && typeof cfg.cloud === 'object' ? cfg.cloud : {};
|
|
120
123
|
const cloudUrl = cloudCfg.url || (cfg && cfg.cloudUrl) || env.ARGO_CLOUD_URL || null;
|
|
121
124
|
const token = credentials.resolveToken({ projectId, env }).token || env.ARGO_CLOUD_TOKEN || null;
|
|
@@ -147,6 +150,28 @@ async function main() {
|
|
|
147
150
|
|
|
148
151
|
let session = null; // { workspaceRoot, projectId, mode, cloudUrl, client }
|
|
149
152
|
|
|
153
|
+
// MCP roots handshake (parity with argo-mcp-server): the host advertises its
|
|
154
|
+
// workspace roots; we collect them and feed them to resolution so a roots-only
|
|
155
|
+
// host is addressed exactly like the full engine (ARGO_REPO_ROOT / cwd / marker
|
|
156
|
+
// still take precedence per workspace-binding's deterministic order).
|
|
157
|
+
let roots = [];
|
|
158
|
+
let rootsReqId = null;
|
|
159
|
+
let rootsTimer = null;
|
|
160
|
+
function requestRoots() {
|
|
161
|
+
if (argoPaths.hasStaticWorkspace() || rootsReqId) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
rootsReqId = 'argo-roots';
|
|
165
|
+
process.stdout.write(`${JSON.stringify({ jsonrpc: '2.0', id: rootsReqId, method: 'roots/list', params: {} })}\n`);
|
|
166
|
+
rootsTimer = setTimeout(() => { rootsTimer = null; rootsReqId = null; }, 8000);
|
|
167
|
+
}
|
|
168
|
+
function setRoots(list) {
|
|
169
|
+
roots = Array.isArray(list) ? list : [];
|
|
170
|
+
argoPaths.setMcpWorkspaceRoots(roots);
|
|
171
|
+
if (rootsTimer) { clearTimeout(rootsTimer); rootsTimer = null; }
|
|
172
|
+
rootsReqId = null;
|
|
173
|
+
}
|
|
174
|
+
|
|
150
175
|
function readCfg(workspaceRoot) {
|
|
151
176
|
try {
|
|
152
177
|
const loaded = argoMode.readWorkspaceConfig(workspaceRoot);
|
|
@@ -165,7 +190,7 @@ async function main() {
|
|
|
165
190
|
return session;
|
|
166
191
|
}
|
|
167
192
|
try {
|
|
168
|
-
const resolution = binding.resolveWorkspaceRoot({ args: {}, env, cwd: process.cwd(), roots
|
|
193
|
+
const resolution = binding.resolveWorkspaceRoot({ args: {}, env, cwd: process.cwd(), roots });
|
|
169
194
|
session = bindFrom(resolution.workspaceRoot);
|
|
170
195
|
return session;
|
|
171
196
|
} catch {
|
|
@@ -181,6 +206,9 @@ async function main() {
|
|
|
181
206
|
let request;
|
|
182
207
|
try { request = JSON.parse(line); } catch { continue; }
|
|
183
208
|
if (request.method === undefined && request.id !== undefined) {
|
|
209
|
+
if (request.id === rootsReqId) {
|
|
210
|
+
setRoots(request.result && request.result.roots);
|
|
211
|
+
}
|
|
184
212
|
continue;
|
|
185
213
|
}
|
|
186
214
|
const { id, method, params } = request;
|
|
@@ -188,10 +216,16 @@ async function main() {
|
|
|
188
216
|
try {
|
|
189
217
|
if (method === 'initialize') {
|
|
190
218
|
response = { jsonrpc: '2.0', id, result: { protocolVersion: '2024-11-05', capabilities: { tools: {} }, serverInfo: { name: 'argo-thin', version: '1.0.0' } } };
|
|
219
|
+
requestRoots();
|
|
191
220
|
} else if (typeof method === 'string' && method.startsWith('notifications/')) {
|
|
221
|
+
if (method === 'notifications/initialized') {
|
|
222
|
+
requestRoots();
|
|
223
|
+
} else if (method === 'notifications/roots/list_changed') {
|
|
224
|
+
setRoots(params && params.roots);
|
|
225
|
+
}
|
|
192
226
|
response = null;
|
|
193
227
|
} else if (method === 'tools/list') {
|
|
194
|
-
const useOnline = (session ? session.mode : (env.ARGO_MODE
|
|
228
|
+
const useOnline = (session ? session.mode : (env.ARGO_MODE === 'online' ? 'online' : 'offline')) === 'online';
|
|
195
229
|
const client = (session && session.client) || envClient;
|
|
196
230
|
const tools = useOnline && client
|
|
197
231
|
? await client.listTools()
|
|
@@ -206,7 +240,7 @@ async function main() {
|
|
|
206
240
|
} else {
|
|
207
241
|
const handle = createThinRouter({ mode: s.mode, client: s.client, workspaceRoot: s.workspaceRoot, fullServer, projectId: s.projectId });
|
|
208
242
|
const r = await handle(name, args);
|
|
209
|
-
response = { jsonrpc: '2.0', id, result: { content: [{ type: 'text', text: JSON.stringify(r.payload) }], ...(r.isError ? { isError: true } : {}) } };
|
|
243
|
+
response = { jsonrpc: '2.0', id, result: { content: [{ type: 'text', text: JSON.stringify(r.payload) }], ...(r.structuredContent ? { structuredContent: r.structuredContent } : {}), ...(r.isError ? { isError: true } : {}) } };
|
|
210
244
|
}
|
|
211
245
|
} else {
|
|
212
246
|
response = { jsonrpc: '2.0', id, error: { code: -32601, message: `Method not found: ${method}` } };
|
package/install-argo.ps1
CHANGED
|
@@ -354,11 +354,7 @@ function Write-OpenCodeSystemConfig {
|
|
|
354
354
|
type = 'local'
|
|
355
355
|
command = @('node', $ArgoServer)
|
|
356
356
|
enabled = $true
|
|
357
|
-
}) -
|
|
358
|
-
type = 'remote'
|
|
359
|
-
url = $GraphMcpUrl
|
|
360
|
-
enabled = $true
|
|
361
|
-
} }) -ThrowOnParseError
|
|
357
|
+
}) -ThrowOnParseError
|
|
362
358
|
}
|
|
363
359
|
|
|
364
360
|
# 4) Instructions / skills / plugins -> managed JSON (highest-priority layer).
|
|
@@ -871,7 +867,6 @@ function Write-CodexMcpConfig {
|
|
|
871
867
|
if (-not [string]::IsNullOrWhiteSpace($RepoRoot)) {
|
|
872
868
|
$blocks.Add(("[mcp_servers.argo.env]`nARGO_REPO_ROOT = $(ConvertTo-TomlString $RepoRoot)"))
|
|
873
869
|
}
|
|
874
|
-
$blocks.Add(("[mcp_servers.graph-mcp]`nurl = $(ConvertTo-TomlString $GraphMcpUrl)"))
|
|
875
870
|
|
|
876
871
|
$result = ($kept -join "`n")
|
|
877
872
|
if ($result.Trim() -ne '') { $result = $result.TrimEnd() + "`n`n" }
|
|
@@ -879,7 +874,7 @@ function Write-CodexMcpConfig {
|
|
|
879
874
|
|
|
880
875
|
New-Item -ItemType Directory -Force -Path (Split-Path $ConfigPath) | Out-Null
|
|
881
876
|
[System.IO.File]::WriteAllText($ConfigPath, $result, (New-Object System.Text.UTF8Encoding $false))
|
|
882
|
-
Write-Host " Codex MCP: argo (stdio)
|
|
877
|
+
Write-Host " Codex MCP: argo (stdio) -> $ConfigPath"
|
|
883
878
|
}
|
|
884
879
|
|
|
885
880
|
function Write-DshManagedBlock {
|
|
@@ -1268,7 +1263,7 @@ if ($SkipDsh) {
|
|
|
1268
1263
|
$ruleSrcContent = Get-Content $ruleSrc -Raw -Encoding UTF8
|
|
1269
1264
|
$dshSkillDest = Join-Path (Join-Path $DshHome 'skills') 'argo-init'
|
|
1270
1265
|
$patchPath = Join-Path $DshHome 'cordis.patch.yml'
|
|
1271
|
-
$argoServer = (Join-Path $ArgoRoot 'scripts\
|
|
1266
|
+
$argoServer = (Join-Path $ArgoRoot 'scripts\thin-mcp-server.js').Replace('\', '/')
|
|
1272
1267
|
|
|
1273
1268
|
Write-Host "[15/22] argo\rules\archgraph.instructions.md -> $DshHome\AGENTS.md (DeepSeek Harness user-global rule, frontmatter stripped)"
|
|
1274
1269
|
Write-DshAgentRule -DshHome $DshHome -RuleText $ruleSrcContent
|
|
@@ -1308,7 +1303,6 @@ if ($SkipDsh) {
|
|
|
1308
1303
|
# workspace (workspaceRoot), graph-mcp does not inject workspaceRoot.
|
|
1309
1304
|
$serversYaml = " servers:`n"
|
|
1310
1305
|
$serversYaml += " - id: argo`n serverPath: '$argoServer'`n injectWorkspaceRoot: true`n"
|
|
1311
|
-
$serversYaml += " - id: graph-mcp`n command: node`n args:`n - '$dshGraphBridgePath'`n env:`n GRAPH_MCP_URL: '$GraphMcpUrl'`n injectWorkspaceRoot: false`n"
|
|
1312
1306
|
$bridgeConfig = " config:`n" + $serversYaml
|
|
1313
1307
|
if ($DshWorkspaces) {
|
|
1314
1308
|
$wsList = @($DshWorkspaces.Replace('\', '/').Split(';') | ForEach-Object { " - $_" }) -join "`n"
|
|
@@ -1405,7 +1399,7 @@ if ($SkipDoubao) {
|
|
|
1405
1399
|
Copy-Tree -Source (Join-Path $argoDir 'mcp-bridges') -Destination $doubaoBridgeDir
|
|
1406
1400
|
$doubaoBridgePath = Join-Path $doubaoBridgeDir 'graph-mcp-stdio.js'
|
|
1407
1401
|
if (-not (Test-Path $doubaoBridgePath)) { $doubaoBridgePath = '' }
|
|
1408
|
-
Write-DoubaoMcpRecipe -RecipePath (Join-Path $ArgoRoot 'doubao-mcp.json') -ArgoServer (Join-Path $ArgoRoot 'scripts\
|
|
1402
|
+
Write-DoubaoMcpRecipe -RecipePath (Join-Path $ArgoRoot 'doubao-mcp.json') -ArgoServer (Join-Path $ArgoRoot 'scripts\thin-mcp-server.js')
|
|
1409
1403
|
Write-Host ' the argo connector has no fixed workspace: it follows the workspace you'
|
|
1410
1404
|
Write-Host ' select in Doubao (MCP roots / connector workingDirectory), like OpenCode/DSH.'
|
|
1411
1405
|
Write-Host ' note: Doubao has no AGENTS.md-equivalent always-on rule file, so the ARGO'
|
|
@@ -1521,7 +1515,7 @@ if ($SkipEnv) {
|
|
|
1521
1515
|
if ($SkipMcp) {
|
|
1522
1516
|
Write-Host 'Skipped MCP configuration (-SkipMcp).'
|
|
1523
1517
|
} else {
|
|
1524
|
-
$argoServer = (Join-Path $ArgoRoot 'scripts\
|
|
1518
|
+
$argoServer = (Join-Path $ArgoRoot 'scripts\thin-mcp-server.js').Replace('\', '/')
|
|
1525
1519
|
# graph-mcp is a Streamable HTTP remote MCP endpoint. Its config shape is
|
|
1526
1520
|
# HOST-SPECIFIC (each host's mcp.json schema is different):
|
|
1527
1521
|
# - OpenCode (opencode.json mcp.<name>): {type: remote, url, enabled}
|
|
@@ -1564,7 +1558,7 @@ if ($SkipMcp) {
|
|
|
1564
1558
|
type = 'stdio'
|
|
1565
1559
|
command = 'node'
|
|
1566
1560
|
args = @($argoServer)
|
|
1567
|
-
})
|
|
1561
|
+
})
|
|
1568
1562
|
Write-Host "argo MCP config written -> $mcpPath"
|
|
1569
1563
|
|
|
1570
1564
|
Write-Host '==> Registering argo MCP server in Cursor'
|
|
@@ -1572,7 +1566,7 @@ if ($SkipMcp) {
|
|
|
1572
1566
|
type = 'stdio'
|
|
1573
1567
|
command = 'node'
|
|
1574
1568
|
args = @($argoServer)
|
|
1575
|
-
})
|
|
1569
|
+
})
|
|
1576
1570
|
Write-Host "argo MCP config written -> $CursorMcpPath"
|
|
1577
1571
|
Write-Host " graph-mcp registered as stdio bridge -> $graphMcpBridgePath"
|
|
1578
1572
|
|
|
@@ -1581,7 +1575,7 @@ if ($SkipMcp) {
|
|
|
1581
1575
|
type = 'local'
|
|
1582
1576
|
command = @('node', $argoServer)
|
|
1583
1577
|
enabled = $true
|
|
1584
|
-
})
|
|
1578
|
+
})
|
|
1585
1579
|
Write-Host "argo MCP config written -> $OpenCodeConfigPath"
|
|
1586
1580
|
|
|
1587
1581
|
if (-not $SkipOpenClaw) {
|
|
@@ -1590,7 +1584,7 @@ if ($SkipMcp) {
|
|
|
1590
1584
|
# installer runs from a non-workspace npm-global package dir).
|
|
1591
1585
|
$openClawRepoRoot = if ($OpenClawRepoRoot) { $OpenClawRepoRoot } else { $repoRoot }
|
|
1592
1586
|
Write-Host "[22/22] argo MCP server -> $(Join-Path $OpenClawHome 'openclaw.json') (OpenClaw mcp.servers.argo, env.ARGO_REPO_ROOT pinned)"
|
|
1593
|
-
Write-OpenClawMcpConfig -OpenClawHome $OpenClawHome -RepoRoot $openClawRepoRoot -ArgoServer $argoServer
|
|
1587
|
+
Write-OpenClawMcpConfig -OpenClawHome $OpenClawHome -RepoRoot $openClawRepoRoot -ArgoServer $argoServer
|
|
1594
1588
|
}
|
|
1595
1589
|
}
|
|
1596
1590
|
|
|
@@ -1604,7 +1598,7 @@ if ($OpenCodeSystemConfigPath -and -not $isWindowsHost) {
|
|
|
1604
1598
|
Write-Host "==> Deploying OpenCode system managed config -> $OpenCodeSystemConfigPath"
|
|
1605
1599
|
try {
|
|
1606
1600
|
$systemSkillsRoot = Join-Path (Split-Path -Parent $OpenCodeSystemConfigPath) 'skills'
|
|
1607
|
-
$systemArgoServer = (Join-Path $ArgoRoot 'scripts\
|
|
1601
|
+
$systemArgoServer = (Join-Path $ArgoRoot 'scripts\thin-mcp-server.js').Replace('\', '/')
|
|
1608
1602
|
Write-OpenCodeSystemConfig `
|
|
1609
1603
|
-ConfigPath $OpenCodeSystemConfigPath `
|
|
1610
1604
|
-SkillsRoot $systemSkillsRoot `
|
package/package.json
CHANGED