archgraph-argo-beta 0.27.0-beta.13 → 0.27.0-beta.15

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/README.md CHANGED
@@ -38,6 +38,7 @@ ArchGraph deploys the ARGO toolchain to all major coding-agent environments:
38
38
  | OpenCode | ✓ | ✓ | ✓ | ✓ | ✓ |
39
39
  | DeepSeek Harness | ✓ | ✓ | ✓ | ✓ | ✓ |
40
40
  | OpenClaw | ✓ | ✓ | ✓ | — | ✓ |
41
+ | Codex | ✓ | ✓ | ✓ | — | ✓ |
41
42
 
42
43
  A single `argo-deploy` registers the `argo` MCP server and installs all artifacts into each harness
43
44
  automatically.
@@ -49,7 +50,7 @@ npm install -g archgraph-argo
49
50
  argo-deploy
50
51
  ```
51
52
 
52
- Done — the ARGO toolchain, skills, and rules are deployed, and the `argo` MCP server is registered automatically in **GitHub Copilot**, **Cursor**, **OpenCode**, **DeepSeek Harness** (dsh), and **OpenClaw**.
53
+ Done — the ARGO toolchain, skills, and rules are deployed, and the `argo` MCP server is registered automatically in **GitHub Copilot**, **Cursor**, **OpenCode**, **DeepSeek Harness** (dsh), **OpenClaw**, and **Codex**.
53
54
 
54
55
  ### Prerequisites and configuration
55
56
 
@@ -760,8 +760,24 @@ function budgetTruncationBase(result, maxBytes, fullBytes, ids) {
760
760
  // real loss of a listed id.
761
761
  function trimManifestToBudget(result, maxBytes) {
762
762
  const truncation = result.truncation;
763
- const arrays = ['includedElementIds', 'includedRelationshipIds', 'includedViewIds'];
764
763
  const focusId = result.focusElementId;
764
+ // If the FOCUS element alone already exceeds the budget, trimming the (cheap)
765
+ // id manifest cannot get us under it — and dropping ids would only lose
766
+ // navigation for nothing. Keep the COMPLETE manifest and say why.
767
+ const focusOnly = {
768
+ ...result,
769
+ truncation: {
770
+ ...truncation,
771
+ includedElementIds: focusId ? [focusId] : [],
772
+ includedRelationshipIds: [],
773
+ includedViewIds: [],
774
+ },
775
+ };
776
+ if (focusId && payloadByteLength(focusOnly) > maxBytes) {
777
+ truncation.overBudgetByFocus = true;
778
+ return;
779
+ }
780
+ const arrays = ['includedElementIds', 'includedRelationshipIds', 'includedViewIds'];
765
781
  for (let ratio = 0.9; ratio >= 0; ratio -= 0.1) {
766
782
  for (const key of arrays) {
767
783
  const full = truncation[key] || [];
package/install-argo.ps1 CHANGED
@@ -28,6 +28,9 @@ param(
28
28
  [string]$DoubaoHome = "$env:USERPROFILE\Doubao",
29
29
  [string]$DoubaoWorkspace = "$env:LOCALAPPDATA\Doubao\User Data\Default\.doubao\agent_mode\workspace",
30
30
  [switch]$SkipDoubao,
31
+ [string]$CodexHome = "$env:USERPROFILE\.codex",
32
+ [string]$CodexRepoRoot = '',
33
+ [switch]$SkipCodex,
31
34
  [string]$McpPath,
32
35
  [string]$GraphMcpUrl = 'https://argo.derekworkspacev5.com/mcp'
33
36
  )
@@ -596,6 +599,71 @@ function Write-OpenClawMcpConfig {
596
599
  [System.IO.File]::WriteAllText($configPath, $json, (New-Object System.Text.UTF8Encoding $false))
597
600
  }
598
601
 
602
+ function ConvertTo-TomlString {
603
+ # Encode a value as a TOML basic string (escape backslash + double quote).
604
+ param([string]$Value)
605
+ return '"' + ($Value -replace '\\', '\\\\' -replace '"', '\"') + '"'
606
+ }
607
+
608
+ function Write-CodexMcpConfig {
609
+ # Register the argo and graph-mcp MCP servers in the Codex config file
610
+ # (~/.codex/config.toml). Codex stores MCP servers as standard TOML tables
611
+ # [mcp_servers.<name>] (NOT the JSON/YAML shapes the other hosts use), so
612
+ # this is a text-level table upsert:
613
+ # - the previous managed tables ([mcp_servers.argo], [mcp_servers.argo.env],
614
+ # [mcp_servers.graph-mcp]) are removed first, so a re-deploy replaces
615
+ # rather than duplicates them (duplicate TOML tables are a parse error);
616
+ # - every unrelated config.toml key (the desktop app's own settings, other
617
+ # MCP servers, plugins, marketplaces) is preserved verbatim;
618
+ # - the file is written without a BOM.
619
+ #
620
+ # Workspace: Codex spawns every stdio MCP server with the SESSION workspace
621
+ # as its process cwd and without ARGO_* env (verified), and argo-paths.js
622
+ # falls back to process.cwd() when ARGO_REPO_ROOT is unset. So, like
623
+ # OpenCode / DeepSeek Harness, the single global argo server FOLLOWS whichever
624
+ # workspace the user opened in Codex and ARGO_REPO_ROOT is NOT pinned by
625
+ # default. Pass -RepoRoot to pin a fixed workspace instead (opt-in).
626
+ param(
627
+ [string]$ConfigPath,
628
+ [string]$ArgoServer,
629
+ [string]$GraphMcpUrl,
630
+ [string]$RepoRoot
631
+ )
632
+ $targetHeaders = @('[mcp_servers.argo]', '[mcp_servers.argo.env]', '[mcp_servers.graph-mcp]')
633
+ $existing = if (Test-Path $ConfigPath) { [System.IO.File]::ReadAllText($ConfigPath) } else { '' }
634
+ $lines = if ($existing -eq '') { @() } else { $existing -split "\r?\n" }
635
+
636
+ $kept = New-Object System.Collections.Generic.List[string]
637
+ $i = 0
638
+ while ($i -lt $lines.Count) {
639
+ $trim = $lines[$i].Trim()
640
+ if ($targetHeaders -contains $trim) {
641
+ # Skip the header and its body up to the next top-level table header.
642
+ $i++
643
+ while ($i -lt $lines.Count -and -not $lines[$i].TrimStart().StartsWith('[')) { $i++ }
644
+ continue
645
+ }
646
+ $kept.Add($lines[$i])
647
+ $i++
648
+ }
649
+ while ($kept.Count -gt 0 -and $kept[$kept.Count - 1].Trim() -eq '') { $kept.RemoveAt($kept.Count - 1) }
650
+
651
+ $blocks = New-Object System.Collections.Generic.List[string]
652
+ $blocks.Add((@('[mcp_servers.argo]', 'command = "node"', "args = [$(ConvertTo-TomlString $ArgoServer)]") -join "`n"))
653
+ if (-not [string]::IsNullOrWhiteSpace($RepoRoot)) {
654
+ $blocks.Add(("[mcp_servers.argo.env]`nARGO_REPO_ROOT = $(ConvertTo-TomlString $RepoRoot)"))
655
+ }
656
+ $blocks.Add(("[mcp_servers.graph-mcp]`nurl = $(ConvertTo-TomlString $GraphMcpUrl)"))
657
+
658
+ $result = ($kept -join "`n")
659
+ if ($result.Trim() -ne '') { $result = $result.TrimEnd() + "`n`n" }
660
+ $result += ($blocks -join "`n`n") + "`n"
661
+
662
+ New-Item -ItemType Directory -Force -Path (Split-Path $ConfigPath) | Out-Null
663
+ [System.IO.File]::WriteAllText($ConfigPath, $result, (New-Object System.Text.UTF8Encoding $false))
664
+ Write-Host " Codex MCP: argo (stdio) + graph-mcp (streamable http) -> $ConfigPath"
665
+ }
666
+
599
667
  function Write-DshManagedBlock {
600
668
  # Text-level upsert of a marker-delimited block into a file (used for the
601
669
  # managed rows in ~/.dsh/cordis.patch.yml): replaces the previous managed
@@ -1148,6 +1216,33 @@ if ($SkipMcp) {
1148
1216
  }
1149
1217
  }
