001/* 002 * Copyright 2022-2026 Revetware LLC. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package com.soklet; 018 019import org.jspecify.annotations.NonNull; 020 021import javax.annotation.concurrent.ThreadSafe; 022 023/** 024 * Thread-safe listener for application-owned MCP task-change events. 025 * <p> 026 * Events are deliberately coarse and carry only a task ID. Soklet performs a 027 * fresh, authorized lookup through {@link McpTaskManager} before it projects a 028 * task notification; event delivery is never authoritative task state. 029 * Publishers may invoke one listener concurrently for independent events. 030 * Listener implementations should return promptly and must not assume which 031 * thread performs delivery. 032 * 033 * @author <a href="https://www.revetkn.com">Mark Allen</a> 034 */ 035@ThreadSafe 036@FunctionalInterface 037public interface McpTaskEventListener { 038 /** 039 * Reports that the durable state of a task may have changed. 040 * 041 * @param taskId changed task identifier 042 */ 043 void onTaskChanged(@NonNull String taskId); 044}