@tera-system/core 0.2.9 → 0.2.12
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/MANIFEST.json +9 -9
- package/RELEASES.md +43 -0
- package/agents/auditor.md +1 -1
- package/agents/domain-research-agent.md +25 -4
- package/agents/red-team-agent.md +334 -0
- package/agents/security-auditor.md +281 -0
- package/agents/security-observer.md +241 -0
- package/assets/architecture/README.md +30 -0
- package/assets/structurizr-mcp/README.md +134 -0
- package/assets/structurizr-mcp/pyproject.toml +19 -0
- package/assets/structurizr-mcp/src/structurizr_mcp/__init__.py +0 -0
- package/assets/structurizr-mcp/src/structurizr_mcp/config.py +59 -0
- package/assets/structurizr-mcp/src/structurizr_mcp/server.py +101 -0
- package/assets/structurizr-mcp/src/structurizr_mcp/tools/__init__.py +0 -0
- package/assets/structurizr-mcp/src/structurizr_mcp/tools/api.py +63 -0
- package/assets/structurizr-mcp/src/structurizr_mcp/tools/dsl.py +36 -0
- package/assets/structurizr-mcp/src/structurizr_mcp/tools/export.py +258 -0
- package/assets/structurizr-mcp/src/structurizr_mcp/tools/validate.py +43 -0
- package/assets/structurizr-mcp/uv.lock +770 -0
- package/core/tera-system/AGENT_ACTIVATION_MATRIX.md +4 -1
- package/core/tera-system/AGENT_DEPENDENCY_MAP.md +6 -0
- package/core/tera-system/AGENT_PERMISSION_MODEL.md +17 -4
- package/core/tera-system/TERA_DISTRIBUTION_POLICY.md +26 -5
- package/core/tera-system/TOOLING_AND_MCP_POLICY.md +66 -1
- package/core/tera-system/TeraArchitectureMap.md +4 -1
- package/core/tera-system/TeraClientPolicy.md +1 -1
- package/core/tera-system/TeraHelperAgents.md +17 -1
- package/core/tera-system/TeraPolicyMap.md +8 -3
- package/core/tera-system/TeraPricingPolicy.md +16 -0
- package/core/tera-system/TeraSubAgents.md +27 -7
- package/core/tera-system/TeraSystemMaintenanceChecklist.md +8 -0
- package/core/tera-system/client-helpers/tera-client-engagement-pricing.md +1 -1
- package/core/tera-system/runtime/DOMAIN_INTELLIGENCE_PROTOCOL.md +42 -0
- package/core/tera-system/runtime/TERA_RUNTIME_CHECKLISTS.md +10 -0
- package/opencode.tera.example.json +3 -3
- package/package.json +1 -1
- package/tools/tera-tooling.ps1 +221 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
<#
|
|
2
|
+
=============================================================================
|
|
3
|
+
tera-tooling.ps1 - Tera Toolchain provisioning (SCP-2026-08-29-012 + SCP-2026-09-02-001)
|
|
4
|
+
=============================================================================
|
|
5
|
+
Verifies (and optionally installs) the approved Tera tools so every
|
|
6
|
+
repository has a guaranteed, consistent toolchain:
|
|
7
|
+
|
|
8
|
+
Tool Kind Installer used
|
|
9
|
+
-------------- ---------- --------------------------------
|
|
10
|
+
Playwright MCP (npx) npx @playwright/mcp + browsers
|
|
11
|
+
Semgrep MCP + CLI pip install semgrep
|
|
12
|
+
Structurizr MCP (uv) uv (Astral) + Docker (validate/export)
|
|
13
|
+
Gitleaks CLI winget install Gitleaks.Gitleaks
|
|
14
|
+
Trivy CLI winget install AquaSecurity.Trivy
|
|
15
|
+
Nmap offensive winget install Insecure.Nmap
|
|
16
|
+
Wireshark offensive winget install WiresharkFoundation.Wireshark
|
|
17
|
+
k6 offensive winget install GrafanaLabs.k6
|
|
18
|
+
ffuf/Nuclei/dalfox offensive GitHub releases (Go binary)
|
|
19
|
+
sqlmap offensive pip install sqlmap
|
|
20
|
+
Burp/ZAP/Hydra/Metasploit/John offensive external installers (reported)
|
|
21
|
+
|
|
22
|
+
Cloud (DigitalOcean) tools are DEFERRED until first app deployment (SCP-2026-09-02-001).
|
|
23
|
+
|
|
24
|
+
Usage:
|
|
25
|
+
powershell -ExecutionPolicy Bypass -File .\tools\tera-tooling.ps1 # report only
|
|
26
|
+
powershell -ExecutionPolicy Bypass -File .\tools\tera-tooling.ps1 -Install # install missing
|
|
27
|
+
powershell -ExecutionPolicy Bypass -File .\tools\tera-tooling.ps1 -Quiet # no banner
|
|
28
|
+
|
|
29
|
+
Exit codes:
|
|
30
|
+
0 all required tools present
|
|
31
|
+
1 Node.js/npx missing (required) or fatal error
|
|
32
|
+
2 optional tool missing (and -Install could not complete it)
|
|
33
|
+
=============================================================================
|
|
34
|
+
#>
|
|
35
|
+
[CmdletBinding()]
|
|
36
|
+
param(
|
|
37
|
+
[switch]$Install, # attempt to install missing tools
|
|
38
|
+
[switch]$Quiet # suppress banner
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
Set-StrictMode -Version 5
|
|
42
|
+
$ErrorActionPreference = 'Continue'
|
|
43
|
+
|
|
44
|
+
function Test-Command([string]$Name, [string]$Arg = '--version') {
|
|
45
|
+
$cmd = Get-Command $Name -ErrorAction SilentlyContinue
|
|
46
|
+
if (-not $cmd) { return $false }
|
|
47
|
+
try {
|
|
48
|
+
$null = & $cmd.Source $Arg 2>$null
|
|
49
|
+
return $true
|
|
50
|
+
} catch { return $true } # binary exists even if version flag differs
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function Invoke-BestEffort([string]$Label, [scriptblock]$Block) {
|
|
54
|
+
try { & $Block; return $true } catch { Write-Host " ! $Label failed: $($_.Exception.Message)"; return $false }
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (-not $Quiet) {
|
|
58
|
+
Write-Host ""
|
|
59
|
+
Write-Host "Tera 5-Tool Standard - provisioning (SCP-2026-08-29-012)"
|
|
60
|
+
if ($Install) { Write-Host "Mode: INSTALL missing tools" } else { Write-Host "Mode: REPORT only (use -Install to install)" }
|
|
61
|
+
Write-Host ""
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
# ---- 1. Required base: Node.js / npx --------------------------------------
|
|
65
|
+
$nodeOk = Test-Command 'node' '--version'
|
|
66
|
+
$npxOk = Test-Command 'npx' '--version'
|
|
67
|
+
if (-not $nodeOk -or -not $npxOk) {
|
|
68
|
+
Write-Host 'ERROR: Node.js / npx not found - required for Playwright MCP and Semgrep MCP.'
|
|
69
|
+
Write-Host ' Install Node.js LTS from https://nodejs.org and re-run.'
|
|
70
|
+
exit 1
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
# ---- Tool status table ------------------------------------------------------
|
|
74
|
+
$rows = [System.Collections.Generic.List[object]]::new()
|
|
75
|
+
|
|
76
|
+
function Add-Row([string]$Tool, [string]$Kind, [bool]$Present, [string]$Action) {
|
|
77
|
+
$status = 'OK'
|
|
78
|
+
if (-not $Present) { $status = 'MISSING' }
|
|
79
|
+
$rows.Add([pscustomobject]@{ Tool = $Tool; Kind = $Kind; Status = $status; Action = $Action })
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
# 2. Semgrep (Python)
|
|
83
|
+
$semgrepOk = Test-Command 'semgrep' '--version'
|
|
84
|
+
if (-not $semgrepOk -and $Install) { $semgrepOk = Invoke-BestEffort 'Semgrep install' { python -m pip install --quiet semgrep } }
|
|
85
|
+
Add-Row 'Semgrep' 'MCP+CLI' $semgrepOk 'pip install semgrep'
|
|
86
|
+
|
|
87
|
+
# 3. Gitleaks (Go binary via winget)
|
|
88
|
+
$gitleaksOk = Test-Command 'gitleaks' 'version'
|
|
89
|
+
if (-not $gitleaksOk -and $Install) { $gitleaksOk = Invoke-BestEffort 'Gitleaks install' { winget install --id Gitleaks.Gitleaks -e --silent --accept-package-agreements --accept-source-agreements | Out-Null } }
|
|
90
|
+
Add-Row 'Gitleaks' 'CLI' $gitleaksOk 'winget install Gitleaks.Gitleaks'
|
|
91
|
+
|
|
92
|
+
# 4. Trivy (Go binary via winget)
|
|
93
|
+
$trivyOk = Test-Command 'trivy' '--version'
|
|
94
|
+
if (-not $trivyOk -and $Install) { $trivyOk = Invoke-BestEffort 'Trivy install' { winget install --id AquaSecurity.Trivy -e --silent --accept-package-agreements --accept-source-agreements | Out-Null } }
|
|
95
|
+
Add-Row 'Trivy' 'CLI' $trivyOk 'winget install AquaSecurity.Trivy'
|
|
96
|
+
|
|
97
|
+
# 5. uv (Astral - Structurizr MCP runner)
|
|
98
|
+
$uvOk = Test-Command 'uv' '--version'
|
|
99
|
+
if (-not $uvOk -and $Install) { $uvOk = Invoke-BestEffort 'uv install' { python -m pip install --quiet uv } }
|
|
100
|
+
Add-Row 'uv (Structurizr)' 'MCP runner' $uvOk 'pip install uv'
|
|
101
|
+
|
|
102
|
+
# 6. Docker (Structurizr validate/export)
|
|
103
|
+
$dockerOk = Test-Command 'docker' '--version'
|
|
104
|
+
if (-not $dockerOk -and $Install) { $dockerOk = Invoke-BestEffort 'Docker install' { winget install --id Docker.DockerDesktop -e --silent --accept-package-agreements --accept-source-agreements | Out-Null } }
|
|
105
|
+
Add-Row 'Docker (Structurizr)' 'runtime' $dockerOk 'winget install Docker.DockerDesktop'
|
|
106
|
+
|
|
107
|
+
# 7. Playwright MCP + browsers (npx - resolves on first use)
|
|
108
|
+
$pwMCP = Test-Command 'npx' '--version' # npx itself; the MCP resolves via npx on first opencode start
|
|
109
|
+
if (-not $Quiet) { Write-Host ' Playwright MCP: auto-resolves via npx on first opencode start.' }
|
|
110
|
+
if ($Install -and $pwMCP) {
|
|
111
|
+
Write-Host ' Installing Playwright Chromium browsers (first run ~300MB)...'
|
|
112
|
+
Invoke-BestEffort 'Playwright browsers' { npx -y playwright install chromium | Out-Null }
|
|
113
|
+
}
|
|
114
|
+
Add-Row 'Playwright' 'MCP' $pwMCP 'npx @playwright/mcp (auto)'
|
|
115
|
+
|
|
116
|
+
# ---- Offensive Security Tools (SCP-2026-09-02-001 - Team Security) ----------
|
|
117
|
+
# Used only by Team Security agents within a written authorization scope.
|
|
118
|
+
# Verified via known install paths (winget installs may not be on PATH in a fresh shell).
|
|
119
|
+
$offensiveKnownPaths = @(
|
|
120
|
+
@{ Name = 'Nmap'; Test = "${env:ProgramFiles(x86)}\Nmap\nmap.exe"; Alt = 'nmap'; VersionArg = '--version'; Install = 'winget install --id Insecure.Nmap -e --silent --accept-package-agreements --accept-source-agreements' },
|
|
121
|
+
@{ Name = 'Wireshark'; Test = "$env:ProgramFiles\Wireshark\tshark.exe"; Alt = 'tshark'; VersionArg = '--version'; Install = 'winget install --id WiresharkFoundation.Wireshark -e --silent --accept-package-agreements --accept-source-agreements' },
|
|
122
|
+
@{ Name = 'k6'; Test = "$env:ProgramFiles\k6\k6.exe"; Alt = 'k6'; VersionArg = 'version'; Install = 'winget install --id GrafanaLabs.k6 -e --silent --accept-package-agreements --accept-source-agreements' }
|
|
123
|
+
)
|
|
124
|
+
foreach ($t in $offensiveKnownPaths) {
|
|
125
|
+
$ok = (Test-Path -LiteralPath $t.Test) -or (Test-Command $t.Alt $t.VersionArg)
|
|
126
|
+
if (-not $ok -and $Install) { $ok = Invoke-BestEffort "$($t.Name) install" { Invoke-Expression $t.Install | Out-Null } }
|
|
127
|
+
Add-Row $t.Name 'offensive' $ok $t.Install
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
# Go-based offensive tools (installed under %LOCALAPPDATA%\Tera-Tools)
|
|
131
|
+
$teraTools = "$env:LOCALAPPDATA\Tera-Tools"
|
|
132
|
+
$goToolPaths = @(
|
|
133
|
+
@{ Name = 'ffuf'; Path = "$teraTools\ffuf\ffuf.exe"; VersionArg = '-V' },
|
|
134
|
+
@{ Name = 'Nuclei'; Path = "$teraTools\nuclei\nuclei.exe"; VersionArg = '-version' },
|
|
135
|
+
@{ Name = 'dalfox'; Path = (Get-ChildItem "$teraTools\dalfox" -Recurse -Filter 'dalfox.exe' -ErrorAction SilentlyContinue | Select-Object -First 1).FullName; VersionArg = 'version' }
|
|
136
|
+
)
|
|
137
|
+
foreach ($t in $goToolPaths) {
|
|
138
|
+
$ok = ($t.Path -and (Test-Path -LiteralPath $t.Path))
|
|
139
|
+
if (-not $ok -and $Install) {
|
|
140
|
+
Write-Host " ! $($t.Name) requires manual download (Go binary for Windows) - see TOOLING_AND_MCP_POLICY.md §3.7"
|
|
141
|
+
$ok = $false
|
|
142
|
+
}
|
|
143
|
+
Add-Row $t.Name 'offensive' $ok "Tera-Tools download: $($t.Path)"
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
# Python-based offensive tools
|
|
147
|
+
# sqlmap official repo clone (pip package is broken on Windows - ModuleNotFoundError)
|
|
148
|
+
$sqlmapPy = "$env:LOCALAPPDATA\Tera-Tools\sqlmap\sqlmap.py"
|
|
149
|
+
$sqlmapOk = Test-Path -LiteralPath $sqlmapPy
|
|
150
|
+
if (-not $sqlmapOk -and $Install) {
|
|
151
|
+
Write-Host ' Installing sqlmap from official repo (git clone)...'
|
|
152
|
+
$sqlmapDir = "$env:LOCALAPPDATA\Tera-Tools\sqlmap"
|
|
153
|
+
New-Item -ItemType Directory -Path $sqlmapDir -Force | Out-Null
|
|
154
|
+
$sqlmapOk = Invoke-BestEffort 'sqlmap clone' { git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git $sqlmapDir }
|
|
155
|
+
}
|
|
156
|
+
Add-Row 'sqlmap' 'offensive' $sqlmapOk 'git clone sqlmapproject/sqlmap (run: python sqlmap.py)'
|
|
157
|
+
|
|
158
|
+
# Manual tools (checked but not auto-installable)
|
|
159
|
+
$burpOk = Test-Path -LiteralPath 'F:\burpsuite_profissional_2026.1.5\BurpSuite profissional v2026.1.5\burpsuite_pro_v2026.1.5.jar'
|
|
160
|
+
Add-Row 'Burp Suite Pro' 'offensive' $burpOk 'java -jar [path]/burpsuite_pro_v2026.1.5.jar (external)'
|
|
161
|
+
|
|
162
|
+
$zapOk = (Test-Path -LiteralPath "$env:ProgramFiles\ZAP\Zed Attack Proxy\zap.bat") -or (Test-Command 'zap' '--version')
|
|
163
|
+
if (-not $zapOk -and $Install) {
|
|
164
|
+
Write-Host ' ! OWASP ZAP requires manual download from https://www.zaproxy.org/download/'
|
|
165
|
+
$zapOk = $false
|
|
166
|
+
}
|
|
167
|
+
Add-Row 'OWASP ZAP' 'offensive' $zapOk 'winget install ZAP.ZAP / zaproxy.org'
|
|
168
|
+
|
|
169
|
+
$hydraOk = Test-Command 'hydra' '-h'
|
|
170
|
+
if (-not $hydraOk -and $Install) {
|
|
171
|
+
Write-Host ' ! THC-Hydra on Windows is not guaranteed; fallback: ZAP Fuzzer.'
|
|
172
|
+
$hydraOk = $false
|
|
173
|
+
}
|
|
174
|
+
Add-Row 'Hydra' 'offensive' $hydraOk 'GitHub build (fallback: ZAP Fuzzer)'
|
|
175
|
+
|
|
176
|
+
$msfOk = Test-Command 'msfconsole' '--version'
|
|
177
|
+
if (-not $msfOk -and $Install) {
|
|
178
|
+
Write-Host ' ! Metasploit: use Rapid7 Windows installer or Docker (kali) fallback.'
|
|
179
|
+
$msfOk = $false
|
|
180
|
+
}
|
|
181
|
+
Add-Row 'Metasploit' 'offensive' $msfOk 'Rapid7 installer / Docker (kali)'
|
|
182
|
+
|
|
183
|
+
$johnOk = Test-Command 'john' '--version'
|
|
184
|
+
if (-not $johnOk -and $Install) {
|
|
185
|
+
Write-Host ' ! John the Ripper: download Jumbo build from GitHub.'
|
|
186
|
+
$johnOk = $false
|
|
187
|
+
}
|
|
188
|
+
Add-Row 'John the Ripper' 'offensive' $johnOk 'GitHub Jumbo build'
|
|
189
|
+
|
|
190
|
+
# ---- Cloud Reference Tools (DigitalOcean - SCP-2026-09-02-001) ---------------
|
|
191
|
+
# Deferred by design (Anti-Bloat): activated only when the first app is deployed to DO.
|
|
192
|
+
if (-not $Quiet) {
|
|
193
|
+
Write-Host ''
|
|
194
|
+
Write-Host ' Cloud (DigitalOcean) tools are DEFERRED until first app deployment on DO:'
|
|
195
|
+
Write-Host ' - doctl (winget install DigitalOcean.Doctl)'
|
|
196
|
+
Write-Host ' - compliancekit (github.com/darpanzope/compliancekit) + DO_API_TOKEN'
|
|
197
|
+
Write-Host ' - DO CSPM (built into DO dashboard)'
|
|
198
|
+
Write-Host ' - Lynis (over SSH on Droplets)'
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
# ---- Report ----------------------------------------------------------------
|
|
202
|
+
Write-Host ""
|
|
203
|
+
Write-Host ("{0,-22} {1,-10} {2,-8} {3}" -f 'Tool', 'Kind', 'Status', 'Action')
|
|
204
|
+
Write-Host ("{0,-22} {1,-10} {2,-8} {3}" -f ('-' * 22), ('-' * 10), ('-' * 8), ('-' * 40))
|
|
205
|
+
foreach ($r in $rows) { Write-Host ("{0,-22} {1,-10} {2,-8} {3}" -f $r.Tool, $r.Kind, $r.Status, $r.Action) }
|
|
206
|
+
|
|
207
|
+
$missing = @($rows | Where-Object { $_.Status -eq 'MISSING' })
|
|
208
|
+
$optional = @($missing | Where-Object { $_.Tool -notin @('Playwright') })
|
|
209
|
+
Write-Host ""
|
|
210
|
+
if ($missing.Count -eq 0) {
|
|
211
|
+
Write-Host 'RESULT: All tools present. Toolchain ready.'
|
|
212
|
+
exit 0
|
|
213
|
+
} elseif ($optional.Count -eq 0) {
|
|
214
|
+
Write-Host 'RESULT: All required tools present (Playwright resolves on first use).'
|
|
215
|
+
exit 0
|
|
216
|
+
} else {
|
|
217
|
+
Write-Host "RESULT: $($optional.Count) optional tool(s) missing. Re-run with -Install, or install manually:"
|
|
218
|
+
foreach ($m in $optional) { Write-Host " - $($m.Tool): $($m.Action)" }
|
|
219
|
+
if ($Install) { Write-Host ' Some installs may need a new shell (PATH) or a machine restart (Docker).' }
|
|
220
|
+
exit 2
|
|
221
|
+
}
|