Skip to content

Commit 4e716e0

Browse files
committed
feat(deps): add @openai/codex dependency and fix json parsing
Add @openai/codex package to enable AI-powered coding functionality. Also fix JSON parsing in security verification by stripping ANSI escape sequences from error messages that could break JSON parsers.
1 parent f4cb598 commit 4e716e0

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

bun.lock

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,8 @@
1919
"trustedDependencies": [
2020
"sharp",
2121
"unrs-resolver"
22-
]
22+
],
23+
"dependencies": {
24+
"@openai/codex": "^0.97.0"
25+
}
2326
}

scripts/lib/security.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,14 @@ verify_all_installers_json() {
10901090
local skipped=()
10911091
local total=0
10921092

1093+
# Remove ANSI escape sequences and control chars that break JSON parsers.
1094+
_strip_ansi() {
1095+
local str="$1"
1096+
str="${str//$'\033'/}"
1097+
str="${str//\[[0-9;]*m/}"
1098+
printf '%s' "$str"
1099+
}
1100+
10931101
# Helper function to escape strings for JSON
10941102
_json_escape() {
10951103
local str="$1"
@@ -1134,6 +1142,7 @@ verify_all_installers_json() {
11341142
else
11351143
# Failure
11361144
fetch_error=$(cat "$tmp_err")
1145+
fetch_error=$(_strip_ansi "$fetch_error")
11371146
[[ -z "$fetch_error" ]] && fetch_error="Unknown error fetching checksum"
11381147
fi
11391148
rm -f "$tmp_err"

0 commit comments

Comments
 (0)