codo-ai 2.23.5
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/LICENSE +21 -0
- package/README.md +149 -0
- package/bin/codo.exe +10 -0
- package/package.json +34 -0
- package/postinstall.mjs +189 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 COdo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# COdo
|
|
2
|
+
|
|
3
|
+
> The security-native AI coding agent. Six specialized security personas, scope-gated
|
|
4
|
+
> pentesting, a durable findings store, and an orchestrated multi-agent workflow — all in
|
|
5
|
+
> one terminal-first CLI.
|
|
6
|
+
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](#)
|
|
9
|
+
[](https://www.npmjs.com/package/codo-ai)
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
██████╗ ██████╗ ██████╗ ██████╗
|
|
13
|
+
██╔════╝ ██╔═══██╗ ██╔══██╗ ██╔═══██╗
|
|
14
|
+
██║ ██║ ██║ ██║ ██║ ██║ ██║
|
|
15
|
+
██║ ██║ ██║ ██║ ██║ ██║ ██║
|
|
16
|
+
╚██████╗ ╚██████╔╝ ██████╔╝ ╚██████╔╝
|
|
17
|
+
╚═════╝ ╚═════╝ ╚═════╝ ╚═════╝
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
COdo is an AI coding agent for teams that treat security as part of the workflow, not a
|
|
21
|
+
separate step. It writes code like any agent — and then it audits that code, threat-models
|
|
22
|
+
the features you're about to build, scopes and executes authorized penetration tests, and
|
|
23
|
+
remembers every finding across sessions. Stop losing vulnerabilities in markdown notes;
|
|
24
|
+
every finding gets an ID, a severity, evidence, and a remediation path.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install -g codo-ai
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The npm package `codo-ai` installs a native binary for your platform (macOS, Linux, or
|
|
35
|
+
Windows; Intel or Apple Silicon/ARM64; glibc or musl; baseline AVX2 fallbacks included) via
|
|
36
|
+
a zero-dependency postinstall. No Node runtime required after install.
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
codo
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
You'll land in the COdo TUI. The default agent is `compose` for orchestrated multi-step
|
|
43
|
+
work, and `@sec-test` handles everything security-related. Type `/help` to see the built-in
|
|
44
|
+
commands.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## ✦ sec-test: security at the heart of the agent
|
|
49
|
+
|
|
50
|
+
`@sec-test` is not a script or a lint rule — it's the full security lifecycle, built from
|
|
51
|
+
**six specialized personas** and a **29-skill library**. You invoke it the same way you ask
|
|
52
|
+
any other question; COdo routes to the right specialist.
|
|
53
|
+
|
|
54
|
+
### The six personas
|
|
55
|
+
|
|
56
|
+
| Persona | Phase | What it does |
|
|
57
|
+
|---|---|---|
|
|
58
|
+
| **`sec-architect`** | Design | Threat-model features before code exists (STRIDE/PASTA, ASVS mapping) |
|
|
59
|
+
| **`sec-appsec`** | Code | Static audit of any diff or PR — injection, secrets, authz, OWASP Top 10 |
|
|
60
|
+
| **`sec-devsecops`** | Build/ship | Pipeline hardening (NIST SSDF), SBOMs, container scans, supply-chain attestation |
|
|
61
|
+
| **`sec-pentest`** | Validate | Scope-gated dynamic testing against running targets |
|
|
62
|
+
| **`sec-qa`** | Verify | Test generation, coverage audits, mutation testing, regression guards |
|
|
63
|
+
| **`sec-secops`** | Operate | Audits COdo itself, tracks posture trend over time |
|
|
64
|
+
|
|
65
|
+
### What makes it different
|
|
66
|
+
|
|
67
|
+
- **A durable findings store.** Every vulnerability is written to a SQLite
|
|
68
|
+
`security_finding` table — ID, severity, CVSS, evidence, remediation, status. Query it,
|
|
69
|
+
report on it, watch it age. Re-running a scan de-duplicates instead of duplicating.
|
|
70
|
+
- **A real scope gate.** `sec-pentest` cannot send a single packet to a target unless
|
|
71
|
+
`.codo/security-scope.json` exists, is signed, unexpired, and names that target. The
|
|
72
|
+
network path is code-enforced — `curl`, `nmap`, and friends are denied for personas.
|
|
73
|
+
- **29 ready-to-run skills.** From `threat-model` and `code-audit` to `secrets-scan`,
|
|
74
|
+
`dependency-audit`, `fuzz`, `exploit-verify`, `mutation-test`, `incident-runbook`,
|
|
75
|
+
`regression-guard`, and `posture-report`.
|
|
76
|
+
- **Human-readable + machine-readable.** Every skill writes markdown under
|
|
77
|
+
`.planning/security/` *and* records findings in the store; `codo sec report` exports
|
|
78
|
+
markdown, JSON, or SARIF for your CI.
|
|
79
|
+
- **Regression guards for every fix.** When a finding is fixed, `sec-qa` can convert it
|
|
80
|
+
into a permanent test so the bug can't come back unnoticed.
|
|
81
|
+
|
|
82
|
+
### Example flows
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
# Threat-model a feature before it's built
|
|
86
|
+
@sec-test threat-model the new payment flow
|
|
87
|
+
|
|
88
|
+
# Audit the current branch's changes
|
|
89
|
+
@sec-test audit this branch for security issues
|
|
90
|
+
|
|
91
|
+
# Authorize and pentest a running target (scope file required)
|
|
92
|
+
@sec-test scope https://staging.example.com
|
|
93
|
+
@sec-test pentest
|
|
94
|
+
|
|
95
|
+
# Weekly posture digest
|
|
96
|
+
@sec-test report
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
|
|
101
|
+
## compose: orchestrated multi-agent work
|
|
102
|
+
|
|
103
|
+
For everything that's not security — and the glue around it — COdo routes through the
|
|
104
|
+
**`compose` agent**: an orchestrator that plans your request, dispatches specialized
|
|
105
|
+
subagents (33 workflow agents), and produces structured artifacts as it goes:
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
discuss → plan → execute → verify → review
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Ask for a feature and get a roadmap, a numbered plan, parallel waves of implementation,
|
|
112
|
+
and verification against acceptance criteria — with commit hygiene built in. `compose`
|
|
113
|
+
also runs the GSD workflow system for milestone-driven development (`.planning/` project
|
|
114
|
+
state, phases, cross-agent audits).
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## And more
|
|
119
|
+
|
|
120
|
+
- **Terminal-first TUI** — SolidJS + OpenTUI, with an embedded web workbench
|
|
121
|
+
(`codo web`) and an optional Electron desktop shell.
|
|
122
|
+
- **Persistent sessions** — durable session inputs, crash-safe resume, and process-local
|
|
123
|
+
execution orchestration with EventV2 replay.
|
|
124
|
+
- **Every major model provider** — OpenAI, Anthropic, Google, Bedrock, Azure, Groq,
|
|
125
|
+
Mistral, xAI, OpenRouter, and more via the AI SDK gateway, plus OAuth sign-in.
|
|
126
|
+
- **Plugins** — a typed plugin API for extending the agent, tools, and skills.
|
|
127
|
+
- **Generated SDK** — the HTTP API is spec-first, with a JS/TS SDK generated from the
|
|
128
|
+
OpenAPI schema.
|
|
129
|
+
|
|
130
|
+
---
|
|
131
|
+
|
|
132
|
+
## Requirements
|
|
133
|
+
|
|
134
|
+
- macOS 12+, Linux (glibc or musl), or Windows 10+ (x64 with AVX2, or baseline fallback)
|
|
135
|
+
- ARM64 (Apple Silicon / AArch64 Linux / Windows on ARM) supported natively
|
|
136
|
+
|
|
137
|
+
## License
|
|
138
|
+
|
|
139
|
+
MIT — see [`LICENSE`](LICENSE). COdo was initially derived from OpenCode (MIT); the
|
|
140
|
+
OpenCode license text is preserved at [`LICENSES/OPENCODE-LICENSE.txt`](LICENSES/OPENCODE-LICENSE.txt).
|
|
141
|
+
|
|
142
|
+
## Community
|
|
143
|
+
|
|
144
|
+
- **Issues** → <https://github.com/Mosalah4351/COdo/issues>
|
|
145
|
+
- **Discussions** → <https://github.com/Mosalah4351/COdo/discussions>
|
|
146
|
+
- **Docs** → <https://codo.run/docs>
|
|
147
|
+
|
|
148
|
+
If you find a vulnerability in COdo, please do **not** open a public issue — email
|
|
149
|
+
`security@codo.run` with a proof-of-concept.
|
package/bin/codo.exe
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
echo "Error: codo-ai's postinstall script was not run." >&2
|
|
2
|
+
echo "" >&2
|
|
3
|
+
echo "This occurs when using --ignore-scripts during installation, or when using a" >&2
|
|
4
|
+
echo "package manager like pnpm that does not run postinstall scripts by default." >&2
|
|
5
|
+
echo "" >&2
|
|
6
|
+
echo "To fix this, run the postinstall script manually:" >&2
|
|
7
|
+
echo " cd node_modules/codo-ai && node postinstall.mjs" >&2
|
|
8
|
+
echo "" >&2
|
|
9
|
+
echo "Or reinstall codo-ai without the --ignore-scripts flag." >&2
|
|
10
|
+
exit 1
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"os": [
|
|
3
|
+
"darwin",
|
|
4
|
+
"linux",
|
|
5
|
+
"win32"
|
|
6
|
+
],
|
|
7
|
+
"name": "codo-ai",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"postinstall": "node ./postinstall.mjs"
|
|
10
|
+
},
|
|
11
|
+
"cpu": [
|
|
12
|
+
"arm64",
|
|
13
|
+
"x64"
|
|
14
|
+
],
|
|
15
|
+
"bin": {
|
|
16
|
+
"codo": "./bin/codo.exe"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"version": "2.23.5",
|
|
20
|
+
"optionalDependencies": {
|
|
21
|
+
"@codo-ai/codo-linux-x64": "2.23.5",
|
|
22
|
+
"@codo-ai/codo-darwin-x64-baseline": "2.23.5",
|
|
23
|
+
"@codo-ai/codo-darwin-x64": "2.23.5",
|
|
24
|
+
"@codo-ai/codo-linux-x64-baseline": "2.23.5",
|
|
25
|
+
"@codo-ai/codo-linux-arm64-musl": "2.23.5",
|
|
26
|
+
"@codo-ai/codo-linux-x64-baseline-musl": "2.23.5",
|
|
27
|
+
"@codo-ai/codo-windows-x64": "2.23.5",
|
|
28
|
+
"@codo-ai/codo-linux-x64-musl": "2.23.5",
|
|
29
|
+
"@codo-ai/codo-windows-x64-baseline": "2.23.5",
|
|
30
|
+
"@codo-ai/codo-windows-arm64": "2.23.5",
|
|
31
|
+
"@codo-ai/codo-darwin-arm64": "2.23.5",
|
|
32
|
+
"@codo-ai/codo-linux-arm64": "2.23.5"
|
|
33
|
+
}
|
|
34
|
+
}
|
package/postinstall.mjs
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import childProcess from "child_process"
|
|
4
|
+
import fs from "fs"
|
|
5
|
+
import os from "os"
|
|
6
|
+
import path from "path"
|
|
7
|
+
import { createRequire } from "module"
|
|
8
|
+
import { fileURLToPath } from "url"
|
|
9
|
+
|
|
10
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
11
|
+
const require = createRequire(import.meta.url)
|
|
12
|
+
const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, "package.json"), "utf8"))
|
|
13
|
+
|
|
14
|
+
const platformMap = {
|
|
15
|
+
darwin: "darwin",
|
|
16
|
+
linux: "linux",
|
|
17
|
+
win32: "windows",
|
|
18
|
+
}
|
|
19
|
+
const archMap = {
|
|
20
|
+
x64: "x64",
|
|
21
|
+
arm64: "arm64",
|
|
22
|
+
arm: "arm",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const platform = platformMap[os.platform()] ?? os.platform()
|
|
26
|
+
const arch = archMap[os.arch()] ?? os.arch()
|
|
27
|
+
const base = `codo-${platform}-${arch}`
|
|
28
|
+
const sourceBinary = platform === "windows" ? "codo.exe" : "codo"
|
|
29
|
+
const targetBinary = path.join(__dirname, "bin", "codo.exe")
|
|
30
|
+
|
|
31
|
+
function supportsAvx2() {
|
|
32
|
+
if (arch !== "x64") return false
|
|
33
|
+
|
|
34
|
+
if (platform === "linux") {
|
|
35
|
+
try {
|
|
36
|
+
return /(^|\s)avx2(\s|$)/i.test(fs.readFileSync("/proc/cpuinfo", "utf8"))
|
|
37
|
+
} catch {
|
|
38
|
+
return false
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (platform === "darwin") {
|
|
43
|
+
try {
|
|
44
|
+
const result = childProcess.spawnSync("sysctl", ["-n", "hw.optional.avx2_0"], {
|
|
45
|
+
encoding: "utf8",
|
|
46
|
+
timeout: 1500,
|
|
47
|
+
})
|
|
48
|
+
if (result.status !== 0) return false
|
|
49
|
+
return (result.stdout || "").trim() === "1"
|
|
50
|
+
} catch {
|
|
51
|
+
return false
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (platform === "windows") {
|
|
56
|
+
const command =
|
|
57
|
+
'(Add-Type -MemberDefinition "[DllImport(""kernel32.dll"")] public static extern bool IsProcessorFeaturePresent(int ProcessorFeature);" -Name Kernel32 -Namespace Win32 -PassThru)::IsProcessorFeaturePresent(40)'
|
|
58
|
+
|
|
59
|
+
for (const executable of ["powershell.exe", "pwsh.exe", "pwsh", "powershell"]) {
|
|
60
|
+
try {
|
|
61
|
+
const result = childProcess.spawnSync(executable, ["-NoProfile", "-NonInteractive", "-Command", command], {
|
|
62
|
+
encoding: "utf8",
|
|
63
|
+
timeout: 3000,
|
|
64
|
+
windowsHide: true,
|
|
65
|
+
})
|
|
66
|
+
if (result.status !== 0) continue
|
|
67
|
+
const output = (result.stdout || "").trim().toLowerCase()
|
|
68
|
+
if (output === "true" || output === "1") return true
|
|
69
|
+
if (output === "false" || output === "0") return false
|
|
70
|
+
} catch {
|
|
71
|
+
continue
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return false
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function isMusl() {
|
|
80
|
+
if (platform !== "linux") return false
|
|
81
|
+
|
|
82
|
+
try {
|
|
83
|
+
if (fs.existsSync("/etc/alpine-release")) return true
|
|
84
|
+
} catch {
|
|
85
|
+
// Ignore filesystem probes that are blocked by the host.
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
try {
|
|
89
|
+
const result = childProcess.spawnSync("ldd", ["--version"], { encoding: "utf8" })
|
|
90
|
+
return `${result.stdout || ""}${result.stderr || ""}`.toLowerCase().includes("musl")
|
|
91
|
+
} catch {
|
|
92
|
+
return false
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function packageNames() {
|
|
97
|
+
const baseline = arch === "x64" && !supportsAvx2()
|
|
98
|
+
|
|
99
|
+
if (platform === "linux") {
|
|
100
|
+
if (isMusl()) {
|
|
101
|
+
if (arch === "x64")
|
|
102
|
+
return baseline
|
|
103
|
+
? [`${base}-baseline-musl`, `${base}-musl`, `${base}-baseline`, base]
|
|
104
|
+
: [`${base}-musl`, `${base}-baseline-musl`, base, `${base}-baseline`]
|
|
105
|
+
return [`${base}-musl`, base]
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (arch === "x64")
|
|
109
|
+
return baseline
|
|
110
|
+
? [`${base}-baseline`, base, `${base}-baseline-musl`, `${base}-musl`]
|
|
111
|
+
: [base, `${base}-baseline`, `${base}-musl`, `${base}-baseline-musl`]
|
|
112
|
+
return [base, `${base}-musl`]
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (arch === "x64") return baseline ? [`${base}-baseline`, base] : [base, `${base}-baseline`]
|
|
116
|
+
return [base]
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function resolveBinary(name) {
|
|
120
|
+
const packageJsonPath = require.resolve(`${name}/package.json`)
|
|
121
|
+
const binaryPath = path.join(path.dirname(packageJsonPath), "bin", sourceBinary)
|
|
122
|
+
if (!fs.existsSync(binaryPath)) throw new Error(`Binary not found at ${binaryPath}`)
|
|
123
|
+
return binaryPath
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function installPackage(name) {
|
|
127
|
+
const version = packageJson.optionalDependencies?.[name]
|
|
128
|
+
if (!version) return
|
|
129
|
+
|
|
130
|
+
const temp = fs.mkdtempSync(path.join(os.tmpdir(), "codo-install-"))
|
|
131
|
+
try {
|
|
132
|
+
const result = childProcess.spawnSync(
|
|
133
|
+
"npm",
|
|
134
|
+
["install", "--ignore-scripts", "--no-save", "--loglevel=error", "--prefix", temp, `${name}@${version}`],
|
|
135
|
+
{ stdio: "inherit", windowsHide: true },
|
|
136
|
+
)
|
|
137
|
+
if (result.status !== 0) return
|
|
138
|
+
const packageDir = path.join(temp, "node_modules", name)
|
|
139
|
+
copyBinary(path.join(packageDir, "bin", sourceBinary), targetBinary)
|
|
140
|
+
return true
|
|
141
|
+
} finally {
|
|
142
|
+
fs.rmSync(temp, { recursive: true, force: true })
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function copyBinary(source, target) {
|
|
147
|
+
if (!fs.existsSync(source)) throw new Error(`Binary not found at ${source}`)
|
|
148
|
+
fs.mkdirSync(path.dirname(target), { recursive: true })
|
|
149
|
+
if (fs.existsSync(target)) fs.unlinkSync(target)
|
|
150
|
+
try {
|
|
151
|
+
fs.linkSync(source, target)
|
|
152
|
+
} catch {
|
|
153
|
+
fs.copyFileSync(source, target)
|
|
154
|
+
}
|
|
155
|
+
fs.chmodSync(target, 0o755)
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function verifyBinary() {
|
|
159
|
+
const result = childProcess.spawnSync(targetBinary, ["--version"], {
|
|
160
|
+
encoding: "utf8",
|
|
161
|
+
stdio: "ignore",
|
|
162
|
+
windowsHide: true,
|
|
163
|
+
})
|
|
164
|
+
return result.status === 0
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function main() {
|
|
168
|
+
for (const name of packageNames()) {
|
|
169
|
+
try {
|
|
170
|
+
copyBinary(resolveBinary(name), targetBinary)
|
|
171
|
+
if (verifyBinary()) return
|
|
172
|
+
} catch {
|
|
173
|
+
if (installPackage(name) && verifyBinary()) return
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
throw new Error(
|
|
178
|
+
`It seems your package manager failed to install the right codo CLI package. Try manually installing ${packageNames()
|
|
179
|
+
.map((name) => JSON.stringify(name))
|
|
180
|
+
.join(" or ")}.`,
|
|
181
|
+
)
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
try {
|
|
185
|
+
main()
|
|
186
|
+
} catch (error) {
|
|
187
|
+
console.error(error.message)
|
|
188
|
+
process.exit(1)
|
|
189
|
+
}
|