Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
49867d7
feat: scope local build verification to the loaded beamed repo and ad…
Rajanna-Karthik Aug 13, 2026
5e92430
fix(amazonq): deliver Q Developer access-blocked notifications to the…
ashishrp-aws Aug 13, 2026
1cf9397
chore(release): release packages from branch main (#2795)
github-actions[bot] Aug 13, 2026
04b1509
chore: bump agentic version: 1.75.0 (#2837)
laileni-aws Aug 14, 2026
43e44dc
fix: repoint CODEOWNERS and package repository URLs to the new org (#…
chungjac Aug 14, 2026
4e0d3b0
feat(amazonq): initialize Q services when credentials arrive (#2840)
ashishrp-aws Aug 17, 2026
368a099
fix(amazonq): retry truncated tool-use streams instead of dropping th…
laileni-aws Aug 18, 2026
37dd2d1
chore(release): release packages from branch main (#2839)
github-actions[bot] Aug 18, 2026
9f8bb89
fix: scope and forward stepId for the planning-branch LBV HITL (#2835)
Rajanna-Karthik Aug 19, 2026
1eb2f9f
fix(amazonq): narrow tool-use truncation detection and classify ret…
laileni-aws Aug 20, 2026
b3b2040
chore: bump agentic version: 1.76.0 (#2844)
ashishrp-aws Aug 20, 2026
f42b58c
chore(release): release packages from branch main (#2845)
github-actions[bot] Aug 20, 2026
55af91e
chore: bump agentic version: 1.77.0 (#2848)
xinyiww1 Aug 21, 2026
863c5bf
fix: beam - flat-named transformed zips + lightweight discovery + IsL…
Rajanna-Karthik Aug 24, 2026
836b756
fix: surface backend interactive mode in getTransformInfo
cslong Aug 24, 2026
529aed4
fix(amazonq): cover merged env and headers in MCP consent fingerprint…
chungjac Aug 24, 2026
d493511
chore(release): release packages from branch main (#2850)
github-actions[bot] Aug 25, 2026
2b5b9e7
chore: bump agentic version: 1.78.0 (#2856)
XiaowenMaoA Aug 25, 2026
acd48a9
fix: pass untrusted event data via env in prerelease workflow (#2861)
laileni-aws Sep 4, 2026
2a478f7
fix: AWS Transform unit-test generation choice + status-only UT subst…
Rajanna-Karthik Sep 9, 2026
f6e13aa
chore(release): release packages from branch main (#2863)
github-actions[bot] Sep 9, 2026
e127c5a
chore: bump agentic version: 1.79.0 (#2868)
chungjac Sep 10, 2026
e7017c0
fix: pass workflow inputs via env in release-candidate workflow (#2869)
laileni-aws Sep 10, 2026
95344fd
fix(netTransform): Beam to IDE — live beam node, JSON artifact cache,…
Rajanna-Karthik Sep 28, 2026
37d44ca
fix(amazonq): stream large ATX artifact downloads to disk (#2885)
xueningl-az Sep 28, 2026
73dd8c6
feat(chat-client): add IDE deprecation notice (#2877)
araarush Sep 29, 2026
e201207
fix(amazonq): forward the missing-packages HITL when a plan already e…
Rajanna-Karthik Sep 29, 2026
b631e38
fix(amazonq): restore a mid-job migration mode from the settings arti…
Rajanna-Karthik Sep 30, 2026
b12c757
chore(release): release packages from branch main (#2889)
github-actions[bot] Oct 1, 2026
7c9f732
chore: bump agentic version: 1.80.0 (#2900)
chungjac Oct 1, 2026
ba53363
feat: add MCP configuration review action
dungdong-aws Sep 16, 2026
57827d9
fix: validate MCP OAuth token endpoints
dungdong-aws Sep 16, 2026
b347709
test: cover blocked MCP OAuth refresh endpoint
dungdong-aws Sep 17, 2026
ab7627c
fix: resolve filesystem tool paths symlink-aware before read/write/list
dungdong-aws Sep 18, 2026
ce3e6a6
test: await temp folder cleanup in fsRead tests
dungdong-aws Sep 18, 2026
5383245
test: expect canonical path in fsWrite index assertion
dungdong-aws Sep 18, 2026
41a1fd1
fix: require approval for in-place writes to multiply linked files
dungdong-aws Sep 18, 2026
5626b4a
fix: confirm reads and writes of files that carry more than one name
dungdong-aws Sep 21, 2026
63da91a
fix: harden tool path handling
laileni-aws Sep 30, 2026
d51b874
fix(amazonq): distinguish consent-denied MCP servers
dungdong-aws Oct 2, 2026
bb2e883
fix(amazonq): serialize MCP server consent prompts
dungdong-aws Oct 2, 2026
effa710
fix(amazonq): preserve existing MCP consent prompt behavior
dungdong-aws Oct 2, 2026
0007ee9
fix: enforce CodeReview artifact workspace boundaries (#2898)
laileni-aws Oct 5, 2026
6bf4bcd
fix(amazonq): mark truncated MCP consent previews
dungdong-aws Oct 7, 2026
5d2080a
fix(amazonq): align tilde path validation and add regression tests
dungdong-aws Oct 8, 2026
b47ebc8
chore(chat-client): bump mynah-ui to 4.40.4
dungdong-aws Oct 8, 2026
4ca8fad
chore(release): release packages from branch main (#2912)
github-actions[bot] Oct 8, 2026
89b75b1
chore: bump agentic version: 1.81.0 (#2924)
araarush Oct 9, 2026
81c9268
fix(amazonq): upload transform artifact from a worker thread to avoid…
tomar-gunjan Oct 13, 2026
471a7f4
fix(amazonq): retain checked targets and editor state (#2940)
dungdong-aws Oct 15, 2026
625fb21
chore(release): release packages from branch main (#2929)
github-actions[bot] Oct 15, 2026
452d26c
chore: bump agentic version: 1.82.0 (#2942)
xinyiww1 Oct 15, 2026
83520bd
ci: replace retired macos-13 runner with macos-15-intel in integratio…
laileni-aws Oct 5, 2026
96372c0
fix: mcp and path resolver (#2957)
dungdong-aws Oct 21, 2026
197e987
chore(release): release packages from branch main (#2959)
github-actions[bot] Oct 22, 2026
d49278a
chore: bump agentic version: 1.83.0 (#2973)
XiaowenMaoA Oct 23, 2026
4889b3d
chore: merge feature/OHI fixes to main (#2978)
dungdong-aws Oct 28, 2026
725370f
feat: AWS Transform: IAM (SigV4) authentication in the language serve…
tomar-gunjan Oct 28, 2026
64dbfda
chore(release): release packages from branch main (#2981)
github-actions[bot] Oct 28, 2026
3ae657b
chore: bump agentic version: 1.84.0 (#2989)
bywang56 Oct 29, 2026
86a471c
fix(lsp-yaml): load the schema once instead of on every request (#3017)
dungdong-aws Nov 2, 2026
103c60e
fix: update bundled Node.js to 24.22.2 for CVE-2026-111497 (#3026)
laileni-aws Nov 4, 2026
4838a2f
ci: open a pull request when a newer bundled Node.js release is avail…
laileni-aws Nov 5, 2026
4824250
chore(release): release packages from branch main (#3022)
github-actions[bot] Nov 5, 2026
ba9d3b1
chore: bump agentic version: 1.85.0 (#3034)
ashishrp-aws Nov 6, 2026
65217af
fix: address security issues (#3041)
dungdong-aws Nov 12, 2026
7236319
chore(release): release packages from branch main (#3045)
github-actions[bot] Nov 12, 2026
f16a174
chore: bump agentic version: 1.86.0 (#3050)
dungdong-aws Nov 12, 2026
4a32fc2
fix: update bundled Node.js to 24.22.3 (#3043)
github-actions[bot] Nov 16, 2026
50f3019
fix: mcp permissions and file indexing (#3078)
dungdong-aws Nov 18, 2026
9f595e6
feat(amazonq): ITGen — language-server support for integration-test g…
xueningl-az Nov 18, 2026
0d9c562
chore(release): release packages from branch main (#3079)
github-actions[bot] Nov 18, 2026
99be345
chore: bump agentic version: 1.87.0
Nov 18, 2026
25adee7
fix(amazonq): an ATX artifact download gets its file name only when t…
jabouayash Nov 18, 2026
37715a9
fix: Merge pull request #3083 from Amazon-Q-Developer/release/agentic…
chungjac Nov 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @aws/flare
* @Amazon-Q-Developer/sync-team-dae-production-eng-team
122 changes: 122 additions & 0 deletions .github/workflows/bump-bundled-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
name: Bump bundled Node.js

# Opens a draft pull request when Node.js publishes a newer release of the major line
# that app/aws-lsp-codewhisperer-runtimes/scripts/download-node.sh bundles.

on:
schedule:
- cron: '0 6 * * *'
workflow_dispatch:

permissions: {}

concurrency:
group: bump-bundled-node
cancel-in-progress: false

jobs:
bump:
name: Bump bundled Node.js
# Run only from main, so the bump branch holds nothing but the version change.
if: github.repository == 'Amazon-Q-Developer/language-servers' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: write # push the bump branch
pull-requests: write # open the pull request
defaults:
run:
shell: bash
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check for a newer Node.js release
id: check
run: ./app/aws-lsp-codewhisperer-runtimes/scripts/update-node-version.sh

- name: Check for an existing pull request
id: existing
if: steps.check.outputs.updated == 'true'
env:
GH_TOKEN: ${{ github.token }}
BRANCH: automation/bump-bundled-node-${{ steps.check.outputs.latest }}
LATEST: ${{ steps.check.outputs.latest }}
run: |
# Any earlier pull request from this repository's bump branch, including a closed one, stops a new one.
# Pull requests from forks are not counted, so a fork cannot block a bump by reusing the branch name.
same_repo='[.[] | select(.isCrossRepository | not)] | length'
branch_count=$(gh pr list --head "$BRANCH" --state all --json isCrossRepository --jq "$same_repo")
# An open pull request that already updates to this version, on any branch, also stops a new one.
title_count=$(gh pr list --state open --search "in:title \"bundled Node.js to $LATEST\"" --json number --jq length)
if [ "$branch_count" -gt 0 ] || [ "$title_count" -gt 0 ]; then
echo "A pull request for Node.js $LATEST already exists."
echo "exists=true" >> "$GITHUB_OUTPUT"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi

- name: Verify the new Node.js files
if: steps.existing.outputs.exists == 'false'
working-directory: app/aws-lsp-codewhisperer-runtimes
run: |
mkdir -p build
./scripts/download-node.sh

- name: Open pull request
if: steps.existing.outputs.exists == 'false'
env:
GH_TOKEN: ${{ github.token }}
CURRENT: ${{ steps.check.outputs.current }}
LATEST: ${{ steps.check.outputs.latest }}
SECURITY_VERSIONS: ${{ steps.check.outputs.security_versions }}
BRANCH: automation/bump-bundled-node-${{ steps.check.outputs.latest }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
script_path=app/aws-lsp-codewhisperer-runtimes/scripts/download-node.sh
if [ -n "$SECURITY_VERSIONS" ]; then
title="fix: update bundled Node.js to $LATEST"
else
title="chore: update bundled Node.js to $LATEST"
fi

body_file="$RUNNER_TEMP/pr-body.md"
{
echo '## Problem'
echo
echo "The language server bundles Node.js $CURRENT. Node.js $LATEST is the newest release of the same major line."
if [ -n "$SECURITY_VERSIONS" ]; then
echo
echo 'Node.js marks these releases since the bundled version as security releases:'
for version in $SECURITY_VERSIONS; do
echo "- [v$version](https://github.com/nodejs/node/releases/tag/v$version)"
done
fi
echo
echo '## Solution'
echo
echo "Update \`NODE_SEMVER\` in \`$script_path\` to $LATEST ([release notes](https://github.com/nodejs/node/releases/tag/v$LATEST))."
echo
echo '## Testing'
echo
echo "[This workflow run]($RUN_URL) downloaded the Node.js $LATEST files for all five platforms and checked each SHA-256 against the release's \`SHASUMS256.txt\`."
echo
echo 'Opened as a draft by the "Bump bundled Node.js" workflow. GitHub does not start CI for pull requests opened with the workflow token. To run CI, close and reopen this pull request, then mark it ready for review.'
} > "$body_file"

git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
git switch -c "$BRANCH"
git add "$script_path"
git commit -m "$title"

remote_sha=$(git ls-remote --heads origin | awk -v ref="refs/heads/$BRANCH" '$2 == ref {print $1}')
if [ -n "$remote_sha" ]; then
# An earlier run pushed this branch but did not open the pull request.
# Replace it with the commit verified in this run, unless it changed after it was read.
git push --force-with-lease="refs/heads/$BRANCH:$remote_sha" origin "$BRANCH"
else
git push origin "$BRANCH"
fi

gh pr create --draft --base main --head "$BRANCH" --title "$title" --body-file "$body_file" --label dependencies
18 changes: 14 additions & 4 deletions .github/workflows/create-agentic-github-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,23 @@ jobs:

# if user ran this action manually
- if: github.event_name == 'workflow_dispatch'
env:
# Pass untrusted event data through the environment instead of
# interpolating it directly into the script body.
INPUT_TAG_NAME: ${{ github.event.inputs.tag_name }}
run: |
echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
echo "PRERELEASE_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV
echo "TAG_NAME=$INPUT_TAG_NAME" >> $GITHUB_ENV
echo "PRERELEASE_NAME=$INPUT_TAG_NAME" >> $GITHUB_ENV

# Otherwise a push to a branch triggered this action.
# Set TAG_NAME and PRERELEASE_NAME based on branch name
- if: github.event_name != 'workflow_dispatch'
env:
# Branch names are attacker-controllable, so read the value from the
# environment instead of interpolating it into the script body.
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
run: |
BRANCH_NAME="${{ github.event.workflow_run.head_branch }}"
BRANCH_NAME="$HEAD_BRANCH"
if [[ "$BRANCH_NAME" == "main" ]]; then
echo "TAG_NAME=agentic-alpha" >> $GITHUB_ENV
echo "PRERELEASE_NAME=alpha" >> $GITHUB_ENV
Expand All @@ -53,6 +61,8 @@ jobs:

# Make a sever version that is "decorated" as prerelease
- name: Create SERVER_VERSION
env:
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
run: |
# example: 1.0.999-pre-main.commitid
# SERVER_VERSION - we're making "imitation" manifests that are accessible
Expand All @@ -61,7 +71,7 @@ jobs:
# in the version.json file.

AGENTIC_VERSION=$(jq -r '.agenticChat' app/aws-lsp-codewhisperer-runtimes/src/version.json)
COMMIT_SHORT=$(echo "${{ github.event.workflow_run.head_sha }}" | cut -c1-8)
COMMIT_SHORT=$(echo "$HEAD_SHA" | cut -c1-8)
echo "SERVER_VERSION=$AGENTIC_VERSION-$PRERELEASE_NAME.$COMMIT_SHORT" >> $GITHUB_ENV

- name: Export outputs
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/create-release-candidate-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,13 @@ jobs:
id: release-version
env:
VERSION_FILE: app/aws-lsp-codewhisperer-runtimes/src/version.json
# Bind workflow inputs via env so they are passed as data, not
# expanded into the script source (prevents script injection).
CUSTOM_VERSION: ${{ inputs.customVersion }}
VERSION_INCREMENT: ${{ inputs.versionIncrement }}
run: |
customVersion="${{ inputs.customVersion }}"
versionIncrement="${{ inputs.versionIncrement }}"
customVersion="$CUSTOM_VERSION"
versionIncrement="$VERSION_INCREMENT"

# Read current version
currentVersion=$(jq -r '.agenticChat' "$VERSION_FILE")
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
target: linux-x64
- os: macos-latest
target: mac-arm64
- os: macos-13
- os: macos-15-intel
target: mac-x64
- os: windows-latest
target: win-x64
Expand Down
14 changes: 7 additions & 7 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"chat-client": "0.1.55",
"core/aws-lsp-core": "0.0.21",
"server/aws-lsp-antlr4": "0.1.25",
"server/aws-lsp-codewhisperer": "0.0.123",
"server/aws-lsp-json": "0.1.26",
"server/aws-lsp-partiql": "0.0.23",
"server/aws-lsp-yaml": "0.1.26"
"chat-client": "0.1.59",
"core/aws-lsp-core": "0.0.22",
"server/aws-lsp-antlr4": "0.1.26",
"server/aws-lsp-codewhisperer": "0.0.135",
"server/aws-lsp-json": "0.1.27",
"server/aws-lsp-partiql": "0.0.24",
"server/aws-lsp-yaml": "0.1.28"
}
2 changes: 1 addition & 1 deletion app/aws-lsp-codewhisperer-runtimes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"local-build": "node scripts/local-build.js"
},
"dependencies": {
"@aws/language-server-runtimes": "^0.3.14",
"@aws/language-server-runtimes": "0.3.22",
"@aws/lsp-codewhisperer": "*",
"copyfiles": "^2.4.1",
"cross-env": "^7.0.3",
Expand Down
57 changes: 38 additions & 19 deletions app/aws-lsp-codewhisperer-runtimes/scripts/download-node.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,32 @@
# by src/scripts/copy-node-assets.ts, to produce the final bundle.

set -eo pipefail
# Node.js major line to bundle. .github/workflows/bump-bundled-node.yml opens a draft pull request
# when Node.js publishes a newer release of this line.
# shellcheck disable=SC2034 # read by update-node-version.sh
NODE_VERSION="24"
BASE_URL="https://nodejs.org/download/release/v24.9.0"
# Exact version to bundle, pinned for reproducible builds.
NODE_SEMVER="24.22.3"
BASE_URL="https://nodejs.org/download/release/v$NODE_SEMVER"
SHASUMS_FILE="SHASUMS256.txt"
ASSETS_DIR="build/node-assets"

# Download SHASUMS256.txt
curl -s "$BASE_URL/$SHASUMS_FILE" -o "$SHASUMS_FILE"
# Prints the SHA-256 of a file. macOS has shasum instead of sha256sum.
sha256_of() {
if command -v sha256sum > /dev/null 2>&1; then
sha256sum "$1" | awk '{print $1}'
else
shasum -a 256 "$1" | awk '{print $1}'
fi
}

# Download SHASUMS256.txt, and remove it when the script exits, including on failure.
trap 'rm -f "$SHASUMS_FILE"' EXIT
curl -fsSL "$BASE_URL/$SHASUMS_FILE" -o "$SHASUMS_FILE"

# Extract exact Node.js version from any entry in SHASUMS256.txt
# NODE_SEMVER=$(grep -o 'node-v[0-9]*\.[0-9]*\.[0-9]*' SHASUMS256.txt | head -1 | cut -d'v' -f2)

# temporarily lock node.js version to 24.9.0 due to https://github.com/nodejs/node/issues/60176
NODE_SEMVER="24.9.0"

if [ -z "$NODE_SEMVER" ]; then
echo "Failed to extract Node.js version from SHASUMS256.txt"
exit 1
Expand All @@ -40,19 +52,26 @@ EXPECTED_FILES=(
"node-v$NODE_SEMVER-darwin-x64.tar.gz"
)

# Process each expected file pattern
# Download each expected file and verify it against SHASUMS256.txt.
# A missing entry fails the build: a release without every platform cannot be bundled.
for actual_file in "${EXPECTED_FILES[@]}"; do
# Search for the file in SHASUMS256.txt
if grep -q "$actual_file" SHASUMS256.txt; then
filepath="$ASSETS_DIR/$actual_file"
expected_sum=$(grep "$actual_file" SHASUMS256.txt | awk '{print $1}')
echo "Found $actual_file with shasum: $expected_sum"

echo "Updating $actual_file"
mkdir -p "$(dirname "$filepath")"
curl -s "$BASE_URL/$actual_file" -o "$filepath"
else
echo "Warning: $actual_file not found in SHASUMS256.txt"
expected_sum=$(awk -v name="$actual_file" '$2 == name {print $1}' "$SHASUMS_FILE")
if [ -z "$expected_sum" ]; then
echo "Error: $actual_file not found in $SHASUMS_FILE" >&2
exit 1
fi

filepath="$ASSETS_DIR/$actual_file"
echo "Found $actual_file with shasum: $expected_sum"

echo "Updating $actual_file"
mkdir -p "$(dirname "$filepath")"
curl -fsSL "$BASE_URL/$actual_file" -o "$filepath"

actual_sum=$(sha256_of "$filepath")
if [ "$actual_sum" != "$expected_sum" ]; then
echo "Error: SHA-256 mismatch for $actual_file (expected $expected_sum, got $actual_sum)" >&2
exit 1
fi
done

Expand All @@ -61,7 +80,7 @@ LICENSE_URL="https://raw.githubusercontent.com/nodejs/node/v${NODE_SEMVER}/LICEN
LICENSE_FILE="$ASSETS_DIR/LICENSE"

echo "Fetching Node.js license from $LICENSE_URL"
curl -s "$LICENSE_URL" -o "$LICENSE_FILE"
curl -fsSL "$LICENSE_URL" -o "$LICENSE_FILE"

# Verify the license file was downloaded successfully
if [ ! -s "$LICENSE_FILE" ]; then
Expand Down
70 changes: 70 additions & 0 deletions app/aws-lsp-codewhisperer-runtimes/scripts/update-node-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash

# Checks nodejs.org for a newer release of the Node.js line pinned in download-node.sh.
# If one exists, rewrites NODE_SEMVER in that script. Used by .github/workflows/bump-bundled-node.yml.
# Prints current, latest, updated and security_versions, and appends them to $GITHUB_OUTPUT when set.

set -eo pipefail

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DOWNLOAD_SCRIPT="$SCRIPT_DIR/download-node.sh"
# Overridable for local testing, for example with a file:// URL.
NODE_INDEX_URL="${NODE_INDEX_URL:-https://nodejs.org/dist/index.json}"

major=$(sed -n -E 's/^NODE_VERSION="([0-9]+)"$/\1/p' "$DOWNLOAD_SCRIPT")
current=$(sed -n -E 's/^NODE_SEMVER="([0-9]+\.[0-9]+\.[0-9]+)"$/\1/p' "$DOWNLOAD_SCRIPT")

# Each pattern must match exactly one line, so a multi-line result fails these checks.
if ! [[ "$major" =~ ^[0-9]+$ ]] || ! [[ "$current" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: expected one NODE_VERSION line and one NODE_SEMVER line in $DOWNLOAD_SCRIPT" >&2
exit 1
fi
if [ "${current%%.*}" != "$major" ]; then
echo "Error: NODE_SEMVER $current is not on the NODE_VERSION $major line" >&2
exit 1
fi

# Treat the index as untrusted input: only plain x.y.z versions on the pinned major line count.
# \A and \z anchor the whole string: in jq, $ also matches before a trailing newline.
result=$(curl -fsSL "$NODE_INDEX_URL" | jq -r --arg current "$current" --argjson major "$major" '
def semver: split(".") | map(tonumber);
if type != "array" then error("the index is not a JSON array") else . end
| ($current | semver) as $cur
| [ .[]
| select((.version | type) == "string"
and (.version | test("\\Av(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\z")))
| (.version | ltrimstr("v")) as $version
| { version: $version, key: ($version | semver), security: (.security == true) }
| select(.key[0] == $major) ]
| max_by(.key) as $latest
| if $latest == null then error("no \($major).x releases in the index") else . end
| [ .[] | select(.key > $cur and .key <= $latest.key and .security) ] as $security
| "\($latest.version) \($latest.key > $cur) \($security | sort_by(.key) | map(.version) | join(" "))"
')

read -r latest newer security_versions <<< "$result"
if ! [[ "$latest" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Error: unexpected latest version '$latest'" >&2
exit 1
fi

updated=false
if [ "$newer" = "true" ]; then
tmp_file=$(mktemp)
trap 'rm -f "$tmp_file"' EXIT
sed -E "s/^NODE_SEMVER=\"${current//./\\.}\"$/NODE_SEMVER=\"$latest\"/" "$DOWNLOAD_SCRIPT" > "$tmp_file"
if [ "$(grep -c "^NODE_SEMVER=\"$latest\"$" "$tmp_file")" -ne 1 ]; then
echo "Error: failed to update NODE_SEMVER in $DOWNLOAD_SCRIPT" >&2
exit 1
fi
# Overwrite in place so the script keeps its executable mode.
cat "$tmp_file" > "$DOWNLOAD_SCRIPT"
updated=true
fi

{
echo "current=$current"
echo "latest=$latest"
echo "updated=$updated"
echo "security_versions=$security_versions"
} | tee -a "${GITHUB_OUTPUT:-/dev/null}"
2 changes: 1 addition & 1 deletion app/aws-lsp-codewhisperer-runtimes/src/version.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"agenticChat": "1.74.0"
"agenticChat": "1.87.0"
}
Loading
Loading