archgraph-argo 0.10.22 → 0.10.24

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.
Files changed (2) hide show
  1. package/install-argo.ps1 +137 -45
  2. package/package.json +1 -1
package/install-argo.ps1 CHANGED
@@ -20,6 +20,9 @@ param(
20
20
  [string]$DshHome = "$env:USERPROFILE\.dsh",
21
21
  [string]$DshCwd = '',
22
22
  [string]$DshWorkspaces = '',
23
+ [string]$OpenClawHome = "$env:USERPROFILE\.openclaw",
24
+ [string]$OpenClawWorkspace = "$env:USERPROFILE\.openclaw\workspace",
25
+ [switch]$SkipOpenClaw,
23
26
  [string]$McpPath
24
27
  )
25
28
 
@@ -265,47 +268,112 @@ function Get-WakeupGuideline {
265
268
  return $m.Groups[1].Value.Trim()
266
269
  }
267
270
 
268
- function Write-DshAgentRule {
269
- # Merge the frontmatter-stripped ArchGraph rule into ~/.dsh/AGENTS.md,
270
- # replacing the previous ArchGraph block while preserving surrounding user
271
- # content. The rule body is injected verbatim - no adapter prose, so the
272
- # working prompt stays identical to the Copilot / Cursor / OpenCode rules.
271
+ function Write-ArchGraphRuleBlock {
272
+ # Merge the frontmatter-stripped ArchGraph rule into a target AGENTS.md
273
+ # file (DSH home or OpenClaw workspace), replacing the previous ArchGraph
274
+ # block while preserving surrounding user content. The rule body is
275
+ # injected verbatim - no adapter prose - so the working prompt stays
276
+ # identical to the Copilot / Cursor / OpenCode rules.
273
277
  param(
274
- [string]$DshHome,
275
- [string]$RuleText
278
+ [string]$DestPath,
279
+ [string]$RuleText,
280
+ [string]$Label
276
281
  )
277
282
  $ruleContent = Get-MarkdownBody -Content $RuleText
278
- $dest = Join-Path $DshHome 'AGENTS.md'
279
283
  $marker = '<WakeupGuideline>'
280
- New-Item -ItemType Directory -Force -Path $DshHome | Out-Null
281
- if (Test-Path $dest) {
282
- $existing = Get-Content $dest -Raw -Encoding UTF8
284
+ New-Item -ItemType Directory -Force -Path (Split-Path $DestPath) | Out-Null
285
+ if (Test-Path $DestPath) {
286
+ $existing = Get-Content $DestPath -Raw -Encoding UTF8
283
287
  if ($existing -like "*$marker*") {
284
288
  $endTag = '</ToolsGuideline>'
285
289
  $startIdx = $existing.IndexOf($marker)
286
290
  if ($startIdx -lt 0) { $startIdx = 0 }
287
291
  $endIdx = $existing.IndexOf($endTag, $startIdx)
288
292
  $before = $existing.Substring(0, $startIdx).TrimEnd()
289
- if ($endIdx -lt 0) {
290
- $combined = $before
291
- if ($combined.Length -gt 0) { $combined += "`n`n" }
292
- $combined += $ruleContent
293
- } else {
294
- $after = $existing.Substring($endIdx + $endTag.Length)
295
- $combined = $before
296
- if ($combined.Length -gt 0) { $combined += "`n`n" }
297
- $combined += $ruleContent
298
- if ($after.Length -gt 0) { $combined += $after }
299
- }
300
- [System.IO.File]::WriteAllText($dest, $combined, (New-Object System.Text.UTF8Encoding $false))
293
+ $after = ''
294
+ if ($endIdx -ge 0) { $after = $existing.Substring($endIdx + $endTag.Length).TrimStart() }
295
+ $combined = $before
296
+ if ($combined.Length -gt 0) { $combined += "`n`n" }
297
+ $combined += $ruleContent
298
+ if ($after.Length -gt 0) { $combined += "`n`n" + $after }
299
+ [System.IO.File]::WriteAllText($DestPath, $combined, (New-Object System.Text.UTF8Encoding $false))
301
300
  } else {
302
301
  $combined = $existing.TrimEnd() + "`n`n" + $ruleContent
303
- [System.IO.File]::WriteAllText($dest, $combined, (New-Object System.Text.UTF8Encoding $false))
302
+ [System.IO.File]::WriteAllText($DestPath, $combined, (New-Object System.Text.UTF8Encoding $false))
304
303
  }
305
304
  } else {
306
- [System.IO.File]::WriteAllText($dest, $ruleContent, (New-Object System.Text.UTF8Encoding $false))
305
+ [System.IO.File]::WriteAllText($DestPath, $ruleContent, (New-Object System.Text.UTF8Encoding $false))
307
306
  }
308
- Write-Host " DSH rule installed -> $dest"
307
+ Write-Host " $Label installed -> $DestPath"
308
+ }
309
+
310
+ function Write-DshAgentRule {
311
+ # Merge the frontmatter-stripped ArchGraph rule into ~/.dsh/AGENTS.md
312
+ # (DeepSeek Harness user-global rule), replacing the previous ArchGraph
313
+ # block while preserving surrounding user content.
314
+ param(
315
+ [string]$DshHome,
316
+ [string]$RuleText
317
+ )
318
+ Write-ArchGraphRuleBlock -DestPath (Join-Path $DshHome 'AGENTS.md') -RuleText $RuleText -Label 'DSH rule'
319
+ }
320
+
321
+ function Write-OpenClawAgentRule {
322
+ # Deploy the ArchGraph rules into the OpenClaw agent workspace AGENTS.md.
323
+ # OpenClaw injects AGENTS.md into Project Context on every session (the
324
+ # same mechanism as the DSH / OpenCode AGENTS.md rules), so the
325
+ # UNCONDITIONAL STARTUP GATE is always active for OpenClaw agents.
326
+ param(
327
+ [string]$OpenClawWorkspace,
328
+ [string]$RuleText
329
+ )
330
+ Write-ArchGraphRuleBlock -DestPath (Join-Path $OpenClawWorkspace 'AGENTS.md') -RuleText $RuleText -Label 'OpenClaw rule'
331
+ }
332
+
333
+ function Write-OpenClawMcpConfig {
334
+ # Register the argo MCP server under mcp.servers.argo in
335
+ # ~/.openclaw/openclaw.json. OpenClaw is a fixed-workspace host: its
336
+ # embedded MCP client does not advertise MCP roots, so the workspace is
337
+ # pinned explicitly via env.ARGO_REPO_ROOT to the repository root this
338
+ # installer runs from. Existing config keys are preserved; a JSON5 (non
339
+ # strict JSON) config is left untouched with a manual-registration hint.
340
+ param(
341
+ [string]$OpenClawHome,
342
+ [string]$RepoRoot,
343
+ [string]$ArgoServer
344
+ )
345
+ $configPath = Join-Path $OpenClawHome 'openclaw.json'
346
+ $root = [ordered]@{}
347
+ if (Test-Path $configPath) {
348
+ try {
349
+ $existing = Get-Content $configPath -Raw | ConvertFrom-Json
350
+ foreach ($p in $existing.PSObject.Properties) {
351
+ $root[$p.Name] = $p.Value
352
+ }
353
+ } catch {
354
+ Write-Warning " $configPath is not strict JSON (JSON5 with comments?); skipping argo MCP registration."
355
+ Write-Warning " Register manually: openclaw mcp add argo --command node --arg `"$ArgoServer`" --env ARGO_REPO_ROOT=$RepoRoot"
356
+ return
357
+ }
358
+ }
359
+ $mcp = [ordered]@{}
360
+ if ($root.Contains('mcp') -and $null -ne $root['mcp']) {
361
+ foreach ($p in $root['mcp'].PSObject.Properties) { $mcp[$p.Name] = $p.Value }
362
+ }
363
+ $servers = [ordered]@{}
364
+ if ($mcp.Contains('servers') -and $null -ne $mcp['servers']) {
365
+ foreach ($p in $mcp['servers'].PSObject.Properties) { $servers[$p.Name] = $p.Value }
366
+ }
367
+ $servers['argo'] = [ordered]@{
368
+ command = 'node'
369
+ args = @($ArgoServer)
370
+ env = [ordered]@{ ARGO_REPO_ROOT = $RepoRoot }
371
+ }
372
+ $mcp['servers'] = $servers
373
+ $root['mcp'] = $mcp
374
+ New-Item -ItemType Directory -Force -Path $OpenClawHome | Out-Null
375
+ $json = $root | ConvertTo-Json -Depth 12
376
+ [System.IO.File]::WriteAllText($configPath, $json, (New-Object System.Text.UTF8Encoding $false))
309
377
  }
310
378
 
311
379
  function Write-DshManagedBlock {
@@ -618,63 +686,63 @@ Write-Host '==> Deploying Argo toolchain'
618
686
 
619
687
  $schemaSrc = Join-Path $argoDir 'schema'
620
688
  $schemaDest = Join-Path $ArgoRoot 'schema'
621
- Write-Host "[1/19] argo\schema -> $schemaDest"
689
+ Write-Host "[1/22] argo\schema -> $schemaDest"
622
690
  Copy-Tree -Source $schemaSrc -Destination $schemaDest
623
691
 
624
692
  $scriptsSrc = Join-Path $argoDir 'scripts'
625
693
  $scriptsDest = Join-Path $ArgoRoot 'scripts'
626
- Write-Host "[2/19] argo\scripts -> $scriptsDest"
694
+ Write-Host "[2/22] argo\scripts -> $scriptsDest"
627
695
  Copy-Tree -Source $scriptsSrc -Destination $scriptsDest
628
696
 
629
697
  $defaultsSrc = Join-Path $argoDir 'defaults'
630
698
  $defaultsDest = Join-Path $ArgoRoot 'defaults'
631
- Write-Host "[3/19] argo\defaults -> $defaultsDest"
699
+ Write-Host "[3/22] argo\defaults -> $defaultsDest"
632
700
  Copy-Tree -Source $defaultsSrc -Destination $defaultsDest
633
701
 
634
702
  $skillSrc = Join-Path (Join-Path $argoDir 'skills') 'argo-init'
635
703
  $skillDest = Join-Path $SkillsRoot 'argo-init'
636
- Write-Host "[4/19] argo\skills\argo-init -> $skillDest"
704
+ Write-Host "[4/22] argo\skills\argo-init -> $skillDest"
637
705
  Copy-Tree -Source $skillSrc -Destination $skillDest
638
706
 
639
707
  $ruleSrc = Join-Path (Join-Path $argoDir 'rules') 'archgraph.instructions.md'
640
708
  $ruleDest = Join-Path $PromptsRoot 'archgraph.instructions.md'
641
- Write-Host "[5/19] argo\rules\archgraph.instructions.md -> $ruleDest"
709
+ Write-Host "[5/22] argo\rules\archgraph.instructions.md -> $ruleDest"
642
710
  New-Item -ItemType Directory -Force -Path $PromptsRoot | Out-Null
643
711
  Copy-Item -Force -Path $ruleSrc -Destination $ruleDest
644
712
 
645
713
  $depsSrc = Join-Path $argoDir 'package.json'
646
714
  $depsDest = Join-Path $ArgoRoot 'package.json'
647
- Write-Host "[6/19] argo\package.json -> $depsDest"
715
+ Write-Host "[6/22] argo\package.json -> $depsDest"
648
716
  Copy-Item -Force -Path $depsSrc -Destination $depsDest
649
717
 
650
718
  $cursorSkillDest = Join-Path $CursorSkillsRoot 'argo-init'
651
- Write-Host "[7/19] argo\skills\argo-init -> $cursorSkillDest (Cursor)"
719
+ Write-Host "[7/22] argo\skills\argo-init -> $cursorSkillDest (Cursor)"
652
720
  Copy-Tree -Source $skillSrc -Destination $cursorSkillDest
653
721
 
654
722
  $openCodeSkillDest = Join-Path $OpenCodeSkillsRoot 'argo-init'
655
- Write-Host "[8/19] argo\skills\argo-init -> $openCodeSkillDest (OpenCode)"
723
+ Write-Host "[8/22] argo\skills\argo-init -> $openCodeSkillDest (OpenCode)"
656
724
  Copy-Tree -Source $skillSrc -Destination $openCodeSkillDest
657
725
 
658
- Write-Host "[9/19] argo\rules\archgraph.instructions.md -> $OpenCodeAgentsPath (OpenCode global AGENTS.md)"
726
+ Write-Host "[9/22] argo\rules\archgraph.instructions.md -> $OpenCodeAgentsPath (OpenCode global AGENTS.md)"
659
727
  Add-AgentsRule -AgentsPath $OpenCodeAgentsPath -RulePath $ruleSrc
660
728
 
661
729
  $agentsSrc = Join-Path $argoDir 'agents'
662
- Write-Host "[10/19] argo\agents -> $CopilotAgentsRoot (Copilot user-level)"
730
+ Write-Host "[10/22] argo\agents -> $CopilotAgentsRoot (Copilot user-level)"
663
731
  Copy-Agents -Source $agentsSrc -Destination $CopilotAgentsRoot
664
732
 
665
- Write-Host "[11/19] argo\agents -> $CursorAgentsRoot (Cursor user-level, converted to .md)"
733
+ Write-Host "[11/22] argo\agents -> $CursorAgentsRoot (Cursor user-level, converted to .md)"
666
734
  Copy-Agents -Source $agentsSrc -Destination $CursorAgentsRoot -Target cursor
667
735
 
668
- Write-Host "[12/19] argo\agents -> $OpenCodeAgentsRoot (OpenCode user-level, converted to .md)"
736
+ Write-Host "[12/22] argo\agents -> $OpenCodeAgentsRoot (OpenCode user-level, converted to .md)"
669
737
  Copy-Agents -Source $agentsSrc -Destination $OpenCodeAgentsRoot -Target opencode
670
738
 
671
739
  $pluginsSrc = Join-Path $argoDir 'plugins'
672
- Write-Host "[13/19] argo\plugins -> $PluginsRoot (Argo opencode plugins)"
740
+ Write-Host "[13/22] argo\plugins -> $PluginsRoot (Argo opencode plugins)"
673
741
  Copy-Tree -Source $pluginsSrc -Destination $PluginsRoot
674
742
 
675
743
  $cursorRuleSrc = Join-Path (Join-Path $argoDir 'rules') 'archgraph.instructions.md'
676
744
  $cursorRuleDest = Join-Path $CursorRulesRoot 'archgraph.mdc'
677
- Write-Host "[14/19] argo\rules\archgraph.instructions.md -> $cursorRuleDest (Cursor global rule, alwaysApply)"
745
+ Write-Host "[14/22] argo\rules\archgraph.instructions.md -> $cursorRuleDest (Cursor global rule, alwaysApply)"
678
746
  New-Item -ItemType Directory -Force -Path $CursorRulesRoot | Out-Null
679
747
  Convert-RuleFile -SourceFile $cursorRuleSrc -DestinationFile $cursorRuleDest
680
748
 
@@ -686,16 +754,16 @@ if ($SkipDsh) {
686
754
  $patchPath = Join-Path $DshHome 'cordis.patch.yml'
687
755
  $argoServer = (Join-Path $ArgoRoot 'scripts\argo-mcp-server.js').Replace('\', '/')
688
756
 
689
- Write-Host "[15/19] argo\rules\archgraph.instructions.md -> $DshHome\AGENTS.md (DeepSeek Harness user-global rule, frontmatter stripped)"
757
+ Write-Host "[15/22] argo\rules\archgraph.instructions.md -> $DshHome\AGENTS.md (DeepSeek Harness user-global rule, frontmatter stripped)"
690
758
  Write-DshAgentRule -DshHome $DshHome -RuleText $ruleSrcContent
691
759
 
692
- Write-Host "[16/19] argo\skills\argo-init -> $dshSkillDest (DeepSeek Harness skill)"
760
+ Write-Host "[16/22] argo\skills\argo-init -> $dshSkillDest (DeepSeek Harness skill)"
693
761
  Copy-Tree -Source (Join-Path $argoDir 'skills\argo-init') -Destination $dshSkillDest
694
762
 
695
- Write-Host "[17/19] argo\rules\<WakeupGuideline> -> $DshHome\plugins\dsh-argo-wakeup\index.js (DeepSeek Harness wakeup plugin)"
763
+ Write-Host "[17/22] argo\rules\<WakeupGuideline> -> $DshHome\plugins\dsh-argo-wakeup\index.js (DeepSeek Harness wakeup plugin)"
696
764
  $wakeupDshPath = New-DshWakeupPlugin -DshHome $DshHome -RuleText $ruleSrcContent
697
765
 
698
- Write-Host "[18/19] argo-workspace + argo-wakeup rows -> $patchPath (DeepSeek Harness MCP bridge + wakeup plugin)"
766
+ Write-Host "[18/22] argo-workspace + argo-wakeup rows -> $patchPath (DeepSeek Harness MCP bridge + wakeup plugin)"
699
767
  # The generated dsh-argo-workspace bridge connects directly to the argo
700
768
  # server (no dsh-mcp-client row), registers every tool as mcp__argo__* and
701
769
  # injects the current session's workspace (SessionHeader.cwd) as the
@@ -726,7 +794,7 @@ if ($SkipDsh) {
726
794
  Write-DshManagedBlock -Path $patchPath -Block $block -MarkerStart '# BEGIN ArchGraph ARGO deployment' -MarkerEnd '# END ArchGraph ARGO deployment'
727
795
  }
728
796
 
729
- Write-Host "[19/19] argo\agents11 -> $DshHome\.agent-presets\<id> (DeepSeek Harness agent presets)"
797
+ Write-Host "[19/22] argo\agents11 -> $DshHome\.agent-presets\<id> (DeepSeek Harness agent presets)"
730
798
  New-DshAgentPresets -DshHome $DshHome -AgentsSrc (Join-Path $argoDir 'agents')
731
799
 
732
800
  Write-Host ' Restart `dsh web` to activate the MCP bridge and the wakeup plugin;'
@@ -736,6 +804,25 @@ if ($SkipDsh) {
736
804
  Write-Host ' the injected workspaceRoot unconditionally).'
737
805
  }
738
806
 
807
+ if ($SkipOpenClaw) {
808
+ Write-Host 'Skipped OpenClaw integration (-SkipOpenClaw).'
809
+ } else {
810
+ $ruleSrcContent = Get-Content $ruleSrc -Raw -Encoding UTF8
811
+ $openClawSkillDest = Join-Path $OpenClawHome 'skills\argo-init'
812
+ $openClawAgentsDest = Join-Path $OpenClawWorkspace 'AGENTS.md'
813
+
814
+ Write-Host '==> Deploying OpenClaw integration'
815
+ Write-Host "[20/22] argo\rules\archgraph.instructions.md -> $openClawAgentsDest (OpenClaw workspace AGENTS.md, frontmatter stripped)"
816
+ Write-OpenClawAgentRule -OpenClawWorkspace $OpenClawWorkspace -RuleText $ruleSrcContent
817
+
818
+ Write-Host "[21/22] argo\skills\argo-init -> $openClawSkillDest (OpenClaw managed skill, all agents)"
819
+ Copy-Tree -Source (Join-Path $argoDir 'skills\argo-init') -Destination $openClawSkillDest
820
+
821
+ Write-Host ' OpenClaw injects AGENTS.md into Project Context on every session, so the wakeup'
822
+ Write-Host ' gate (UNCONDITIONAL STARTUP GATE) is active on the next OpenClaw session; restart'
823
+ Write-Host ' the OpenClaw gateway (openclaw gateway restart) if it is already running.'
824
+ }
825
+
739
826
  if ($SkipDeps) {
740
827
  Write-Host 'Skipped dependency install (-SkipDeps).'
741
828
  } elseif (Get-Command npm -ErrorAction SilentlyContinue) {
@@ -855,6 +942,11 @@ if ($SkipMcp) {
855
942
  enabled = $true
856
943
  })
857
944
  Write-Host "argo MCP config written -> $OpenCodeConfigPath"
945
+
946
+ if (-not $SkipOpenClaw) {
947
+ Write-Host "[22/22] argo MCP server -> $(Join-Path $OpenClawHome 'openclaw.json') (OpenClaw mcp.servers.argo, env.ARGO_REPO_ROOT pinned)"
948
+ Write-OpenClawMcpConfig -OpenClawHome $OpenClawHome -RepoRoot $repoRoot -ArgoServer $argoServer
949
+ }
858
950
  }
859
951
 
860
952
  $wakeupPluginPath = Join-Path $PluginsRoot 'argo-wakeup.js'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archgraph-argo",
3
- "version": "0.10.22",
3
+ "version": "0.10.24",
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": {