1150
1218
 
1219
+ if ($SkipCodex) {
1220
+ Write-Host 'Skipped Codex integration (-SkipCodex).'
1221
+ } else {
1222
+ $ruleSrcContent = Get-Content $ruleSrc -Raw -Encoding UTF8
1223
+ $codexAgentsPath = Join-Path $CodexHome 'AGENTS.md'
1224
+ $codexSkillsRoot = Join-Path $CodexHome 'skills'
1225
+
1226
+ Write-Host '==> Deploying Codex integration'
1227
+ Write-Host "[Codex 1/3] argo\rules\archgraph.instructions.md -> $codexAgentsPath (Codex global AGENTS.md, frontmatter stripped)"
1228
+ Write-ArchGraphRuleBlock -DestPath $codexAgentsPath -RuleText $ruleSrcContent -Label 'Codex rule'
1229
+
1230
+ Write-Host "[Codex 2/3] argo\skills -> $codexSkillsRoot (Codex user skills: argo-init, ea-human-reconcile)"
1231
+ Copy-DoubaoSkills -Root $codexSkillsRoot -SourceSkillsRoot (Join-Path $argoDir 'skills') -SkillNames @('argo-init', 'ea-human-reconcile') -Label 'Codex user skills'
1232
+ # agent-search-diagnosis is OpenCode-only (it assumes `opencode` session export); not deployed to Codex.
1233
+
1234
+ if ($SkipMcp) {
1235
+ Write-Host ' Skipped Codex MCP registration (-SkipMcp).'
1236
+ } else {
1237
+ $codexConfigPath = Join-Path $CodexHome 'config.toml'
1238
+ Write-Host "[Codex 3/3] argo MCP (stdio) + graph-mcp -> $codexConfigPath (Codex config.toml)"
1239
+ Write-CodexMcpConfig -ConfigPath $codexConfigPath -ArgoServer $argoServer -GraphMcpUrl $GraphMcpUrl -RepoRoot $CodexRepoRoot
1240
+ }
1241
+ Write-Host ' Codex injects the global AGENTS.md into every session, so the wakeup gate is'
1242
+ Write-Host ' active on the next Codex session; skills load on trigger. Restart Codex so it'
1243
+ Write-Host ' picks up config.toml and the new skills.'
1244
+ }
1245
+
1151
1246
  $wakeupPluginPath = Join-Path $PluginsRoot 'argo-wakeup.js'
1152
1247
  if (Test-Path $wakeupPluginPath) {
1153
1248
  Write-Host '==> Registering argo-wakeup plugin in OpenCode'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "archgraph-argo-beta",
3
- "version": "0.27.0-beta.13",
3
+ "version": "0.27.0-beta.15",
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": {
@@ -48,6 +48,7 @@
48
48
  "test": "node --test \"tests/*.test.js\"",
49
49
  "acceptance": "node scripts/mcp-acceptance.js",
50
50
  "gen:dsh-plugins": "node scripts/gen-dsh-plugins.js",
51
+ "gen:deck": "node scripts/gen-coding-deck.js --check && node scripts/rasterize-coding-deck.js && python scripts/build-coding-deck-pptx.py",
51
52
  "prepack": "node scripts/gen-dsh-plugins.js"
52
53
  },
53
54
  "engines": {