archgraph-argo 0.8.1 → 0.8.2
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 +52 -10
- package/package.json +1 -1
package/install-argo.ps1
CHANGED
|
@@ -31,20 +31,62 @@ function Copy-Agents {
|
|
|
31
31
|
param(
|
|
32
32
|
[string]$Source,
|
|
33
33
|
[string]$Destination,
|
|
34
|
-
[
|
|
34
|
+
[string]$Target
|
|
35
35
|
)
|
|
36
36
|
New-Item -ItemType Directory -Force -Path $Destination | Out-Null
|
|
37
37
|
$files = @(Get-ChildItem -Path (Join-Path $Source '*.agent.md') -ErrorAction SilentlyContinue)
|
|
38
38
|
foreach ($file in $files) {
|
|
39
|
-
if ($
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
if (-not $Target) {
|
|
40
|
+
# Copilot: VS Code format, keep the .agent.md extension verbatim.
|
|
41
|
+
Copy-Item -Force -Path $file.FullName -Destination (Join-Path $Destination $file.Name)
|
|
42
|
+
continue
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
$targetName = ($file.BaseName -replace '\.agent$', '') + '.md'
|
|
45
|
+
Convert-AgentFile -SourceFile $file.FullName -DestinationFile (Join-Path $Destination $targetName) -Target $Target
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
|
|
49
|
+
function Convert-AgentFile {
|
|
50
|
+
param(
|
|
51
|
+
[string]$SourceFile,
|
|
52
|
+
[string]$DestinationFile,
|
|
53
|
+
[string]$Target
|
|
54
|
+
)
|
|
55
|
+
$content = Get-Content $SourceFile -Raw -Encoding UTF8
|
|
56
|
+
$m = [regex]::Match($content, '(?s)^---\s*\r?\n(.*?)\r?\n---\s*\r?\n(.*)$')
|
|
57
|
+
if (-not $m.Success) {
|
|
58
|
+
Copy-Item -Force -Path $SourceFile -Destination $DestinationFile
|
|
59
|
+
return
|
|
60
|
+
}
|
|
61
|
+
$front = $m.Groups[1].Value
|
|
62
|
+
$body = $m.Groups[2].Value
|
|
63
|
+
|
|
64
|
+
$name = ''
|
|
65
|
+
$desc = ''
|
|
66
|
+
$nm = [regex]::Match($front, '(?m)^name:\s*(.*)$')
|
|
67
|
+
if ($nm.Success) { $name = $nm.Groups[1].Value.Trim().Trim('"').Trim("'") }
|
|
68
|
+
$dm = [regex]::Match($front, '(?m)^description:\s*(.*)$')
|
|
69
|
+
if ($dm.Success) { $desc = $dm.Groups[1].Value.Trim().Trim('"').Trim("'") }
|
|
70
|
+
|
|
71
|
+
if ($Target -eq 'opencode') {
|
|
72
|
+
# OpenCode markdown agent: description is required; mode: all keeps it
|
|
73
|
+
# usable as primary and subagent. Drop VS Code-only fields (tools array,
|
|
74
|
+
# model, user-invocable, argument-hint) which OpenCode rejects.
|
|
75
|
+
$newFront = "---`r`n"
|
|
76
|
+
if ($desc) { $newFront += "description: `"$($desc -replace '"','\"')`"`r`n" }
|
|
77
|
+
$newFront += "mode: all`r`n---`r`n"
|
|
78
|
+
} else {
|
|
79
|
+
# Cursor markdown agent: name + description; drop VS Code-only fields.
|
|
80
|
+
$newFront = "---`r`n"
|
|
81
|
+
if ($name) { $newFront += "name: `"$name`"`r`n" }
|
|
82
|
+
if ($desc) { $newFront += "description: `"$($desc -replace '"','\"')`"`r`n" }
|
|
83
|
+
$newFront += "---`r`n"
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
$result = $newFront + "`r`n" + $body
|
|
87
|
+
[System.IO.File]::WriteAllText($DestinationFile, $result, (New-Object System.Text.UTF8Encoding $false))
|
|
88
|
+
}
|
|
89
|
+
|
|
48
90
|
function Write-McpConfig {
|
|
49
91
|
param(
|
|
50
92
|
[string]$Path,
|
|
@@ -172,11 +214,11 @@ $agentsSrc = Join-Path $argoDir 'agents'
|
|
|
172
214
|
Write-Host "[10/12] argo\agents -> $CopilotAgentsRoot (Copilot user-level)"
|
|
173
215
|
Copy-Agents -Source $agentsSrc -Destination $CopilotAgentsRoot
|
|
174
216
|
|
|
175
|
-
Write-Host "[11/12] argo\agents -> $CursorAgentsRoot (Cursor user-level,
|
|
176
|
-
Copy-Agents -Source $agentsSrc -Destination $CursorAgentsRoot -
|
|
217
|
+
Write-Host "[11/12] argo\agents -> $CursorAgentsRoot (Cursor user-level, converted to .md)"
|
|
218
|
+
Copy-Agents -Source $agentsSrc -Destination $CursorAgentsRoot -Target cursor
|
|
177
219
|
|
|
178
|
-
Write-Host "[12/12] argo\agents -> $OpenCodeAgentsRoot (OpenCode user-level,
|
|
179
|
-
Copy-Agents -Source $agentsSrc -Destination $OpenCodeAgentsRoot -
|
|
220
|
+
Write-Host "[12/12] argo\agents -> $OpenCodeAgentsRoot (OpenCode user-level, converted to .md)"
|
|
221
|
+
Copy-Agents -Source $agentsSrc -Destination $OpenCodeAgentsRoot -Target opencode
|
|
180
222
|
|
|
181
223
|
if ($SkipDeps) {
|
|
182
224
|
Write-Host 'Skipped dependency install (-SkipDeps).'
|
package/package.json
CHANGED