Skip to content

Commit becf78d

Browse files
authored
📦 chore: Update @modelcontextprotocol/sdk to v1.17.0 (danny-avila#8674)
* 📦 chore: Update `@modelcontextprotocol/sdk` to v1.17.0 * refactor: unused package detection by extracting workspace dependencies in GitHub Actions workflow * chore: Enhance unused package detection by including peerDependencies extraction in GitHub Actions workflow * fix: Ensure safe extraction of dependencies and peerDependencies in unused package detection workflow
1 parent 37b485c commit becf78d

File tree

4 files changed

+54
-36
lines changed

4 files changed

+54
-36
lines changed

.github/workflows/unused-packages.yml

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,52 @@ jobs:
7979
extract_deps_from_code "client" client_used_code.txt
8080
extract_deps_from_code "api" api_used_code.txt
8181
82+
- name: Extract Workspace Dependencies
83+
id: extract-workspace-deps
84+
run: |
85+
# Function to get dependencies from a workspace package that are used by another package
86+
get_workspace_package_deps() {
87+
local package_json=$1
88+
local output_file=$2
89+
90+
# Get all workspace dependencies (starting with @librechat/)
91+
if [[ -f "$package_json" ]]; then
92+
local workspace_deps=$(jq -r '.dependencies // {} | to_entries[] | select(.key | startswith("@librechat/")) | .key' "$package_json" 2>/dev/null || echo "")
93+
94+
# For each workspace dependency, get its dependencies
95+
for dep in $workspace_deps; do
96+
# Convert @librechat/api to packages/api
97+
local workspace_path=$(echo "$dep" | sed 's/@librechat\//packages\//')
98+
local workspace_package_json="${workspace_path}/package.json"
99+
100+
if [[ -f "$workspace_package_json" ]]; then
101+
# Extract all dependencies from the workspace package
102+
jq -r '.dependencies // {} | keys[]' "$workspace_package_json" 2>/dev/null >> "$output_file"
103+
# Also extract peerDependencies
104+
jq -r '.peerDependencies // {} | keys[]' "$workspace_package_json" 2>/dev/null >> "$output_file"
105+
fi
106+
done
107+
fi
108+
109+
if [[ -f "$output_file" ]]; then
110+
sort -u "$output_file" -o "$output_file"
111+
else
112+
touch "$output_file"
113+
fi
114+
}
115+
116+
# Get workspace dependencies for each package
117+
get_workspace_package_deps "package.json" root_workspace_deps.txt
118+
get_workspace_package_deps "client/package.json" client_workspace_deps.txt
119+
get_workspace_package_deps "api/package.json" api_workspace_deps.txt
120+
82121
- name: Run depcheck for root package.json
83122
id: check-root
84123
run: |
85124
if [[ -f "package.json" ]]; then
86125
UNUSED=$(depcheck --json | jq -r '.dependencies | join("\n")' || echo "")
87-
UNUSED=$(comm -23 <(echo "$UNUSED" | sort) <(cat root_used_deps.txt root_used_code.txt | sort) || echo "")
126+
# Exclude dependencies used in scripts, code, and workspace packages
127+
UNUSED=$(comm -23 <(echo "$UNUSED" | sort) <(cat root_used_deps.txt root_used_code.txt root_workspace_deps.txt | sort) || echo "")
88128
echo "ROOT_UNUSED<<EOF" >> $GITHUB_ENV
89129
echo "$UNUSED" >> $GITHUB_ENV
90130
echo "EOF" >> $GITHUB_ENV
@@ -97,7 +137,8 @@ jobs:
97137
chmod -R 755 client
98138
cd client
99139
UNUSED=$(depcheck --json | jq -r '.dependencies | join("\n")' || echo "")
100-
UNUSED=$(comm -23 <(echo "$UNUSED" | sort) <(cat ../client_used_deps.txt ../client_used_code.txt | sort) || echo "")
140+
# Exclude dependencies used in scripts, code, and workspace packages
141+
UNUSED=$(comm -23 <(echo "$UNUSED" | sort) <(cat ../client_used_deps.txt ../client_used_code.txt ../client_workspace_deps.txt | sort) || echo "")
101142
# Filter out false positives
102143
UNUSED=$(echo "$UNUSED" | grep -v "^micromark-extension-llm-math$" || echo "")
103144
echo "CLIENT_UNUSED<<EOF" >> $GITHUB_ENV
@@ -113,7 +154,8 @@ jobs:
113154
chmod -R 755 api
114155
cd api
115156
UNUSED=$(depcheck --json | jq -r '.dependencies | join("\n")' || echo "")
116-
UNUSED=$(comm -23 <(echo "$UNUSED" | sort) <(cat ../api_used_deps.txt ../api_used_code.txt | sort) || echo "")
157+
# Exclude dependencies used in scripts, code, and workspace packages
158+
UNUSED=$(comm -23 <(echo "$UNUSED" | sort) <(cat ../api_used_deps.txt ../api_used_code.txt ../api_workspace_deps.txt | sort) || echo "")
117159
echo "API_UNUSED<<EOF" >> $GITHUB_ENV
118160
echo "$UNUSED" >> $GITHUB_ENV
119161
echo "EOF" >> $GITHUB_ENV

api/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"@librechat/agents": "^2.4.68",
5353
"@librechat/api": "*",
5454
"@librechat/data-schemas": "*",
55+
"@modelcontextprotocol/sdk": "^1.17.0",
5556
"@node-saml/passport-saml": "^5.1.0",
5657
"@waylaidwanderer/fetch-event-source": "^3.0.1",
5758
"axios": "^1.8.2",

package-lock.json

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

packages/api/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"@langchain/core": "^0.3.62",
7373
"@librechat/agents": "^2.4.68",
7474
"@librechat/data-schemas": "*",
75-
"@modelcontextprotocol/sdk": "^1.16.0",
75+
"@modelcontextprotocol/sdk": "^1.17.0",
7676
"axios": "^1.8.2",
7777
"diff": "^7.0.0",
7878
"eventsource": "^3.0.2",

0 commit comments

Comments
 (0)