Skip to content

Commit eeafc29

Browse files
Merge branch 'main' into task/support-local-builds-in-samples
2 parents 1df6f0b + 641df74 commit eeafc29

File tree

17 files changed

+1241
-205
lines changed

17 files changed

+1241
-205
lines changed

.github/workflows/codeql.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: "CodeQL Advanced"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
schedule:
9+
- cron: '0 4 * * 0'
10+
11+
jobs:
12+
analyze:
13+
name: Analyze (${{ matrix.language }})
14+
runs-on: ubuntu-latest
15+
permissions:
16+
# required for all workflows
17+
security-events: write
18+
19+
# required to fetch internal or private CodeQL packs
20+
packages: read
21+
22+
# only required for workflows in private repositories
23+
actions: read
24+
contents: read
25+
26+
strategy:
27+
matrix:
28+
language: [ java-kotlin ]
29+
30+
steps:
31+
- name: Checkout repository
32+
uses: actions/checkout@v4
33+
34+
- uses: actions/setup-java@v4
35+
with:
36+
distribution: temurin
37+
java-version: '21'
38+
39+
# Initializes the CodeQL tools for scanning.
40+
- name: Initialize CodeQL
41+
uses: github/codeql-action/init@v3
42+
with:
43+
languages: ${{ matrix.language }}
44+
build-mode: manual
45+
46+
- uses: actions/cache@v4
47+
with:
48+
path: |
49+
~/.gradle/caches
50+
~/.gradle/wrapper
51+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
52+
53+
- name: Build Kotlin sources
54+
run: |
55+
./gradlew \
56+
:build -Pkotlin.incremental=false \
57+
--no-daemon --stacktrace --parallel
58+
59+
- name: Analyze
60+
uses: github/codeql-action/analyze@v3
61+
with:
62+
category: '/language:${{ matrix.language }}'

api/kotlin-sdk.api

Lines changed: 372 additions & 53 deletions
Large diffs are not rendered by default.

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ atomicfu = "0.29.0"
88
serialization = "1.9.0"
99
collections-immutable = "0.4.0"
1010
coroutines = "1.10.2"
11-
ktor = "3.2.1"
12-
mockk = "1.14.4"
11+
ktor = "3.2.2"
12+
mockk = "1.14.5"
1313
logging = "7.0.7"
1414
jreleaser = "1.19.0"
1515
binaryCompatibilityValidatorPlugin = "0.18.1"

src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/server/Server.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ public open class Server(
558558
* @param params The logging message notification parameters.
559559
*/
560560
public suspend fun sendLoggingMessage(params: LoggingMessageNotification) {
561-
logger.trace { "Sending logging message: ${params.data}" }
561+
logger.trace { "Sending logging message: ${params.params.data}" }
562562
notification(params)
563563
}
564564

@@ -568,7 +568,7 @@ public open class Server(
568568
* @param params Details of the updated resource.
569569
*/
570570
public suspend fun sendResourceUpdated(params: ResourceUpdatedNotification) {
571-
logger.debug { "Sending resource updated notification for: ${params.uri}" }
571+
logger.debug { "Sending resource updated notification for: ${params.params.uri}" }
572572
notification(params)
573573
}
574574

src/commonMain/kotlin/io/modelcontextprotocol/kotlin/sdk/shared/Protocol.kt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,11 +292,11 @@ public abstract class Protocol(
292292
}
293293

294294
private fun onProgress(notification: ProgressNotification) {
295-
LOGGER.trace { "Received progress notification: token=${notification.progressToken}, progress=${notification.progress}/${notification.total}" }
296-
val progress = notification.progress
297-
val total = notification.total
298-
val message = notification.message
299-
val progressToken = notification.progressToken
295+
LOGGER.trace { "Received progress notification: token=${notification.params.progressToken}, progress=${notification.params.progress}/${notification.params.total}" }
296+
val progress = notification.params.progress
297+
val total = notification.params.total
298+
val message = notification.params.message
299+
val progressToken = notification.params.progressToken
300300

301301
val handler = _progressHandlers.value[progressToken]
302302
if (handler == null) {
@@ -424,7 +424,12 @@ public abstract class Protocol(
424424
_responseHandlers.update { current -> current.remove(messageId) }
425425
_progressHandlers.update { current -> current.remove(messageId) }
426426

427-
val notification = CancelledNotification(requestId = messageId, reason = reason.message ?: "Unknown")
427+
val notification = CancelledNotification(
428+
params = CancelledNotification.Params(
429+
requestId = messageId,
430+
reason = reason.message ?: "Unknown"
431+
)
432+
)
428433

429434
val serialized = JSONRPCNotification(
430435
notification.method.value,

0 commit comments

Comments
 (0)