archgraph-argo 0.6.1 → 0.6.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/install-argo.ps1 CHANGED
@@ -3,6 +3,11 @@ param(
3
3
  [string]$ArgoRoot = "$env:USERPROFILE\.argo",
4
4
  [string]$SkillsRoot = "$env:USERPROFILE\.copilot\skills",
5
5
  [string]$PromptsRoot = "$env:APPDATA\Code\User\prompts",
6
+ [string]$CursorSkillsRoot = "$env:USERPROFILE\.cursor\skills",
7
+ [string]$CursorMcpPath = "$env:USERPROFILE\.cursor\mcp.json",
8
+ [string]$OpenCodeSkillsRoot = "$env:USERPROFILE\.config\opencode\skills",
9
+ [string]$OpenCodeAgentsPath = "$env:USERPROFILE\.config\opencode\AGENTS.md",
10
+ [string]$OpenCodeConfigPath = "$env:USERPROFILE\.config\opencode\opencode.json",
6
11
  [switch]$SkipEnv,
7
12
  [switch]$SkipDeps,
8
13
  [switch]$SkipMcp,
@@ -19,6 +24,64 @@ function Copy-Tree {
19
24
  Copy-Item -Recurse -Force -Path (Join-Path $Source '*') -Destination $Destination
20
25
  }
21
26
 
27
+ function Write-McpConfig {
28
+ param(
29
+ [string]$Path,
30
+ [string]$ServersKey,
31
+ $ServerConfig
32
+ )
33
+
34
+ $root = [ordered]@{}
35
+ if (Test-Path $Path) {
36
+ try {
37
+ $existing = Get-Content $Path -Raw | ConvertFrom-Json
38
+ foreach ($p in $existing.PSObject.Properties) {
39
+ $root[$p.Name] = $p.Value
40
+ }
41
+ } catch {
42
+ # Ignore an unparseable existing file and start fresh.
43
+ }
44
+ }
45
+
46
+ $servers = [ordered]@{}
47
+ if ($root.Contains($ServersKey)) {
48
+ $serversValue = $root[$ServersKey]
49
+ if ($null -ne $serversValue) {
50
+ foreach ($p in $serversValue.PSObject.Properties) {
51
+ $servers[$p.Name] = $p.Value
52
+ }
53
+ }
54
+ }
55
+ $servers['argo'] = $ServerConfig
56
+ $root[$ServersKey] = $servers
57
+
58
+ New-Item -ItemType Directory -Force -Path (Split-Path $Path) | Out-Null
59
+ $json = $root | ConvertTo-Json -Depth 10
60
+ [System.IO.File]::WriteAllText($Path, $json, (New-Object System.Text.UTF8Encoding $false))
61
+ }
62
+
63
+ function Add-AgentsRule {
64
+ param(
65
+ [string]$AgentsPath,
66
+ [string]$RulePath
67
+ )
68
+
69
+ New-Item -ItemType Directory -Force -Path (Split-Path $AgentsPath) | Out-Null
70
+ $ruleContent = Get-Content $RulePath -Raw
71
+ $marker = 'ArchGraph ARGO Workflow Rules'
72
+
73
+ if (Test-Path $AgentsPath) {
74
+ $existing = Get-Content $AgentsPath -Raw
75
+ if ($existing -like "*$marker*") {
76
+ return
77
+ }
78
+ $combined = $existing.TrimEnd() + "`n`n" + $ruleContent
79
+ [System.IO.File]::WriteAllText($AgentsPath, $combined, (New-Object System.Text.UTF8Encoding $false))
80
+ } else {
81
+ [System.IO.File]::WriteAllText($AgentsPath, $ruleContent, (New-Object System.Text.UTF8Encoding $false))
82
+ }
83
+ }
84
+
22
85
  Write-Host '==> Deploying Argo toolchain'
23
86
 
24
87
  $schemaSrc = Join-Path $argoDir 'schema'
@@ -52,6 +115,17 @@ $depsDest = Join-Path $ArgoRoot 'package.json'
52
115
  Write-Host "[6/6] argo\package.json -> $depsDest"
53
116
  Copy-Item -Force -Path $depsSrc -Destination $depsDest
54
117
 
118
+ $cursorSkillDest = Join-Path $CursorSkillsRoot 'argo-init'
119
+ Write-Host "[7/10] argo\skills\argo-init -> $cursorSkillDest (Cursor)"
120
+ Copy-Tree -Source $skillSrc -Destination $cursorSkillDest
121
+
122
+ $openCodeSkillDest = Join-Path $OpenCodeSkillsRoot 'argo-init'
123
+ Write-Host "[8/10] argo\skills\argo-init -> $openCodeSkillDest (OpenCode)"
124
+ Copy-Tree -Source $skillSrc -Destination $openCodeSkillDest
125
+
126
+ Write-Host "[9/10] argo\rules\archgraph.instructions.md -> $OpenCodeAgentsPath (OpenCode global AGENTS.md)"
127
+ Add-AgentsRule -AgentsPath $OpenCodeAgentsPath -RulePath $ruleSrc
128
+
55
129
  if ($SkipDeps) {
56
130
  Write-Host 'Skipped dependency install (-SkipDeps).'
57
131
  } elseif (Get-Command npm -ErrorAction SilentlyContinue) {
@@ -84,8 +158,26 @@ if ($SkipDeps) {
84
158
  if ($SkipEnv) {
85
159
  Write-Host 'Skipped .env generation (-SkipEnv).'
86
160
  } else {
161
+ $envPath = Join-Path $ArgoRoot '.env'
162
+
163
+ # Load existing values so we can skip prompting for variables that already
164
+ # hold a non-empty value. Missing or empty variables still get prompted.
165
+ $existing = @{}
166
+ if (Test-Path $envPath) {
167
+ foreach ($line in Get-Content $envPath) {
168
+ $line = $line.Trim()
169
+ if (-not $line -or $line.StartsWith('#')) { continue }
170
+ $sep = $line.IndexOf('=')
171
+ if ($sep -le 0) { continue }
172
+ $key = $line.Substring(0, $sep).Trim()
173
+ if ($key) {
174
+ $existing[$key] = $line.Substring($sep + 1).Trim()
175
+ }
176
+ }
177
+ }
178
+
87
179
  Write-Host ''
88
- Write-Host '==> Configure .env (press Enter to leave a value empty and fill it later)'
180
+ Write-Host '==> Configure .env (existing non-empty values are kept; press Enter to leave a value empty)'
89
181
  $envKeys = @(
90
182
  'ARGO_EMBEDDING_BASE_URL',
91
183
  'ARGO_EMBEDDING_MODEL',
@@ -102,11 +194,20 @@ if ($SkipEnv) {
102
194
 
103
195
  $lines = @('# Argo live-provider and Neo4j configuration.')
104
196
  foreach ($key in $envKeys) {
105
- $value = Read-Host $key
197
+ $existingValue = $null
198
+ if ($existing.ContainsKey($key)) {
199
+ $existingValue = $existing[$key]
200
+ }
201
+
202
+ if ($null -ne $existingValue -and -not [string]::IsNullOrWhiteSpace([string]$existingValue)) {
203
+ $value = $existingValue
204
+ } else {
205
+ $value = Read-Host $key
206
+ }
207
+
106
208
  $lines += "$key=$value"
107
209
  }
108
210
 
109
- $envPath = Join-Path $ArgoRoot '.env'
110
211
  [System.IO.File]::WriteAllLines(
111
212
  $envPath,
112
213
  $lines,
@@ -118,35 +219,32 @@ if ($SkipEnv) {
118
219
  if ($SkipMcp) {
119
220
  Write-Host 'Skipped MCP configuration (-SkipMcp).'
120
221
  } else {
121
- Write-Host '==> Registering argo MCP server in VS Code'
122
- $mcpPath = if ($McpPath) { $McpPath } else { Join-Path $env:APPDATA 'Code\User\mcp.json' }
123
222
  $argoServer = (Join-Path $ArgoRoot 'scripts\argo-mcp-server.js').Replace('\', '/')
124
223
 
125
- $servers = [ordered]@{}
126
- if (Test-Path $mcpPath) {
127
- try {
128
- $existing = Get-Content $mcpPath -Raw | ConvertFrom-Json
129
- if ($existing.PSObject.Properties.Name -contains 'servers') {
130
- foreach ($p in $existing.servers.PSObject.Properties) {
131
- $servers[$p.Name] = $p.Value
132
- }
133
- }
134
- } catch {
135
- # Ignore an unparseable existing file and start fresh.
136
- }
137
- }
138
-
139
- $servers['argo'] = [ordered]@{
224
+ Write-Host '==> Registering argo MCP server in VS Code (GitHub Copilot)'
225
+ $mcpPath = if ($McpPath) { $McpPath } else { Join-Path $env:APPDATA 'Code\User\mcp.json' }
226
+ Write-McpConfig -Path $mcpPath -ServersKey 'servers' -ServerConfig ([ordered]@{
140
227
  type = 'stdio'
141
228
  command = 'node'
142
229
  args = @($argoServer)
143
- }
144
-
145
- $config = [ordered]@{ servers = $servers }
146
- New-Item -ItemType Directory -Force -Path (Split-Path $mcpPath) | Out-Null
147
- $json = $config | ConvertTo-Json -Depth 8
148
- [System.IO.File]::WriteAllText($mcpPath, $json, (New-Object System.Text.UTF8Encoding $false))
230
+ })
149
231
  Write-Host "argo MCP config written -> $mcpPath"
232
+
233
+ Write-Host '==> Registering argo MCP server in Cursor'
234
+ Write-McpConfig -Path $CursorMcpPath -ServersKey 'mcpServers' -ServerConfig ([ordered]@{
235
+ type = 'stdio'
236
+ command = 'node'
237
+ args = @($argoServer)
238
+ })
239
+ Write-Host "argo MCP config written -> $CursorMcpPath"
240
+
241
+ Write-Host '==> Registering argo MCP server in OpenCode'
242
+ Write-McpConfig -Path $OpenCodeConfigPath -ServersKey 'mcp' -ServerConfig ([ordered]@{
243
+ type = 'local'
244
+ command = @('node', $argoServer)
245
+ enabled = $true
246
+ })
247
+ Write-Host "argo MCP config written -> $OpenCodeConfigPath"
150
248
  }
151
249
 
152
250
  Write-Host ''
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archgraph-argo",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "Deploy the ArchGraph ARGO toolchain, skills, and rules (schema, scripts, argo-init skill, global rule) with one command.",
5
5
  "license": "MIT",
6
6
  "bin": {
Binary file