Skip to content

Commit 3c61fb7

Browse files
Initial commit
0 parents  commit 3c61fb7

3,826 files changed

Lines changed: 773957 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.editorconfig‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2024-2026 the original author or authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
root = true
16+
17+
[*]
18+
charset = utf-8
19+
end_of_line = lf
20+
insert_final_newline = true
21+
trim_trailing_whitespace = true

‎.gitattributes‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
* text=auto eol=lf
2+
3+
*.png binary
4+
*.jpg binary
5+
*.jpeg binary
6+
*.gif binary
7+
*.ico binary
8+
*.zip binary
9+
*.gz binary
10+
*.jar binary
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Bug Report
3+
about: Create a report to help us improve
4+
title: '[Bug]:'
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
**<u>AgentScope-Java is an open-source project. To involve a broader community, we recommend asking your questions in English.</u>**
11+
12+
**Describe the bug**
13+
A clear and concise description of what the bug is.
14+
15+
**To Reproduce**
16+
Steps to reproduce the behavior:
17+
18+
1. You code
19+
2. How to execute
20+
3. See error
21+
22+
**Expected behavior**
23+
A clear and concise description of what you expected to happen.
24+
25+
**Error messages**
26+
Detailed error messages.
27+
28+
**Environment (please complete the following information):**
29+
30+
- AgentScope-Java Version: [e.g. 1.0.12, check your pom.xml dependency version or run `mvn dependency:tree | grep agentscope-parent:pom`(only mac/linux)]
31+
- Java Version: [e.g. 17]
32+
- OS: [e.g. macos, windows]
33+
34+
**Additional context**
35+
Add any other context about the problem here.

‎.github/ISSUE_TEMPLATE/custom.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: Custom issue template
3+
about: Describe this issue template's purpose here.
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**<u>AgentScope-Java is an open-source project. To involve a broader community, we recommend asking your questions in English.</u>**
11+
12+
13+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature Request
3+
about: Suggest an idea for this project
4+
title: '[Feature]: '
5+
labels: 'enhancement'
6+
assignees: ''
7+
8+
---
9+
10+
**<u>AgentScope-Java is an open-source project. To involve a broader community, we recommend asking your questions in English.</u>**
11+
12+
13+
**Is your feature request related to a problem? Please describe.**
14+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
15+
16+
**Describe the solution you'd like**
17+
A clear and concise description of what you want to happen.
18+
19+
**Describe alternatives you've considered**
20+
A clear and concise description of any alternative solutions or features you've considered.
21+
22+
**Additional context**
23+
Add any other context or screenshots about the feature request here.

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## AgentScope-Java Version
2+
3+
[The version of AgentScope-Java you are working on, e.g. 1.0.12, check your pom.xml dependency version or run `mvn dependency:tree | grep agentscope-parent:pom`(only mac/linux)]
4+
5+
## Description
6+
7+
[Please describe the background, purpose, changes made, and how to test this PR]
8+
9+
## Checklist
10+
11+
Please check the following items before code is ready to be reviewed.
12+
13+
- [ ] Code has been formatted with `mvn spotless:apply`
14+
- [ ] All tests are passing (`mvn test`)
15+
- [ ] Javadoc comments are complete and follow project conventions
16+
- [ ] Related documentation has been updated (e.g. links, examples, etc.)
17+
- [ ] Code is ready for review

‎.github/dependabot.yaml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "maven"
4+
directory: "/"
5+
open-pull-requests-limit: 20
6+
schedule:
7+
interval: "weekly"
8+
day: "sunday"
9+
time: "03:00"
10+
timezone: "Asia/Shanghai"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
applyTo: "**"
3+
---
4+
5+
When reviewing code, focus on:
6+
7+
## Java Code Standards
8+
- No non-English content allowed (except i18n resources)
9+
- No `@author` tags - git history tracks authorship
10+
- All public methods must have Javadoc
11+
- Check for simpler implementations with same functionality
12+
- Apply design principles (SOLID, DRY, etc.) for improvement opportunities
13+
- Use imports instead of fully qualified class names
14+
- No wildcard imports allowed
15+
16+
## Security Check
17+
- Hardcoded secrets, API keys, or credentials
18+
- Sensitive information leakage in logs
19+
- Input validation and sanitization
20+
- OWASP Top 10 vulnerabilities (SQL injection, XSS, etc.)
21+
22+
## Performance Check
23+
- Blocking calls in Reactor chains (improper `.block()` usage)
24+
- Unclosed resources (streams, connections)
25+
- Unnecessary object creation
26+
- N+1 query problems
27+
28+
## Documentation Sync Check
29+
- If changes affect functionality described in `docs/` directory, remind user to update corresponding documentation
30+
- Check if new features need documentation additions
31+
32+
## PR Title Check
33+
- Must follow conventional commit format: `type(scope): description`
34+
- Valid types: `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `chore`, `ci`, `build`
35+
- Title should accurately reflect the main changes in the PR
36+
- Keep it concise but descriptive
37+
38+
## Review Style
39+
- Be specific and actionable in feedback
40+
- Explain the "why" behind recommendations
41+
- Acknowledge good patterns when you see them
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
#!/bin/bash
2+
# Check that all extension jar modules are declared in agentscope-all and agentscope-bom
3+
# This prevents missing modules in the shaded uber-jar and BOM
4+
#
5+
# Rules:
6+
# - agentscope-all: Contains non-framework-specific extensions (shaded into uber-jar)
7+
# - agentscope-bom: Contains ALL published modules (for version management)
8+
9+
set -e
10+
11+
ALL_POM="agentscope-distribution/agentscope-all/pom.xml"
12+
BOM_POM="agentscope-distribution/agentscope-bom/pom.xml"
13+
14+
echo "Checking module sync between extensions, agentscope-all and agentscope-bom..."
15+
echo ""
16+
17+
# Framework-specific modules that should NOT be included in agentscope-all
18+
# These are integration modules that users should depend on separately
19+
# But they SHOULD be in agentscope-bom for version management
20+
#
21+
# Detection rules (by keyword in module name):
22+
# - *starter* : Spring Boot starters
23+
# - *quarkus* : Quarkus extensions
24+
# - *micronaut* : Micronaut extensions
25+
EXCLUDED_KEYWORDS=("starter" "quarkus" "micronaut")
26+
27+
# Test-only modules are part of the reactor but are not published runtime artifacts.
28+
EXCLUDED_FROM_DISTRIBUTION=("agentscope-extensions-model-e2e-tests")
29+
30+
# Two separate lists
31+
MODULES_FOR_ALL=() # Non-framework extensions -> shade into agentscope-all
32+
MODULES_FOR_BOM=() # All modules -> version management in BOM
33+
EXCLUDED_MODULES=() # Track which modules were excluded (for reporting)
34+
35+
# Function to check if module should be skipped for both agentscope-all and agentscope-bom
36+
is_distribution_excluded() {
37+
local module=$1
38+
for excluded in "${EXCLUDED_FROM_DISTRIBUTION[@]}"; do
39+
if [ "$module" = "$excluded" ]; then
40+
return 0 # true, is excluded from distribution checks
41+
fi
42+
done
43+
return 1 # false, should be checked
44+
}
45+
46+
# Function to check if module should be excluded from agentscope-all
47+
# Returns 0 (true) if module contains any of the excluded keywords
48+
is_excluded() {
49+
local module=$1
50+
for keyword in "${EXCLUDED_KEYWORDS[@]}"; do
51+
if [[ "$module" == *"$keyword"* ]]; then
52+
return 0 # true, is excluded
53+
fi
54+
done
55+
return 1 # false, not excluded
56+
}
57+
58+
# Function to extract artifactId from pom.xml (excluding parent's artifactId)
59+
extract_artifact_id() {
60+
local pom=$1
61+
awk '
62+
/<parent>/ { in_parent=1 }
63+
/<\/parent>/ { in_parent=0; next }
64+
!in_parent && /<artifactId>/ {
65+
gsub(/.*<artifactId>/, "")
66+
gsub(/<\/artifactId>.*/, "")
67+
print
68+
exit
69+
}
70+
' "$pom"
71+
}
72+
73+
# Function to check packaging type (default is jar)
74+
get_packaging() {
75+
local pom=$1
76+
local packaging=$(grep -o '<packaging>[^<]*</packaging>' "$pom" 2>/dev/null | sed 's/<[^>]*>//g' || echo "jar")
77+
echo "$packaging"
78+
}
79+
80+
# Scan agentscope-extensions directory for jar modules
81+
echo "Scanning agentscope-extensions/ for jar modules..."
82+
for pom in $(find "agentscope-extensions" -name "pom.xml" -type f); do
83+
packaging=$(get_packaging "$pom")
84+
85+
# Skip pom packaging (aggregator modules)
86+
if [ "$packaging" = "pom" ]; then
87+
continue
88+
fi
89+
90+
artifact_id=$(extract_artifact_id "$pom")
91+
92+
# Skip if no artifactId found
93+
if [ -z "$artifact_id" ]; then
94+
continue
95+
fi
96+
97+
# Test-only modules should not be added to the BOM or shaded uber-jar.
98+
if is_distribution_excluded "$artifact_id"; then
99+
EXCLUDED_MODULES+=("$artifact_id")
100+
continue
101+
fi
102+
103+
# All jar modules go to BOM list
104+
MODULES_FOR_BOM+=("$artifact_id")
105+
106+
# Only non-excluded modules with agentscope-extensions-* prefix go to ALL list
107+
if [[ "$artifact_id" == agentscope-extensions-* ]]; then
108+
if is_excluded "$artifact_id"; then
109+
EXCLUDED_MODULES+=("$artifact_id")
110+
else
111+
MODULES_FOR_ALL+=("$artifact_id")
112+
fi
113+
elif is_excluded "$artifact_id"; then
114+
# Track non-extension excluded modules (e.g., starters)
115+
EXCLUDED_MODULES+=("$artifact_id")
116+
fi
117+
done
118+
119+
# Remove duplicates and sort
120+
MODULES_FOR_ALL=($(printf '%s\n' "${MODULES_FOR_ALL[@]}" | sort -u))
121+
MODULES_FOR_BOM=($(printf '%s\n' "${MODULES_FOR_BOM[@]}" | sort -u))
122+
EXCLUDED_MODULES=($(printf '%s\n' "${EXCLUDED_MODULES[@]}" | sort -u))
123+
124+
# Add agentscope-core to BOM list (it's in a separate directory)
125+
MODULES_FOR_BOM+=("agentscope-core")
126+
127+
echo ""
128+
echo "Modules to check for agentscope-all (${#MODULES_FOR_ALL[@]} extensions):"
129+
for m in "${MODULES_FOR_ALL[@]}"; do
130+
echo " - $m"
131+
done
132+
133+
echo ""
134+
echo "Modules to check for agentscope-bom (${#MODULES_FOR_BOM[@]} total):"
135+
for m in "${MODULES_FOR_BOM[@]}"; do
136+
echo " - $m"
137+
done
138+
139+
echo ""
140+
echo "Excluded from agentscope-all or distribution checks (keywords: ${EXCLUDED_KEYWORDS[*]}; explicit: ${EXCLUDED_FROM_DISTRIBUTION[*]}):"
141+
for m in "${EXCLUDED_MODULES[@]}"; do
142+
echo " - $m"
143+
done
144+
echo ""
145+
146+
# Check modules against agentscope-all and agentscope-bom
147+
MISSING_IN_ALL=()
148+
MISSING_IN_BOM=()
149+
150+
# Check agentscope-all
151+
for module in "${MODULES_FOR_ALL[@]}"; do
152+
if ! grep -q "<artifactId>${module}</artifactId>" "$ALL_POM"; then
153+
MISSING_IN_ALL+=("$module")
154+
fi
155+
done
156+
157+
# Check agentscope-bom
158+
for module in "${MODULES_FOR_BOM[@]}"; do
159+
if ! grep -q "<artifactId>${module}</artifactId>" "$BOM_POM"; then
160+
MISSING_IN_BOM+=("$module")
161+
fi
162+
done
163+
164+
# Report results
165+
EXIT_CODE=0
166+
167+
if [ ${#MISSING_IN_ALL[@]} -gt 0 ]; then
168+
echo "=========================================="
169+
echo "ERROR: Missing in $ALL_POM:"
170+
echo "=========================================="
171+
echo ""
172+
echo "Add the following dependencies to shade into the uber-jar:"
173+
echo ""
174+
for m in "${MISSING_IN_ALL[@]}"; do
175+
echo " <dependency>"
176+
echo " <groupId>io.agentscope</groupId>"
177+
echo " <artifactId>${m}</artifactId>"
178+
echo " <scope>compile</scope>"
179+
echo " <optional>true</optional>"
180+
echo " </dependency>"
181+
echo ""
182+
done
183+
EXIT_CODE=1
184+
fi
185+
186+
if [ ${#MISSING_IN_BOM[@]} -gt 0 ]; then
187+
echo "=========================================="
188+
echo "ERROR: Missing in $BOM_POM:"
189+
echo "=========================================="
190+
echo ""
191+
echo "Add the following dependencies for version management:"
192+
echo ""
193+
for m in "${MISSING_IN_BOM[@]}"; do
194+
echo " <dependency>"
195+
echo " <groupId>io.agentscope</groupId>"
196+
echo " <artifactId>${m}</artifactId>"
197+
echo " <version>\${project.version}</version>"
198+
echo " </dependency>"
199+
echo ""
200+
done
201+
EXIT_CODE=1
202+
fi
203+
204+
if [ $EXIT_CODE -eq 0 ]; then
205+
echo "=========================================="
206+
echo "SUCCESS: All modules are properly synced!"
207+
echo "=========================================="
208+
echo ""
209+
echo "- agentscope-all: ${#MODULES_FOR_ALL[@]} extension modules"
210+
echo "- agentscope-bom: ${#MODULES_FOR_BOM[@]} total modules"
211+
fi
212+
213+
exit $EXIT_CODE
214+

0 commit comments

Comments
 (0)